Quick Start¶
Obtaining Converted Models¶
After installing the package, get the converted models as a dict from the models variable:
from msdss_models_sklearn import models as sklearn_models
sklearn_models['sklearn.linear_model.LinearRegression']
msdss_models_sklearn.core.LinearRegression
For more details, see msdss_models_sklearn.core.get_sklearn_models().
Note
The extracted models can also be imported directly from the package if you do not require all the models in your API:
from msdss_models_sklearn import LinearRegression, DecisionTreeClassifier
selected_models = [LinearRegression, DecisionTreeClassifier]
selected_models
[msdss_models_sklearn.core.LinearRegression,
msdss_models_sklearn.core.DecisionTreeClassifier]
Adding Converted Models to Models API¶
To add the converted scikit-learn models to the msdss-models-api, set the models argument to the imported models:
from msdss_models_api import ModelsAPI
from msdss_models_sklearn import models as sklearn_models
# Create app using env vars
app = ModelsAPI(models=sklearn_models)
# Get the redis background worker to run using celery
worker = app.get_worker()
See msdss-models-api Quick Start for more details on running the API.
Note
Ensure that msdss-models-api has been installed and setup properly for the API to work.