This document outlines the steps for activating the virtual environment and processing data in our project.
For Windows users, activate the local virtual environment by running the following command in the root folder:
For Windows users, activate the local virtual environment by running the following command in the root folder:
.\.venv\Scripts\activate
Follow these steps in sequence to process your data:
Run the following command to process the raw data:
python src\data\process_data.py data\raw\results_2024_03_04.xlsx data\interim\results_2024_03.04.xlsx
Filter the processed data using this command:
python src\data\filter_data.py data\interim\results_2024_03.04.xlsx data\interim\filtered_results_2024_03.04.xlsx
python script_name.py input_file.xlsx output_file.xlsx 2024-04-03 python src\data\filter_by_date.py data\interim\filtered_results_2024_05.11.xlsx data\interim\filtered_results_2024_05.11.xlsx 2024-04-03
Encode the filtered data with the following command:
python src\data\encode_data_const.py data\interim\filtered_results_2024_03.04.xlsx data\processed\encoded_results_2024_03.04.xlsx
To encode data for all combinations, use:
python src\data\encode_data.py data\interim\filtered_results_2024_03.04.xlsx --output_folder data\processed
Split the data into training and test sets with this command:
python src\data\split_data.py data\processed\filtered_results_2024_03.04_OrdinalOrdinalOneHotOneHot.xlsx --output_folder data\processed
Finally, scale the train and test sets and save the scalar to the references folder using:
python src\features\feature_scaling.py filtered_results_2024_03.04_OrdinalOrdinalOneHotOneHot --output_folder data\processed --columns ARTIST TECHNIQUE "TOTAL DIMENSIONS" YEAR
Connect the scaled Train and Test set with CNN features to ensure that there is no data leakage. Connect them by ImageName.
python create_feature_price_datasets.py <train_file_path> <test_file_path> <features_file_path>
python src\features\create_feature_price_datasets.py data\processed\filtered_results_2024_03.04_OrdinalOrdinalOneHotOneHot_train_scaled.xlsx data\processed\filtered_results_2024_03.04_OrdinalOrdinalOneHotOneHot_test_scaled.xlsx data\interim\features.csv
The created dataset with CNN features has lower number of rows comparing to the Test set from tabular data approach. Equalize the number of rows by removing the one which were not used for merging.
python equalize_rows_number.py <to_remove_from_file_path> <to_compare_file_path>
python src\data\equalize_rows_number.py data\processed\filtered_results_2024_03.04_OrdinalOrdinalOneHotOneHot_test_scaled.xlsx data\processed\test_features_price.csv
python src\data\equalize_rows_number.py data\processed\filtered_results_2024_03.04_OrdinalOrdinalOneHotOneHot_train_scaled.xlsx data\processed\train_features_price.csv