This repository contains the project files for the Linear and Nonlinear Models course at the University of Chicago.
├── data/
│ ├── raw/ # Raw data files
│ ├── processed/ # Processed data files ready for analysis
├── notebooks/
│ ├── exploratory/ # Notebooks for exploratory data analysis (EDA)
│ ├── modeling/ # Notebooks for model development and tuning
│ ├── xai/ # Notebooks for Explainable AI (XAI) techniques
├── reports/
│ ├── figures/ # Figures and plots for reports
│ ├── final_report/ # Final project report
│ ├── presentations/ # Slide decks for presentations
├── src/
│ ├── data/ # Scripts for data preprocessing
│ ├── features/ # Scripts for feature engineering
│ ├── models/ # Scripts for training and evaluating models
│ ├── xai/ # Scripts for XAI methods (LIME, SHAP & etc.)
├── tests/ # Unit tests and integration tests
├── environement.yaml # Environment and list of dependencies
├── README.md # Project overview and setup instructions
├── .gitignore # Git ignore file
├── .gitattributes # Git attributes file
- Python 3.10.13
- Anaconda (recommended for environment management)
-
Clone the repository:
git clone https://github.com/allenpavlovich/uchicago-lnm-project.git cd uchicago-lnm-project
-
Create and activate the conda environment V1:
conda env create -f environment_macos.yaml # Using .yaml extension #[OPTIONAL] conda env update --file environment_macos.yaml --prune ## ONLY FOR MACOS USERS, IF ABOVE DOENS'T WORK conda activate uchicago_lnm_project
-
Creating a Conda Environment Using Anaconda Navigator V2
To create a conda environment using the provided environment.yaml
file via Anaconda Navigator, follow these steps:
-
Open Anaconda Navigator:
- Launch Anaconda Navigator from your applications menu or by running
anaconda-navigator
in your terminal.
- Launch Anaconda Navigator from your applications menu or by running
-
Go to the Environments Tab:
- Click on the "Environments" tab on the left sidebar.
-
Import the Environment:
- Click on the "Import" button located at the bottom of the environments list.
-
Select the
environment.yaml
File:- In the dialog that appears, click the folder icon to navigate to the location of your
environment.yaml
file. - Select the
environment.yaml
file and click "Open".
- In the dialog that appears, click the folder icon to navigate to the location of your
-
Name the Environment:
- In the "Name" field, enter a name for the new environment (e.g.,
YOUR_ENV_NAME
).
- In the "Name" field, enter a name for the new environment (e.g.,
-
Create the Environment:
- Click the "Import" button to create the environment from the YAML file.
-
Activate the Environment:
-
Once the environment is created, you can activate it via the terminal.
-
Open a terminal window and activate the environment with the following command:
conda activate YOUR_ENV_NAME
-
-
Start Working on Your Project:
-
Navigate to your project directory if not already there:
cd /path/to/your/project
-
Now you can start working on your project with the newly created environment.
-
To run the unit tests for this project, follow these steps:
-
Ensure you have the Conda environment activated:
conda activate uchicago_lnm_project
-
Navigate to the root directory of the project.
-
Run the tests using the following command:
python -m unittest discover -s tests -v
This will discover and run all the test cases in the tests
directory.
-
Feature Branches:
- Naming convention:
feature/description
- Example:
feature/add-xai-methods
- Naming convention:
-
Bugfix Branches:
- Naming convention:
bugfix/description
- Example:
bugfix/fix-data-loading-error
- Naming convention:
-
Experimental Branches:
- Naming convention:
experiment/description
- Example:
experiment/test-new-model
- Naming convention:
-
Create a Branch:
git checkout -b feature/new-analysis
-
Make Changes and Commit:
git add . git commit -m "Add exploratory data analysis for sentiment distribution"
-
Push Branch:
git push origin feature/new-analysis
-
Create a Pull Request:
- Go to the repository on GitHub.
- Click on "Compare & pull request".
- Add a description of the changes and assign reviewers.
- Submit the pull request for review.
-
Review and Merge:
- Team members review the pull request.
- Address any feedback and make necessary changes.
- Once approved, merge the pull request into the
main
branch.
# Create a new branch for your feature
git checkout -b feature/add-xai-methods
# Make changes and commit
git add .
git commit -m "Implement SHAP and LIME for model explainability"
# Push the branch to the remote repository
git push origin feature/add-xai-methods
# Create a pull request on GitHub and request a review
# Once approved, merge the pull request