mlflow --version):0.7.0Currently, the serve_model method of mlflow/sklearn.py returns only "model.predict(records)".
I think that there are times when we want to know the classification probability of each class when classifying.
So I suggest adding a function to return "model.predict_proba(records)" results to this method.
Thank you.
Hi,
a quick fix would be to overwrite the "predict" function of your sklearn model with "predict_proba" before saving it. This is a bit hacky though. Not sure what the view of the core dev team is, but if they want to adress this more nicely, I'd be happy to pick it up.
Hi,
Thanks for your reply.
I used to rewrite predict () into predict_proba () by myself before too. I believe there is a demand for data scientists who wish to use predict_proba ().
I have a similar use case but with another custom function predict_distribution.
For now, I will override the predict method during the training but it would be better to offer a way to do it natively. Any help or suggestions are welcome. Thanks in advance. :)
Hi all, sorry for the delayed response - this should be possible in MLflow >= 1.0 by using custom Python models (see the docs), in particular this example - you can define a wrapper model class that loads the persisted sklearn model & returns the results of predict_proba. Please feel free to reopen with any questions!
Most helpful comment
Hi all, sorry for the delayed response - this should be possible in MLflow >= 1.0 by using custom Python models (see the docs), in particular this example - you can define a wrapper model class that loads the persisted sklearn model & returns the results of
predict_proba. Please feel free to reopen with any questions!