Deploy and Make Predictions With Watson Studio - Part 5 - Predicting Used Car Prices
Key Takeaways
Deploys a predictive model using Watson Studio and makes predictions via REST API
Full Transcript
what's happening guys welcome to part 5 in how to build a predictive machine learning model using what's in machine learning studio in the last couple of videos we've actually built up our model as well as trained and tested our model now we're up to deploying it and actually making predictions now the cool thing with this is that you can deploy using REST API relatively easily let's get right into it now the first thing that you actually need to do when deploying your API is hit deployments who woulda guessed so what we can do here is just hit add deployment and hide what is it used-car model let's paste that into here as well and hit save and this will start the deployment process so once this is all finished you should have a deployed model and you can see that the status is deploy success that means it's successfully deployed now what you want to do here is click into this and grab the URL scoring endpoint so this is going to be the link that allows you to hit the or at the endpoint that you're basically going to be hitting when you're going and trying to predict values so to grab that you just need to hit implementation and you can see this scoring endpoint here so copy this down and we'll use it in a second so let's just say this perfect all right now there's a few other things that you need in order to make predictions and that is your Watson username your Watson password as well as your Watson URL now to get these you can hit the burger menu up here and what we're actually going to do is go into Watson services and we're going to click our machine-learning instance we should be able to get our service credentials by hitting service credentials and opening this up so what we need from here is we're going to need at username which is this so let's copy that down so we need a username and we need our password which is that and we also need a URL which is this so now we should have a scoring endpoint a username and a password so now we're good to go so what we'll do is we'll jump back into our what's in service that's right what's in studio and let's spin up a new notebook so let's go back into a pricing model and create a new notebook we'll call it prediction notebook and wait create notebook alrighty and now we can start creating our prediction so in order to do that we're going to need to import some stuff so we're gonna import URL Lib 3 and requests to make our requests and we'll import Jason to pass it as well so that should all be fine and now what we're going to do is we're going to create a dictionary that stores our credentials so and what we're going to do in there is store our URL our password and username and in this instance we'll copy down those credentials that we copied in those first couple of steps so our URL is going to be the URL that we copied from our credentials not a scoring endpoint so we'll put that in there and we'll throw in our password and username as well and just add some code is perfect all right so that's our credential dictionary now what we're going to do is we're going to create some headers and pull out request URL Lib taught you to make it is and we're going to use basic authentication and we are going to pass through now username and our password and then we are going to grab that username from a credentialed stick and our password from there as well right and this should be your live three perfect all right so we've got our headers now we are going to create a URL and true that we are going to grab the rest of the endpoint to I verify now identity and so this token-based authentication and to that we are going to pass it our credential URL right so this is going to pass through the URL that will basically define here into here and basically append it so we'll end up having this URL plus v3 identity and then token and we have not spent that right should be double your mail credentials now to check out a URL again as I said this URL plus they trade identity and token right and now we're going to create our request sir and true that we're going to pass that URL and we're going to pass our headers and you can check out response and it's 200 which means it's run successfully now what we can do is we can get our token out of that response so we can check our response text and you can see that we've retrieved our authentication token back so that's looking all good 2 ml token so we'll just store that in a new variable we'll grab our token out of there so let's check that now all right so we've got our token stored in that variable now we can start doing a little bit of prediction so to do that first up we're going to just create our header for our prediction so in this case we'll create and you head off and we're going to set content type equal to Jason application forward slash Jason and our authorization is going to be out Vera token let's check your header that looks fine so we've got out bearer token there looks all good we need a space there alright that's looking a bit better and we just need to set that to content type looking good alrighty now what we can do is create some dummy data to predict so in this case we're going to create our their fields now so our fields that we create here need to match the fields that we had in our final training data set so let's quickly take a look at what that looked like first so do too so if we take a look at our clean data set the first thing that we need to create is basically a list of fields that define the order of the data that were passing so in this case we're going to need our columns or need price mileage city state make model vehicle age let's just put that to one side and create that and we're going to call this our fields and we'll create this yes and fields so what we're doing now is creating a dictionary and to that we're going to pass the order that we're passing our values in so first one is going to be mileage and city so I'm basically just replicating this over here and state then make and model let's check what other fields we've got and we've got the vehicle age and then we need another value that's right another key and that's going to be values to predict and these are the values that will basically try and or the dummy data that we're predicting our values on or that we've want to predict so here we're going to create a new key called values and then we're going to create a new dictionary and we're going to say values to predict so we haven't actually created that yet so let's do that and this should be another list and true here we're gonna pass the values right so in this case we're going to pass through my liege city state make model and vehicle age so let's just come up with a random value so 542 two for our mileage and we'll let's say Miami for the state of Florida and then the types would be we've trained it on a curio so let's do that again moto TSX 4-door and let's say the vehicle ages three years so let's create that so this will now take our values to predict and pass it into this dictionary here that should all be good let's check that out and you can see we've got a mileage mileage city city states that make make model model vehicle age so now we can send this to our end point so now we're going to create out endpoint URL so let's grab that perfect and let's create a prediction now requests are still gonna be sending ad data and to that we're going to pass our endpoint URL had fields and our headers and this is an out header that we created here I'm not this header so that should be fun so let's check that out alright so I've got a 200 response so that's looking okay let's check out Jason alrighty and you can see that we've got our prediction here so it's predicted that the value of this car with an acura three-door TSX right inaccurate 4-door with three so that's three years old in Miami should cost about thirty three thousand nine hundred and fifteen dollars and that's about it guys so you can see here that we've actually deployed our REST API and we've actually generated a prediction so just to recap so we went through from the start how to set up our machine learning platform how to upload our data clean feature engineer train and test our model and finally how to deploy it and actually generate predictions that about wraps up this series guys if you found this useful be sure to like share and subscribe it thanks so much for watching peace
Original Description
Build a predictive model in IBM Watson Studio? Learn how to deploy it via REST API and start making predictions using Python and Jupyter Notebooks.
Want to follow along with the blog post? Check it out here: https://www.nicholasrenotte.com/how-to-predict-car-prices-using-watson-studio-machine-learning/
Want more awesome data and analytics stuff?? Follow me on…
Blog: www.nicholasrenotte.com
Twitter: https://twitter.com/nicholasrenotte
Facebook: https://www.facebook.com/nickrenotte
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Nicholas Renotte · Nicholas Renotte · 21 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
▶
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Face Detection - Build An Image Classifier with IBM Watson - Part 7
Nicholas Renotte
Food Image Classification - Build An Image Classifier with IBM Watson - Part 6
Nicholas Renotte
General Image Classification - Build An Image Classifier with IBM Watson - Part 5
Nicholas Renotte
Installing Watson Developer Cloud - Build An Image Classifier with IBM Watson - Part 4
Nicholas Renotte
Generating Credentials - Build An Image Classifier with IBM Watson - Part 3
Nicholas Renotte
Creating A Service - Build An Image Classifier with IBM Watson - Part 2
Nicholas Renotte
Getting an IBMid - Build An Image Classifier with IBM Watson - Part 1
Nicholas Renotte
How to Analyse Review Data - Part 2 - Python Yelp Sentiment Analysis
Nicholas Renotte
How to Lemmatize Text - Part 4 - Python Yelp Sentiment Analysis
Nicholas Renotte
How to Calculate Sentiment Using TextBlob - Part 5 - Python Yelp Sentiment Analysis
Nicholas Renotte
How to Collect Business Reviews Using Python - Part 1 - Python Yelp Sentiment Analysis
Nicholas Renotte
How to Clean Text Based Data for NLP - Part 3 - Python Yelp Sentiment Analysis
Nicholas Renotte
How to Setup a IBM Watson Personality Insights Service - Part 1 - Watson Personality Insights
Nicholas Renotte
How to Create a Customer Profile with IBM Watson - Part 2 - Watson Personality Insights
Nicholas Renotte
Visualising The Profile Part 3 Watson Personality Insights
Nicholas Renotte
How to Plot Personality Insights Features at Lightspeed - Part 4 - IBM Watson Personality Insights
Nicholas Renotte
Getting Started With IBM Watson Studio Machine Learning - Part 1 - Predicting Used Car Prices
Nicholas Renotte
Upload and Visualize Data In IBM Watson Studio - Part 2 - Predicting Used Car Prices
Nicholas Renotte
Clean Data and Feature Engineer in IBM Watson Studio - Part 3 - Predict Used Car Prices
Nicholas Renotte
Using Watson Model Builder to Predict Car Prices - Part 4 - Predicting Used Car Prices
Nicholas Renotte
Deploy and Make Predictions With Watson Studio - Part 5 - Predicting Used Car Prices
Nicholas Renotte
Getting Started With IBM Watson Discovery - Part 1 - Stock News Crawler
Nicholas Renotte
How to Run Advanced Queries with Watson Discovery - Part 5 - Stock News Crawler
Nicholas Renotte
How to Run Search Queries with IBM Watson Discovery - Part 4 - Stock News Crawler
Nicholas Renotte
How to Understand the Watson Discovery Data Schema - Part 3 - Stock News Crawler
Nicholas Renotte
How to Build a Watson Discovery Web Crawler - Part 2 - Stock News Crawler
Nicholas Renotte
AI learns what to do next using Tensorflow and Python
Nicholas Renotte
Chatbot Crash Course for Absolute Beginners - Full 20 Minute Tutorial
Nicholas Renotte
Shopify Customer Service Chatbot using Python Automation
Nicholas Renotte
Building a Reddit Keyword Research Chatbot
Nicholas Renotte
Chatbot App Tutorial with Javascript Node.js [Part 1]
Nicholas Renotte
Javascript Chatbot From Scratch with React.Js [Part 2]
Nicholas Renotte
Predicting Churn with Automated Python Machine Learning
Nicholas Renotte
Sales Forecasting in Excel with Machine Learning and Python Automation
Nicholas Renotte
Automate Budgeting with Python and Planning Analytics
Nicholas Renotte
AI vs Machine Learning vs Deep Learning vs Data Science
Nicholas Renotte
Optimizing Marketing Spend using Linear Programming || Marketing Opt PT.1
Nicholas Renotte
Solving Optimization Problems with Python Linear Programming
Nicholas Renotte
Loading Data into Planning Analytics with Python || Marketing Opt PT.2
Nicholas Renotte
Building Marketing Dashboards with Planning Analytics Workspace || Marketing Opt PT.3
Nicholas Renotte
Optimizing Resource Allocation with Docplex and Planning Analytics || Marketing Opt PT.4
Nicholas Renotte
Exploratory Data Analysis With Pandas || Python Machine Learning PT.1
Nicholas Renotte
Preparing Pandas Dataframes for Machine Learning || Python Machine Learning PT.2
Nicholas Renotte
Python Machine Learning with Scikit Learn - Regression || Python Machine Learning PT.3
Nicholas Renotte
Deploying Machine Learning Models with Watson Machine Learning || Python Machine Learning PT.4
Nicholas Renotte
Mind Blowing Machine Learning Apps with Node.JS and Watson Machine Learning || Python ML PT.5
Nicholas Renotte
Build FAST Machine Learning Apps with Javascript React.Js and Watson || Python ML PT.6
Nicholas Renotte
Analyzing Twitter Accounts with Python and Personality Insights
Nicholas Renotte
Converting Speech to Text in 10 Minutes with Python and Watson
Nicholas Renotte
Build a Face Mask Detector in 20 Minutes with Watson and Python
Nicholas Renotte
AI Text to Speech in 10 Minutes with Python and Watson TTS
Nicholas Renotte
Pandas for Data Science in 20 Minutes | Python Crash Course
Nicholas Renotte
Language Translation and Identification in 10 Minutes with Python and Watson AI
Nicholas Renotte
Analyse ANY Conversation in 10 Minutes with Python and Watson Tone Analyser
Nicholas Renotte
Deep Reinforcement Learning Tutorial for Python in 20 Minutes
Nicholas Renotte
NumPy for Beginners in 15 minutes | Python Crash Course
Nicholas Renotte
Real Time Pose Estimation with Tensorflow.Js and Javascript
Nicholas Renotte
Transcribe Video to Text with Python and Watson in 15 Minutes
Nicholas Renotte
Serverless Functions for TM1/Planning Analytics in 20 Minutes
Nicholas Renotte
Building a AI Budget Bot for Planning Analytics with Watson Assistant in 20 Minutes
Nicholas Renotte
More on: ML Pipelines
View skill →Related Reads
📰
📰
📰
📰
Beyond console.log: Advanced Debugging Workflows That Will Save You Hours
Medium · JavaScript
cgo Overhead Dropped 30%. When Should You Actually Care?
Medium · Programming
Why Everyone is Wrong About Website Development?
Medium · Programming
The Silent Killer in Your Node.js APIs: Mass Assignment & How to Catch It Before Production
Medium · Programming
🎓
Tutor Explanation
DeepCamp AI