cancel
Showing results for 
Search instead for 
Did you mean: 

How To Get Predictions from Power BI Machine Learning Model

How to "Predict the future" by using Power BI?

Power BI, in the latest release, added support for supervised automated machine learning.This means that Power BI can help predict ‘unknowns’ once it learns from the ‘known’ values. The learning phase is called “training the model” and predicting phase is called “applying the model”. The ‘known’ values have the historical outcome field set, whereas clearly for ‘unknowns’ that field is not set or null or not existent.

 

More convenient way to apply your machine learning model

With today’s release, applying machine learning models to get prediction has become much simpler and smarter. Power BI supports two modes of applying:


  • When both known values and unknown values are in the same dataflow entity.
  • When they are in different entities.

Once you apply, the predictions are added automatically when newer data arrives with dataflow refreshes.

 

How does it work?

When you have trained an automated machine learning model, Power BI automatically selects the entities that can be applied to it. Simply click on the drop-down menu to select the entity to apply for your machine learning model. This avoids the hassle of entering an entity name manually. You would notice that the drop-down lists entities through schema matching and the entities which belong to system generated testing data entity and the training data entity are already filtered.

 

How to apply your model in this new release

1. Click “Machine Learning Models” tab.

clickML.jpg

 

  • First, click on “Machine Learning Models” tab.
  • Second, make sure your model Status is ‘Trained’.

 

2. Click “View performance report and apply model” icon when your report is ready to view.report.jpg

 

If you just trained your model, clicking this button will prepare a report and dataset for 10-15mins. Just wait for your report to be ready to use and verify the results in the report. 

 

3. Click “Apply model” button at the top right corner. applymodel.jpg

Once you get into the “report” view, click the “Apply model” yellow button at top right of your screen. Then another apply model dialog wizard will pop up. 

 

4. In the pop up dialog wizard, apply your Machine Learning Model. 

a. Select an entity that has been filtered for you from drop-down menu as the source input entity. This is the entity which has the unknown outcomes. As previously mentioned it can be the same entity which had the data with historical outcome field set. drop1.jpg

 

Now you can see, within this drop-down menu, we only show all available entities. Other test entities and trained model are filtered out. At front-end part, we extract the entity array, through traverse this entity array, separate out the test entities and the model which already trained, only retain the entities which is meaningful to apply your model. 

 

b. Name the new output column. 

colname.jpg

Pick a meaningful name as an output column name, which will contain your result and be added to your input entity.

 

 c. Enter a threshold between [0, 1] for your machine learning model. 

drop3.jpg

Pick a proper threshold within 0 to 1.00. This threshold will impact your result of binary prediction. (This is only used in Binary Prediction. You don’t need this step in Classification, Forecasting and Regression). 

 

d. Click “Apply model” and there you go! Power BI does not touch your original entity and always produces results in a new Enriched entity. finalstep.jpg

 

e. Refresh the dataflow. Click “Refresh Now” button at the top right corner. refresh.png

 

f. After the refresh finishes, see the predictions by clicking Edit entities and Enriched preview query. clickEdit.jpg

 

finalCol.jpg

 

Click 'Entity' tab, now you could see there is a new entity named 'Enriched entity'. At the most right of this 'Enriched entity', click first icon: 'Edit entity'.

 

In the new window, you can see your prediction result is added to your enriched entity. 

There are three more columns added to your enriched entity for telling you three things: Outcome, Scores, and Explanation.

Thanks for watching and have fun in new features! 

Thanks to my great team and my manager Rajat Talwar.

If you have any questions, you are welcome to ask me questions about this new feature.

 

Yuchen Liang  | Software Engineer at Microsoft Power BI (Artificial Intelligence) team

Comments

Pretty helpful, buddy

How do I delete a machine learning model? I created one only to learn that I have to have Premium but now I dont know how to delete the model so I can get my dataflow to refresh agian. help!!

Nice job Yuchen, very detailed guidline to follow. Can't wait to try it out, pick some data set and see the predictions

@mwc360  To delete a machine learning model, you can click Edit entities in a dataflow and right click the model query. That will give you an option to remove 

DeleteModel.png

Quick question the ML update is part of May update?