Issue
I am new to machine learning. I'm done with k-means clustering and the ml model is trained. My question is how to pass input for my trained model?
Example: Consider a google image processing ML model. For that we pass an image that gives the proper output like emotion from that picture.
Now my doubt is how to do like that I'm done the k-means to predict mall_customer
who spending more money to buy a product for this I want to call or pass the input to the my trained model.
I am using python and sci-kit learn.
Solution
What you want here is an API where you can send request/input and get response/predictions.
You can create a Flask server, save your trained model as a pickle file and load it when making predictions. This might be some work to do.
Please refer these :
- https://towardsdatascience.com/deploying-a-machine-learning-model-as-a-rest-api-4a03b865c166
- https://hackernoon.com/deploy-a-machine-learning-model-using-flask-da580f84e60c
Note: The Flask inbuilt server is not production ready. You might want to refer uwsgi + ngnix
In case you are using docker : https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/ this will be a great help.
Answered By - Pramesh Bajracharya
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.