This template repo will give you a good starting point for your second project. Besides the files used for creating a virtual environment, you will find a simple example of how to build a simple model in a python script. This is maybe the simplest way to do it. We train a simple model in the jupyter notebook, where we select only some features and do minimal cleaning. The output is then stored in simple python scripts.
The data used for this is: coffee quality dataset.
Go to ML-Project Template.
-
Create new repository with relevant name, the owner should be your own account.
-
In your newly create repo, navigate to "Projects", and then click on "Link a project" (blue button). Normally you don't have created a project yet, so you can click the arrow navigation to create project on your profile. This project can be added at the end to your repository.
-
You will be guided to your profiles projects and it will be shown a create project window. Choose "board" view and not "table" view.
-
Now change the name of your board, to match that of your chosen ML project. Then click "Create project" blue button. Great you create Kanban Board
-
Next, assign rights to all your team members by clicking on the 3 dots on the top right of the board, and then go to "Settings".
-
Next, click on "Manage Access". Add your team mates by Searching for their github handle in the search window.Change their Role from ‘Write’ to ‘Admin’. Click on the blue button “Invite” to add them. Repeat for all team members.
-
Next,go back to the kanban board and at the bottom add action items with the relevant name e.g. “load data”, "get statistics", etc.
-
Convert added item to issue by clicking on the 3 dots on the particular added item.
-
Then select the repo you created for the issue to be added. (Select the project repo example “my-project-name”)
-
Click on ”New milestone”.
-
Give the milestone a due date and description as per the example provided by the coaches. Add description of:
A) What needs to be completed to be done with the milestone
B) The definition of done: what will your result look like when you have completed the milestone? (check the provided format)
-
Now navigate to "issues".
Workflows can help you keep your kanban board automatically on track.
Select the project created in the steps above.
Click on the 3 dots to the far right of the board (...)
Select workflow as the first option.
Activate the ones you feel necessary to your project
Go back to your project repository (fraud detection))
-
For installing the virtual environment you can either use the Makefile and run
make setup
or install it manually with the following commands:make setup
After that active your environment by following commands:
source .venv/bin/activate
Or ....
-
Install the virtual environment and the required packages by following commands:
pyenv local 3.11.3 python -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt
-
Install the virtual environment and the required packages by following commands.
For
PowerShell
CLI :pyenv local 3.11.3 python -m venv .venv .venv\Scripts\Activate.ps1 python -m pip install --upgrade pip pip install -r requirements.txt
For
Git-bash
CLI :pyenv local 3.11.3 python -m venv .venv source .venv/Scripts/activate python -m pip install --upgrade pip pip install -r requirements.txt
Note:
If you encounter an error when trying to runpip install --upgrade pip
, try using the following command:python.exe -m pip install --upgrade pip
In order to train the model and store test data in the data folder and the model in models run:
Note
: Make sure your environment is activated.
python example_files/train.py
In order to test that predict works on a test set you created run:
python example_files/predict.py models/linear_regression_model.sav data/X_test.csv data/y_test.csv
Development libraries are part of the production environment, normally these would be separate as the production code should be as slim as possible.