This repo consists of codebase for linear feature engineering, the first project for Quantitative Foundations. We use Linear Regression as the learning algorithm. The training data in traindata.txt
consists of 926 data points with 8 features and 1 output real value. And, the test data in testinputs.txt
consists of 103 data points. Since, the number of training data points is extremely low, we rely on cross validation to avoid overfitting.
To run the codebase, follow the steps below.
- Install the dependencies using the following command.
pip install -r requirements.txt
- The predictions made by our best least squares model are already dumped to
reports/prediction_results.csv
file. In order to regenerate the test predictions, using the obtained best model, run the following command. It will write the results to the file.
python main.py --mode test
- Run the training pipeline using the following command. It will search the best feature expansion and writes a training visualization of validation MSE scores against different basis settings and the predictions on test set inside
results
directory.
python main.py --mode train
- To visualize the analysis done on the data, run the following command. The visualization results are dumped inside
data_viz
directory.
python main.py --data-analysis True