Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scikit-learn support for predict method not only predict_proba #145

Closed
smolina74 opened this issue Apr 25, 2018 · 3 comments
Closed

scikit-learn support for predict method not only predict_proba #145

smolina74 opened this issue Apr 25, 2018 · 3 comments

Comments

@smolina74
Copy link

I was trying my own scikit-learn Iris model. In that one I'm using the Seldon wrapper (not s2i, since I'm getting the error described here kubeflow/example-seldon#13). Now, one thing I noticed there is that the module in charge of calling my model class is model_microservice.py. And for what I'm seeing, after calling the prediction method it is expecting that the result is a 2 dimensional array (prediction.shape[1] will fail if not), which is ok when you call a predict_proba, but not when you just call predict.
So, the question is, what can I do if I just need to call a predict method and not predict_proba?

@ukclivecox
Copy link
Contributor

Its true the present python wrapper is assuming this.

# TODO: check that predictions is 2 dimensional
class_names = get_class_names(user_model, predictions.shape[1])

It is using this to get the class names. But we could make this only used if the predictions were 2 dimensional. The core data payload sent back doesn't place any requirements on the shape of the data.

@paul-crease
Copy link

paul-crease commented Apr 26, 2018

@smolina74 - I had the same problem, and found a workaround with self.model.predict(X).reshape(1, -1) which then gets you a 2d array.

@ukclivecox
Copy link
Contributor

Please reopen if still an issue with latest Python wrapper.

agrski pushed a commit that referenced this issue Dec 2, 2022
* update output inputs name to steps, check for cycles, add batch, add left join to APIs

* add outer joins

* error topic handling

* lint

* Add state listeners to ensure ready is until rebalancing done

* add more logging for rebalancing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants