Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Yuchen

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

Anonymous

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

@Anonymous  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

Anonymous

Quick question the ML update is part of May update?

Anonymous

@Yuchen @Rajatt - Hello experts, not sure if this is the correct thread to comment upon, but while trying to look for an article on 'APPLY MODEL', I came across only this thread which is most relevant. I have created 20+ models and am trying to apply them, but in all my attempts to execute the step, I continue to receive same error message as below - 

Error Snapshot.png

 

Something went wrong

Could not perform this operation due to an internal error

Please try again later or contact support. If you contact support, please provide these details.

Activity ID: d4e4ec21-d34e-46cd-a62e-b457a9114b9d

Request ID: c20454ac-7aad-3b76-b040-f0cabe1ea3d6

Correlation ID: e77d0fba-2007-33d9-e95e-d420d90e856a

Status code: 500

Time: Tue Nov 19 2019 11:37:36 GMT+0530 (India Standard Time)

Service version: 13.0.11428.152

Client version: 1911.2.021

Cluster URI: https://wabi-north-europe-redirect.analysis.windows.net/

 

I am not sure, if it is something that I am doing incorrect or it is Power BI which is behaving weirdly. Since it is happened for more than 10 models, I kind of rest my case now & looking for support to overcome this issue. 

 

Please support !! 

@