AI and ML Capabilities with Power BI
Shamali Weerasinghe
Associate Tech Lead @ TIQRI | AI/BI Practice Lead @ TIQRI | Data Engineer | AI Enthusiast | BI Specialist | Data Analyst | Power BI Developer
Interactive dashboards with rich visualizations, self-service capabilities, and continuous enrichments in a very convenient user-friendly interface has enabled Power BI to be a very high-demanding visualization tool in the business management field. And lately, it has been able to reach out to be a very convenient visualization tool not only in the business domain but also in almost all the other domains.
As the technology enhances the businesses now focus on making decisions not only on the known current situations and trends but also on the predictions of possible outcomes in the future based on the current trends and the known facts. To do so AI and most specifically Machine Learning (ML) has and is contributing tremendously. So, shouldn’t the visualization tools that are in use right now also be a part of these predictions and decision-making process. Well, they should and they surely are!
Power BI is well known for its self-service BI capabilities and it is now making progress in becoming a powerful and useful tool in the Data Science field as well.
In my personal opinion with the capabilities of analyzing hidden patterns in data and making predictions from ML and then visualizing the derived facts just by clicks and drags from Power BI being integrated into a single unit Power BI can be actively used in the data science field in order to obtain a good understanding of the data model as well.
So, let’s see a couple of ways how Power BI can come in handy when it comes to data science.
- AI-powered visuals
With a couple of explicit AI visuals Power BI enables analyzing and identify hidden patterns, factor/multiple factors which influence the values in our data. To name a few of such visuals would be:
Key Influencers
Provides an understanding on what are the key influences of certain measures and by which level they influence.
Decomposition Tree
Provides an understanding of the breakdown of the key influences.
Q&A
Consists of the capability in understanding natural language questions and provides the necessary response to the questions with appropriate visuals.
- AutoML
Automated machine learning (AutoML) for dataflows in Power BI. This is feature enables Automated training and validating, and utilizing the suitable Machine Learning (ML) models. This approach enables the end-users to select/deselect the desired key factors and to see how those factors influence certain KPIs.
In both the above use cases, there is no necessity that the end-user should have an understanding of the data science fundamentals.
- Ability to integrate with Python and R
This approach enables the end-users with a data science background to utilize the Power BI as a tool to analyze, visualize and also use ML models to do research and to do predictions with the known data.
For the basic construction and debugging of the code, we can use any convenient IDE. And can use the constructed code in Power BI.
Integrate with Python
For this example, we are using the employee attrition dataset available in Kaggle (Ref: https://www.kaggle.com/patelprashant/employee-attrition)
Starting from the basic steps of importing the required libraries as data manipulation libraries, math libraries, and cleaning and cleansing the dataset should be done.
We have the Attrition column values in “Yesâ€, “No†format. Let’s update the column values to 1, 0 so that we can use them in our algorithm.
Removing unnecessary columns as well as transforming non-numeric values to numeric values also should be taken care of in order to perform the ML as usual.
In our scenario, the Attrition is the target(y). And the rest of the features are the dependent Features (X).
To assess the predictive performance of our model we cannot utilize the same set of data that we use to train the data model. So, in supervised learning dividing the dataset into Training and Testing is an important step. For this simply Scikit-learn library can be used.
Next, the algorithm can be called. The following example demonstrates the use of Logistic Regression as the algorithm.
Likewise, after constructing and debugging the code, the code can be simply copied, pasted, and executed in Power BI.
good job shamali