Reader small image

You're reading from  Power BI Machine Learning and OpenAI

Product typeBook
Published inMay 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781837636150
Edition1st Edition
Languages
Concepts
Right arrow
Author (1)
Greg Beaumont
Greg Beaumont
author image
Greg Beaumont

Greg Beaumont is a data architect at Microsoft, where he enjoys identifying and solving complex problems backed by his experience in data architecture and a passion for innovation. Focusing on the healthcare industry, Greg works closely with customers to plan enterprise analytics strategies, evaluate new tools and products, conduct training sessions and hackathons, and architect solutions that improve the quality of care and reduce costs. He strives to be a trusted advisor to his customers and is always seeking new ways to drive progress and help organizations thrive. He is a veteran of the Microsoft data speaker network and has worked with hundreds of customers on their data management and analytics strategies.
Read more about Greg Beaumont

Right arrow

Building Machine Learning Models with Power BI

In Chapter 7 of this book, you built three queries in Power BI dataflows that will be used for ML in Power BI. FAA Wildlife Strike data was the source of that data, which you will use to build your Power BI ML models. Those queries are sets of features associated with reports of incidents in which an aircraft struck wildlife.

In this chapter, you will build and train ML models using the queries created in Chapter 7. In Chapter 1, you determined that you would create a binary prediction model for predicting whether damage occurred, a general classification model to predict the size of the wildlife, and a regression model to predict the height from the ground associated with wildlife strikes that caused damage. At the end of this chapter, you will be ready to assess the results of the ML models you have built. We’ll do that in the following chapter.

Technical requirements

You’ll need the following for this chapter:

  • FAA Wildlife Strike data files from either the FAA website or the Packt GitHub site
  • Power BI Pro license
  • One of the following Power BI licensing options for access to Power BI dataflows:
    • Power BI Premium
    • Power BI Premium Per User
  • One of the following options for getting data into the Power BI cloud service:
    • Microsoft OneDrive (with connectivity to the Power BI cloud service)
    • Microsoft Access and Power BI Gateway
    • Azure Data Lake (with connectivity to the Power BI cloud service)

Building and training a binary prediction ML model in Power BI

You’re finally ready to build and train your first ML model in Power BI! We will start with a binary prediction model to predict whether damage happened when wildlife struck an airplane. As discussed in Chapter 1, a binary prediction model will make a yes/no prediction for a given row of data containing columns that are the predictive features. The query that you built in Chapter 7 is in your ML Queries dataflow and is named Predict Damage.

You'll build your prediction model as follows:

  1. Create a new dataflow in your Power BI workspace by selecting New | Dataflow.
  2. Select Link tables from other dataflows.
  3. Ensure you are signed in to your organizational account and select Next.
  4. Expand your Power BI workspace folder, expand the ML Queries dataflow, select Predict Damage, and click Transform data.
  5. Save and close the new dataflow.
  6. Name the new dataflow Predict Damage ML.
  7. Refresh...

Building and training a general classification ML model in Power BI

Moving on to your second ML model, you will predict the size of wildlife that struck an aircraft based on data collected about the strike. This ML model could be useful in predicting possible species that struck an aircraft. Use the query from the ML Queries dataflow named Predict Size:

  1. Create a new dataflow in your Power BI workspace by selecting New | Dataflow.
  2. Select Link tables from other dataflows.
  3. Ensure you are signed in to your organizational account and select Next.
  4. Expand your Power BI workspace folder, expand the ML Queries dataflow, select Predict Size, and click Transform data.
  5. Save and close the new dataflow.
  6. Name the new dataflow Predict Size ML.
  7. Refresh the new dataflow.

Now you can begin building your general classification ML model in Power BI.

  1. Click on the new Predict Size ML dataflow from your workspace.
  2. Click on the ribbon header for Machine learning...

Building and training a regression ML model in Power BI

Finally, you will build an ML model to predict the height of impact associated with wildlife strikes. A regression ML model can predict numeric values based on features used to train the model. This ML model could be useful in predicting expected costs when a wildlife strike causes damage. Use the query from the ML Queries dataflow named Predict Height:

  1. Create a new dataflow in your Power BI workspace by selecting New | Dataflow.
  2. Select Link tables from other dataflows.
  3. Ensure you are signed in to your organizational account and select Next.
  4. Expand your Power BI workspace folder, expand the dataflow ML Queries, select Predict Height, and click Transform data.
  5. Save and close the new dataflow.
  6. Name the new dataflow Predict Height ML.
  7. Refresh the new dataflow.

Now you can begin building your regression ML model in Power BI.

  1. Click on the new Predict Height ML dataflow from your workspace...

Summary

In this chapter, you used Power BI to build dataflows and train a binary prediction ML model, a general classification model, and a regression model. All three relied on the work you had done through Chapter 7 to identify features in the FAA Wildlife Strike data, prep queries for ML, and then publish everything to the Power BI cloud service.

In Chapter 9, you will review the testing results of the ML models and evaluate the accuracy of the tested predictions. ML models needing improvement can be modified and re-trained as needed until acceptable results are attained.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Power BI Machine Learning and OpenAI
Published in: May 2023Publisher: PacktISBN-13: 9781837636150
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Greg Beaumont

Greg Beaumont is a data architect at Microsoft, where he enjoys identifying and solving complex problems backed by his experience in data architecture and a passion for innovation. Focusing on the healthcare industry, Greg works closely with customers to plan enterprise analytics strategies, evaluate new tools and products, conduct training sessions and hackathons, and architect solutions that improve the quality of care and reduce costs. He strives to be a trusted advisor to his customers and is always seeking new ways to drive progress and help organizations thrive. He is a veteran of the Microsoft data speaker network and has worked with hundreds of customers on their data management and analytics strategies.
Read more about Greg Beaumont