Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Latest commit

 

History

History
34 lines (16 loc) · 3.61 KB

06-Predicting the future.md

File metadata and controls

34 lines (16 loc) · 3.61 KB

<- Chapter 5 - Refine the model and re-evaluate

Chapter 6 - Predicting the future

Now that you have improved your model, it's time to put it to good use by predicting the Player Efficiency Rating for the NBA players on the next season. At this point, all that you have created is the training experiment, the one to prepare your data and train a model just with historic data.

Let's take it to the next level by creating the predictive experiment based on the algorithm that performed better after the adjustments, the Neural Network Regression. We'll need to set up the Predictive Web Service, so we can use it both as a module on the Azure ML tool and as an endpoint to request predictions with some input data via HTTP request.

To set up the web service, select the "Train Model" module connected to the Neural Network Regression algorithm, look for the "SET UP WEB SERVICE" button on the bottom bar, and click on "Predictive Web Service [Recommended]" from the pop-up:

Once completed, you'll see something similar to the screen below:

Note that it is a new experiment (named as [Predictive Experiment] and displayed on a different tab), and that it contains some of the preparation steps of the training experiment, as well as "Web service input" and "Web service output" modules. Note also that there is a new module with the same name you gave to your training experiment, connected to a "Score Model" module.

To set the bases for a useful predictive experiment, let's connect the "Web service input" module as a dataset input for the "Score Model" module, and just keep the "NBA PER prediction - training" module (our trained model, already packed as one module), the "Score Model" module and both Web service input and output modules by deleting everything else. We won't need all the other steps involved, as our input dataset for a future prediction already have only the known columns prior the season starts (Player, Position, Age, Team, Season) and we don't need to perform any cleaning or processing of this data. Let's also include the dataset with the players for the next season using the third dataset that we uploaded and haven't used yet: nba_2017_players_input. You can find it on the left menu, under "Saved Datasets > My Datasets" category, and after dragging it to your canvas you should connect it as well with the "Score Model" module as a dataset input. Your predictive experiment should now look like this:

If you run your predictive experiment now, you'll have a dataset containing the predictions for every NBA player PER for the 2016/2017 season, named as "Scored Labels". But again, it's better to give things their proper name, so let's add an "Edit Metadata" module after the "Score Model" module to rename the column "Scored Label" to the actual name "PER":

Congratulations! If you take a look at the resulting dataset, you'll be reading the future, and taking a look at the predicted Player Efficiency Rating value for every active NBA player on the 2016/2017 season. Note that there is also a new column named "Drafted", which will be useful for the optional visualization and consuming data chapters of this Instructor Led Lab.

-> BONUS TRACK - Visualize data with Power BI and also interact with it from a conversational bot