src/ contains all required code files for the application serving predictions. In particular, it contains featurization, scoring and thresholding functions (in featurizer.py, scorer.py and thresholder.py).
A scikit-learn model is also required, but it is stored outside of the code repository. Make sure to create a .env file at the root of this repo, specifying a value for a DATA_PATH key where data files and models can be found (see what mine looks like in sample.env).
Serving can be done with one of the following ways:
local_app.py, and command lines for serving the app in Local-Serving.ipynb (Bash notebook)gmsc.py and live deploymentBoth Python files follow the same structure:
front function in front.pymodel_builder/ contains scripts for building the scikit-learn model used by the app:
01-Split.ipynb02-Featurize.ipynb (which reuses featurizer.py from the src/ directory)03-Train-model.ipynb04-Optimize-threshold.ipynbA training set is required. Use 00-Get-data.ipynb to get raw data from Kaggle.
requirements.txt lists the requirements for running the app "in production", on the Algorithmia platform. It can be generated from the Python environment you used to build the model by running requirements.py.requirements-dev.txt is where you would customize the list of requirements for this project. It is used by DeepNote upon starting up the project, for initializing the environment.algorithmia.conf: this was automatically generated by AlgorithmiaGit.ipynb: git commands cheatsheetDvc.ipynb: dvc commands cheatsheetdvcMake sure you've set up .env file (which contains the path to the data/ folder) and your Kaggle secrets (to download the raw data).
dvc repro
Changes to the training set, to the scripts in model_builder/, or to the functions in src/ result in a different model. After making such changes, you should:
__version__ in __init.py__ (I recommend setting this to the date of the change, in YYYYMMDD format)gmsc_YYYYMMDD.pkl file in the data path specified in .env, where YYYYMMDD is the date of the changerequirements.py__init.py__, requirements.txt, and the contents of src/)gmsc_YYYYMMDD.pkl to AlgorithmiaLouis Dorard © 2020-2021 All Rights Reserved
Content type
Image
Digest
Size
502.4 MB
Last updated
over 5 years ago
docker pull louisdorard/gmsc