Azure Automated ML

Hello Dynamics and Azure community !

As I said in my previous article, I really want to help some customers or partners to discover more the Azure ML ecosystem combined with Power Platform and Dynamics 365.

I started in 2015 with Azure ML, since then Microsoft add a lot of new features and especially this one : Azure Automated ML, that I want you to present right below.

This new feature will help you, with or without data science expertise, to identify an end-to-end machine learning pipeline for any problem, achieving higher accuracy while spending far less of their time. And it enables a significantly larger number of experiments to be run, resulting in faster iteration towards production-ready intelligent experiences.

automl-concept-diagram2.png

I think you already know that Azure ML provides a lot of Algorithms to help you manage some predictive data.

BUT, the main problem was in the past to do a lot of works behind the pipeline of the Azure ML like this :

  • Prepare your dataset

  • Do a lot of reworks to analyse your data to see if you need these columns in your predictive model (sometimes a feature can be bad for an algorithm and your training model will have a poor prediction)

  • Cleaning your dataset !! A lot of works, to clean missing data, do a median, add calculated column etc…

  • And the MAJOR part, you will need a good data scientist to help you to test every algorithm based on what you really want to predict !

  • All these tasks were really a time consumed.

Now with Azure Automated ML, all of these tasks have been added automatically ! So you don’t need to do all this stuff… Of course you can continue to do so if you want, but it can be a good start to jump faster in Azure ML (without a large skill of a data scientist) to do a good predictive model in a day !


Let’s jump with an example.

My example will be based on a dataset coming from the TITANIC :)

It’s a basic and well known dataset for a first training of Azure ML. You need to know if a Passenger of Titanic based on some informations (Age, Sex, Class in the boat) will survive or not on the Titanic boat. In the dataset you have rows of the whole passengers informations and you have the information if that passenger had survived the time of the drama. You want to have an Azure Automated ML pipeline with a model that can predict, if you call the API of Azure ML, if a new passenger will survive (Yes or No)

Let’s have a look of the dataset that we have :

Connect to your workspace of Azure ML : https://ml.azure.com

Go to the dataset and upload your file : titanic.csv (I will add the file in the comment of this article)

You can see right below, a profile of every column. Survived 0/1 will be the predictive column. And you can see that some data is missing in some column (like Age). As I said at the begining of the article, in previous Azure ML model you had to go through some R Script or do cleaning/standardize data in the pipeline on your own, now in Azure Automated ML, this feature will do it automatically for us !

automl1.PNG


Now go to Automated ML part.

Create a new one and select your dataset that you have uploaded before (titanic)

automl2.PNG


After, create a new Expirement Name, select your target column to predict (here : Survived) and your compute target Virtual Machine. Of course with Azure Automated ML you will need a good & performant virtual machine if you want to have a result quicky since the process will test a lot of algorithms for your model before giving you the best algorithm.

automl3.PNG

To finish, you had to select here the type of experiment here. For this example, since we need to classify Passenger if they will survive, we need to pick Classification.

automl4.PNG

After running it, you will see the result in the Experiments part :
You can see that it Automated ML has choose for us the most efficient predictive model withtout doing any task !!

automl5.PNG

You can of course go through details of this model and see also all other algorithms that Azure Automated ML has been calculated for us :

automl6.PNG

If you click on the most relevant for us MaxAbsScaler, SGD,

You can see all Run metrics details. Here on our example, we have around 89% of precision to predict if a passenger will survive or not ! Some score’s explanation can be found in Microsoft article if you want to know what are really behind these metrics.

automl7.PNG

Some informations can be good to see via charts !

automl8.PNG
automl9.PNG

Deployment…


So now, we have the best model, let’s deploy it to an Azure ML Pipeline & Azure Container Instance to have a REST API to call for future data.

Select in the details of Comput Type : ACI

After the deployment is finished. Let’s copy the URI of your REST API.

In the REST endpoint like below :

automl10.PNG

We have now finished in the Azure ML part.

Now we have some options to call the REST API to know for future data if he will survive to the TITANIC.

I will pick here Power Automate since I don’t want to code to call the API :)

This flow will be useful since I can also use it after in a Power Apps or direclty in Dynamics 365 on a contact.

Go to : https://flow.microsoft.com

Create a new recurence flow for testing purpose.

Copy/past your REST API URL from Azure ML.

Change the Headers to set application/json

And put your schema model (of course except the Survive Column since it’s the result that we wan’t to know)

Put some example like me in your data. Of course we can set dynamic content from the PowerApps column of Dynamics 365 CDS contact and not hardcoded like this :

automl11.PNG


Add a PARSE JSON tile for the result of your request HTTP call.
The result is simple, it’s just an integer (0 or 1) to be like a boolean value for the Survived Column.

automl12.PNG

After you can of course add a conditional split, to test the result. Like me, but it’s just an example, send a notification if you will not survive or send an email if you will survive to the TITANIC.

automl13.PNG
Damned, I will not survive to TITANIC. Of course we have only a precision of 90%. But good to know ! :)

Damned, I will not survive to TITANIC. Of course we have only a precision of 90%. But good to know ! :)

Finally, I want to go deeper, if we talk about Dynamics 365 Customer Insights.

This new AI Business Apps will help you to unify, transform & enrich your data coming from all datasources you have.

You will have a unique contact model and you can add some measures and do some segmentation from this measure. This measure can be calculated from an Azure Machine Learning REST API (like we do it before for this TITANIC example)

automl16.PNG

But we will explain this in our first Webinar for the Power French Community this Friday !

In conclusion, you can see that now, to deploy a predictive model and call it, is very simple !

Hope it will help you to jump in Azure ML ecosystem, especially if you are coming from Dynamics 365 expertise, and you want to add insights in your CRM, ERP or Business Apps.

Feel free to contact me if you want more details about that ! I will be happy to help you !