5. Run the model
Danger
This tutorial is out of date. Please check the tutorials overview for our latest tutorials.
Quix has has already trained model artifacts and these have been included as pickle files in the prediction code application. This application is included in the open source Code Samples. You will use the Code Sample to run the model.
Prediction service code
Get the code for the prediction service:
-
Click on
Code Samples
in the left-hand navigation. -
Search for
New York
and click theNew York Bikes - Prediction
tile. -
Click
Edit code
. -
Leave the
Name
as it is. -
Ensure the
bike_input
is set tobikes-topic
. -
Ensure the
weather_input
is set toweather-topic
. -
Ensure the
output
is set toNY-bikes-prediction
. -
Click
Save as Application
.This will save the code for this service to your environment.
Free Models
Look in the MLModels
folder for the Quix pretrained ML models. You can upload your own and compare them to ours. Let us know how they compare.
Run in the dev environment
You can now run the prediction model from this 'dev' environment to make sure it's working before deploying it to an always ready, production environment.
-
Click
Run
in the top right-hand corner. -
Observe the
Console
tab at the bottom of the screen.-
Any packages that are needed will be installed.
-
Any topics that didn't previously exist will be created.
-
Then the code will run.
-
You will see a line similar to this in the console output.
Note about data
For a new prediction to be generated, the service has to receive data from both bikes (updated often) and weather feeds (only updated every 30 mins).
When you test the model, you may want to force the weather service to produce some new data (to avoid waiting for 30 mins) by restarting the service: stop it and then re-deploy it. By doing this it will start generating predictions sooner.
-
Deploy the service
Having verified that the code runs, you can now deploy it to the Quix serverless environment. Once deployed, it will run continuously, gathering data from the sources and producing predictions.
-
Click
Running
to stop the code running. -
Click
Deploy
in the top right-hand corner nearRun
. -
On the
Deployment settings
, increase the memory to at least 1.5GB. -
Click
Deploy
.You will be redirected to the pipeline page and the code will be built, deployed and started.
See the model output
Once the prediction service has started you can once more restart the VisualCrossing Weather
service and view the data.
You should be familiar with some of the following steps:
-
Restart the
VisualCrossing Weather
service. -
Click
Persisted streams
in the left-hand menu. -
Click the toggle switch next to the
ny-bikes-prediction
topic to persist the data (wait for this to complete). -
Mouse over the
stream name
of one of the rows in the table. -
Click the
Visualize stream
button. -
Select both of the parameters (
timestamp_ny_prediction
andforecast_1d
). -
You can select the
Waveform
tab to see a graphical representation of the forecast or select theTable
tab to see the raw data.
Summary
Congratulations, you have completed all the steps of this tutorial. The following page summarizes your learning and provides some suggestions for next steps to try.