Setup the model template
The model template comes with a fully functional model that can do training and predicting, albeit with rather poor predicting capability. To setup the model template, several steps are necessary:
- Renaming the model template package
- Installing dependency libraries
Renaming the package
When you get the package, it will be named as exodus_model_template
, which is most definitely not the
name for the model algorithm you are going to build. To rename the entire package, run the renaming script:
python scripts/rename.py [NAME_OF_THE_MODEL]
Installing dependency libraries
To install the dependency libraries, enter the following command (assuming you've already installed the packages specified in the Dependencies
section):
poetry install --no-root
This command will install all the dependency libraries for you.
The libraies
The model algorithm template depends on several libraries, the ones that are used extensively are:
- pandas: the de-facto go-to data analysis package for Python. We are using v1.4.0.
- Note that
pandas
artifacts such asDataFrame
are not backward compatible. Think it through if you want to bump its version.
- Note that
- numpy: Python's math libaray. We are using v1.21.0.
- scikit-learn: the machine learning Swiss knife library. Currently only the
LabelEncoder
class is used. We are using v1.0.2.- Note that
scikit-learn
artifacts such asLabelEncoder
are not backward compatible. Think it through if you want to bump its version.
- Note that
- pymongo: the MongoDB Python client library.
- jinja2: a templating tool for Python. Used for generating migration scripts.
- fastapi: the web framework we chose to run the model algorithm service on. We are using v0.14.1.
- pydantic: the data validation library for Python classes. We are using v.1.9.0.
- exodusutils: the utility functions for Exodus. The version of this package is subject to change.