- Name: Justin Renaud
- ID: 40250463
- Email: justin.tovich@gmail.com
For each step described in the project description, there is a single notebook file that contains the code for that step. There may also be an additional .py file for each step if applicable that contains classes to be reused any notebook files.
-
Step 2
2_dataset_overview.ipynbThis file contains the code showing preprocessing steps and basic visualization of the data. However, the actual class that loads for the rest of the project is in the filedataset_overview.py.dataset_overview.pyThis file contains the LimitedCIFAR10 class that is then used in the rest of the project to load the data.
-
Step 3
3_naive_bayes.ipynbThis file contains the training and testing of the custom and sklearn implementation of the Gaussian Naive Bayes classifier. However, the actual custom classifier object is defined in the filenaive_bayes.py.naive_bayes.pyThis file contains the GaussianNaiveBayesClassifier class.
-
Step 4
4_decision_tree.ipynbThis file contains the training and testing of the custom and sklearn implementation of the Decision Tree classifier. However, the actual custom classifier object is defined in the filedecision_tree.py. It runs the different trials while showing preliminary results and plots.decision_tree.pyThis file contains the DecisionTreeClassifier class.
-
Step 5
5_mlp.ipynbThis file contains the training and testing of the main and variants of a MLP classifier. The MLP classifier is defined as SimpleMLP in the filemlp.py. It runs the different trials while showing preliminary results and plots.
-
Step 6
6_cnn.ipynbThis file contains the training and testing of the main and variants of a VGG11 CNN classifier. The CNN classifier is defined as CustomVGG11 in the filecnn.py. For the trials, a more flexible class is used called FlexibleVGG11. It runs the different trials while showing preliminary results and plots such as training and testing curves and feature maps.cnn.pyThis file contains the CustomVGG11 class and the FlexibleVGG11 class.
-
Step 7
7_evaluation.ipynbThis file loads back the models and evaluates them on the test set. It also contains the code to generate metrics table and the confusion matrix for each model.
To run the project, ensure you download the models zip folder from the moodle submission and extract it in a models
folder in the root directory such that you can access a model at models/naive_bayes/main_custom_nb.joblib.
Then, you can run the notebooks in the order of the steps to reproduce the results.
Make sure to run the cells in order as some cells depend on previous cells to be run and some variables are reused.
(You do not have to run the .py files as they are only used as imports in the notebooks)
Models: https://drive.google.com/file/d/1-k78puZ9gwwkCJMNDf6rCcEeU3KN33xX/view?usp=sharing
WARNING: re-running the notebooks will overwrite the models in the models folder. If you want to keep the models, make sure to move them to another folder before re-running the notebooks.
scikit-learn torch numpy pandas (used once for exporting the metrics table to a csv file for the report) matplotlib joblib (for saving and loading models not with torch) (and other standard libraries like os, time, etc.)