-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
client.repository.store_model currently only accepts model objects or binaries, but in cases when the model pipeline is dependent on custom classes that must be referenced before predict can be called, there is no option to add the module to the deployment.
e.g using Custom Transformer class with sklearn pipeline like below
class CatTransform( BaseEstimator, TransformerMixin ):
def __init__(self, **kwargs):
pass
def fit( self, X, y = None ):
return self
def transform(self, X , y = None ):
...
categorical_pipeline = Pipeline( steps = [
( 'cat_transform', CatTransform() ),
( 'one_hot_encoder', OneHotEncoder( sparse = False ) ) ] )
model_pipeline = Pipeline( steps = [ ( 'cat_pipeline', categorical_pipeline),
( 'model', svm.SVC() ) ] )
model_pipeline.fit( X_train, y_train )
When container is deployed, and model is loaded in memory thisCatTransfrom class not being present inside the artifact throws a model load error with missing module
having a option to upload a directory with model binaries and all custom scripts might be a way to mitigate this issue.
Metadata
Metadata
Assignees
Labels
No labels