CoolFace
Apppublic

mininato/EmotionClassificationPipeline

sourceHugging Facemitupdated 2y agoView on Hugging Face
0likes
01_combining_dataframes_pipeline.py27 linesDownload Raw Back to root
1from sklearn.pipeline import Pipeline2from pipeline_classes import CreateCombinedDataFrame3from _config import config4import time5import pandas as pd6 7accel_data = pd.read_csv(config["accel_path"])8reports_data = pd.read_csv(config["reports_path"])9 10X = (reports_data, accel_data)11 12# This pipeline combines the self-reports and accelerometer dataframes with a given timewindow into a single dataframe as a csv file13combining_dataframes_pipeline = Pipeline([14    #('import_data', ImportData(use_accel=True, use_reports=True, use_combined=False, use_features=False)),  # input path to self-reports data),15    ('create_combined_dataframe', CreateCombinedDataFrame(time_window=config["time_window"], label_columns=config["label_columns"])),16])17 18# This will measure the time taken to run the pipeline19start_time = time.time()20 21# This will start the pipeline and return the combined dataframe22output_df = combining_dataframes_pipeline.fit_transform(X)23 24 25end_time = time.time()26print(f"Time taken: {int((end_time - start_time) // 60)} minutes and {(end_time - start_time) % 60:.2f} seconds")27