The project was tested with Python 3.12.2, 3.11.9 and 3.10.11.
To only run the Python code, create a virtual environment (recommended) with python3 -m venv .venv and activate it with source .venv/bin/activate (or in Windows .\.venv\Scripts\activate). Then install the requirements with pip install -r requirements.txt. Afterward, you can run the Python module with:
python -m project --allThis will run all the project parts (due to the --all flag) and save the plots under the images directory.
To view all the available options run the command:
python -m project --helpFor example, to only run labs 2 and 5, you can use the command:
python -m project --labs 2 5To build the report you can pass the --compile_pdf flag, for example:
python -m project --compile_pdf --allYou can also suppress the output with the --quiet flag.
The project is structured as follows:
- data: Contains the Datasets used in the project (training/validation and evaluation).
-
models: Contain the
JSONserialized representation of the best configuration of each model for our application prior$\tilde{\pi} = 0.1$ , not compressed to make them human-readable.-
scores: The scores of each model on the application prior
$\tilde{\pi} = 0.1$ will be saved here.
-
scores: The scores of each model on the application prior
-
project: Contains the Python module with the project code.
- labs: Contains the code for each part of the project grouped by lab.
-
funcs: Contains common functions for the project (like
DCF,PCA,LDAetc...). -
classifiers: Contain the four classifiers used in the project, the
Binary Gaussian,Gaussian Mixture Model,Support Vector MachineandLogistic Regressionclassifiers. - tests: Contains some testing code.
- figures: Contains the code for the plotting and terminal pretty printing.
-
report: Contains the
Typstcode for the report.