tools

create_init_method

msdss_models_sklearn.tools.create_init_method(can_input=True, can_output=True, can_update=True)[source]

Create model init method for scikit-learn models to be compatible with msdss_models_api.models.Model.

See msdss_models_api.models.Model.

Parameters
  • can_input (bool) – Whether the method .input is defined and available. This is useful for controlling route requests in an API.

  • can_output (bool) – Whether the method .output is defined and available. This is useful for controlling route requests in an API.

  • can_update (bool) – Whether the method .update is defined and available. This is useful for controlling route requests in an API.

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_models_sklearn.tools import *
from sklearn.linear_model import LinearRegression

input = create_input_method(LinearRegression)

create_input_method

msdss_models_sklearn.tools.create_input_method(model)[source]

Create model input method for scikit-learn models to be compatible with msdss_models_api.models.Model.

See msdss_models_api.models.Model.input().

Parameters

model (class) – Scikit-learn model class to create machine learning models.

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_models_sklearn.tools import *
from sklearn.linear_model import LinearRegression

input = create_input_method(LinearRegression)

create_output_method

msdss_models_sklearn.tools.create_output_method()[source]

Create model output method for scikit-learn models to be compatible with msdss_models_api.models.Model.

See msdss_models_api.models.Model.output().

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_models_sklearn.tools import *

output = create_output_method()

create_update_method

msdss_models_sklearn.tools.create_update_method()[source]

Create model update method for scikit-learn models to be compatible with msdss_models_api.models.Model.

See msdss_models_api.models.Model.update().

Author

Richard Wen <rrwen.dev@gmail.com>

Example

from msdss_models_sklearn.tools import *

update = create_output_method()