Customizing Dynamics NAV
Discover different ways to customize the application to give you and your colleagues access to the features, functionality, and data that you need most.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
Last 2,5 months were very busy for me. I travelled around the world talking about Artificial Intelligence, in particular about AI in Business Central.
Here is my world-tour-map :) I did approx. 28K miles (45K km). The equatorial circumference of Earth is about 25K miles (40K km), and distance to the moon is 240K miles (384K km).
Powered by http://www.gcmap.com
So I had sessions at events: Dynamics Dutch community, Directions ASIA, Directions NA, Days Of Knowledge. I guess the only one who did the same was AJ :)
And you know what, I was surprised. I thought that the level of knowledge in our community about AI should be at least 101. But it’s not. It’s near to zero. Shocked? I guess not. Our community is very strong in NAV, but not very flexible in everything around. Even in Business Central related area - I still see many, many, maaaany developers who didn't try Extensions at all, not mentioning AI.
Anyway. I see my goal in empowering everyone to make their BC extensions smarter. And no one will stop me.
One of the latest and the most advanced ML features, available in the Business Central is the opportunity to train custom machine learning model directly from AL. If you are building an industry solution, you can add train-ml-model function directly to your Business Central App.
The API is available in the Codeunit 2003 “ML Prediction Management”. Let’s look at how it works.
When talking about ML, it’s always important to show usage on real examples. Let’s try to predict employee leave directly from Business Central. That could be a good addition to the HR module.
Data is the engine of Machine Learning. To predict the future, we need to know the past.
Here we have features which influence on prediction – will employee leave or not?
Before the training process, you need to publish prediction ML Web service into your Azure Subscription.
This is a publicly available model prepared by the Microsoft ERP team and designed especially for ML Prediction Management usage.
One of the coolest features in ML Prediction API is the opportunity to train a machine learning model directly from AL. Here how it works.
In the VSCode project create a codeunit "Train EmployeeLeave ML" with function Train().
The workflow of Train function is the next
And if we will train a model using employee-leave-historical-data, we will have the model quality of 96%.
Once you have a trained model, you can apply it to the new data and predict the future.
Let’s predict if an employee will leave the company in the nearest future, depending on his current state: average work hours, number of projects, salary, satisfaction level, position and other criteria’s.
Create separate Codeunit "Predict Employee Leave ML" with function Predict().
The workflow of Predict function is the next
And if we will Predict Employee Leave, we will get predictions!
In the list view, we can also see confidence %.
When I proudly :) showed this to my wife, who is HR, the first question I’ve got was: “Brilliant! But why will Mary leave?” – fair enough.
Understanding why AI did certain prediction becoming more and more important in our society. This is not only about the trust in AI models, but also about getting insights.
ML Prediction API has a cool method PlotModel which answers on why question with 1 line of code!
You just need to pass the ML model in Base64 format, features and label and you will get a .pdf file with a decision tree.
PlotModel method will return you this pdf file in Base64 format. You can download it as a file using DownloadPlot method or use embedded pdf in Business Center directly. I used AJ blog for that.
ML Prediction API is a very good starting point to your AI journey. Define Question – Get Data – Train – Predict – Get Insights – Done.
And to finalize this blog I would like to quote Vincent from the Days Of Knowledge Keynote: “AI is not sex, and you are not a teenager. Don’t just talk of it, try it!”.
Code is available on my GitHub https://github.com/dkatson/BC-MLPredictionAPI-Predict-Employee-Leave
Business Applications communities