Please watch the video in full screen because the font size is a little small also download the entire code from GitHub, the link is provided in the description so you can increase the font size and change the theme if you want in your local machine. Thank you for watching. Here is the code link: github.com/siddiquiamir/ML-Model-Deployment-And-Test-Using-Postman
my friend. the content of app.py in Github and that APP.PY your had shown in video is not the same. I retyped version from video and got working version. Please consider
What if i have categorical features in my model? Sure I would encode them but what changes should be made in the production code so that it accepts strings as an entry
Thanks for the Video ! One doubt how are we using predicted output variable y=df["Class"] directly and not converting it into numerical values (like-0,1,2) for prediction?
Hello, I followed your instructions and tried this in Pycharm community version. However, when I run the script, I don't see any URL link to local host and there is no error either. Is the URL thingy not available in community version?
I am also using the community version and everyone uses the same because it's free. I would suggest you to please follow each and every step again. You may have missed something.
thanks, sir for making such an informative video, you have helped me with my project a lot, as I have followed up with your tutorial, it works fine, but once I deploy it on AWS , when I called "/predict" it doesn't work, I have already updated the directory on ubuntu, but Nah, it doesn't work it still Internal Server Error. The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. Please help me out with that. Looking forward to hearing back from you. Thanks
Please find the link to the Github repository github.com/siddiquiamir/ML-Model-Deployment-And-Test-Using-Postman/tree/main/ML%20Model%20Deployment%20And%20Test%20Using%20Postman
Hi, help me please, do I need to write PIN that I got after running "app.py" somewhere in Postman ? Because now when I click SEND I got error "405 Method Not Allowed. The method is not allowed for the requested URL."
UPD: to get rid of this error please use @flask_app.route('/predict', methods=['GET', 'POST']) instead of @flask_app.route('/predict', methods=['POST'])
@@StatsWire script goes further, but not till the end. Now he's complaining for that error "ValueError: Found array with 0 feature(s) (shape=(1, 0)) while a minimum of 1 is required by RandomForestClassifier". Need something more to succeed
@@dimannish1 Here is the code that worked for me. Replace the existing "def predict()" with this. def predict(): json_data = request.get_json() features = [] for record in json_data: float_features = [float(record['Sepal_Length']), float(record['Sepal_Width']), float(record['Petal_Length']), float(record['Petal_Width'])] features.append(float_features) predictions = model.predict(features) return jsonify({'predictions': predictions.tolist()})
Please watch the video in full screen because the font size is a little small also download the entire code from GitHub, the link is provided in the description so you can increase the font size and change the theme if you want in your local machine. Thank you for watching.
Here is the code link: github.com/siddiquiamir/ML-Model-Deployment-And-Test-Using-Postman
my friend. the content of app.py in Github and that APP.PY your had shown in video is not the same. I retyped version from video and got working version. Please consider
@@dimannish1 Thank you for informing. I will check.
Amazing tutorial! Worked perfectly thanks!
You're welcome!
Great way of teaching👍
Thank you
Thanks for helping. Really informative video
You're welcome
The model I need to use was yolov5 coustom model so how to import that model into this sir.
What if i have categorical features in my model? Sure I would encode them but what changes should be made in the production code so that it accepts strings as an entry
You have to make the same changes in the production that you will make in your script. Nothing extra is required. It will work fine.
That's one helpful video. Thanks
You're welcome
Thanks for the Video ! One doubt how are we using predicted output variable y=df["Class"] directly and not converting it into numerical values (like-0,1,2) for prediction?
We are just testing here that is why
will this work for an image classification model also ?
I have not tried it on the image dataset
Very nice tutorial
Thank you
Nice video sir.
How to implement the same if the values are of type string as well as the output return from the model is of type string?
Yes, there is a way for the string as well. I
@@StatsWire can you explain how sir?
Nice tutorial 👌👌
Thank you
Hello, I followed your instructions and tried this in Pycharm community version. However, when I run the script, I don't see any URL link to local host and there is no error either. Is the URL thingy not available in community version?
I am also using the community version and everyone uses the same because it's free. I would suggest you to please follow each and every step again. You may have missed something.
Can one use image and audio data?
I have not tried it yet
thanks, sir for making such an informative video, you have helped me with my project a lot, as I have followed up with your tutorial, it works fine, but once I deploy it on AWS , when I called "/predict" it doesn't work, I have already updated the directory on ubuntu, but Nah, it doesn't work it still Internal Server Error. The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Please help me out with that. Looking forward to hearing back from you. Thanks
Hello, sorry for the late response.
model.pkl from where ?
It is your machine learning model that you convert to pkl in the last line of the file "model.py"
@@StatsWire thankyou so much
@@hamonangansitorus5761 You're welcome
can you share the repository sir?
Please find the link to the Github repository
github.com/siddiquiamir/ML-Model-Deployment-And-Test-Using-Postman/tree/main/ML%20Model%20Deployment%20And%20Test%20Using%20Postman
that is not deploying, its just running locally
Yes
pass categorical variable dude....only you pass inte values
Hi, help me please, do I need to write PIN that I got after running "app.py" somewhere in Postman ?
Because now when I click SEND I got error "405 Method Not Allowed. The method is not allowed for the requested URL."
See you are in the same one
UPD: to get rid of this error please use @flask_app.route('/predict', methods=['GET', 'POST']) instead of @flask_app.route('/predict', methods=['POST'])
@@dimannish1 Thank you for writing the methods!
@@StatsWire script goes further, but not till the end. Now he's complaining for that error "ValueError: Found array with 0 feature(s) (shape=(1, 0)) while a minimum of 1 is required by
RandomForestClassifier". Need something more to succeed
@@dimannish1 Here is the code that worked for me. Replace the existing "def predict()" with this.
def predict():
json_data = request.get_json()
features = []
for record in json_data:
float_features = [float(record['Sepal_Length']),
float(record['Sepal_Width']),
float(record['Petal_Length']),
float(record['Petal_Width'])]
features.append(float_features)
predictions = model.predict(features)
return jsonify({'predictions': predictions.tolist()})