Reputation: 488
I'm very new to understanding the use of MLFlow but need assistance, I'm trying to understand on how to try and fit and predict my model once again. I'm able to call my model by:
PLS_model = mlflow.pyfunc.load_model("runs:/FFFFF!@#!@#@!#!/logged_model", suppress_warnings = True)
and get:
mlflow.pyfunc.loaded_model:
artifact_path: logged_model
flavor: mlflow.sklearn
run_id: FFFFF!@#!@#@!#!
But when I try to call any methods as:
1).fit or .predict. I get the following error
AttributeError: 'PyFuncModel' object has no attribute 'fit'
AttributeError: 'PyFuncModel' object has no attribute 'predict'
Here I encountered on how to actually call these functions but not sure if I'm doing this correctly. In summary, how can I predict, fit to my new data.
Thanks
Upvotes: 1
Views: 5381
Reputation: 525
Try to use sklearn model loader
import mlflow.sklearn
model = mlflow.sklearn.load_model(..)
model.predict(...)
Upvotes: 4