Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Microsoft Dynamics 365 Business Central

You're reading from  Mastering Microsoft Dynamics 365 Business Central

Product type Book
Published in Dec 2019
Publisher Packt
ISBN-13 9781789951257
Pages 770 pages
Edition 1st Edition
Languages
Authors (2):
Stefano Demiliani Stefano Demiliani
Profile icon Stefano Demiliani
Duilio Tacconi Duilio Tacconi
Profile icon Duilio Tacconi
View More author details

Table of Contents (25) Chapters

Preface Section 1: Dynamics 365 Business Central - Platform Overview and the Basics of Modern Development
Microsoft Dynamics 365 Business Central Overview Mastering a Modern Development Environment Online and Container-Based Sandboxes Section 2: Developing Extensions for Dynamics 365 Business Central
Extension Development Fundamentals Developing a Customized Solution for Dynamics 365 Business Central Advanced AL Development Report Development with AL Section 3: Debugging, Testing, and Release Management (DevOps)
Installing and Upgrading Extensions Debugging Automated Test Development with AL Source Control Management and DevOps with Business Central Section 4: Advanced Integrations with Dynamics 365 Business Central
Dynamics 365 Business Central APIs Serverless Business Processes with Business Central and Azure Monitoring, Scaling, and CI/CD with Azure Functions Business Central and Integration with the Power Platform Section 5: Moving Solutions to the New Extension Model
Integrating Machine Learning into Dynamics 365 Business Central Moving Existing ISV Solutions to the New Extension Model Useful and Proficient Tools for AL Developers Other Books You May Enjoy

Integrating Machine Learning into Dynamics 365 Business Central

In the previous chapter, we gave an overview of the Microsoft Power Platform, and we saw how to use Dynamics 365 Business Central with Flow and PowerApps to solve business tasks with zero coding.

In this chapter, we'll talk about a topic that has been emerging over the last few years: Machine Learning (ML) with Dynamics 365 Business Central. The year 2019 is the year of Artificial Intelligence (AI). You hear about AI everywhere. The world is telling us: If you want to be on top, apply AI. But what is AI? How does it differ from classical programming? What is going on behind the scenes?

The aim of this chapter is not for you to become a true data scientist or ML master, but to get a clear understanding of the basics of AI and some experience of how to embed AI into your Dynamics 365 Business...

What are AI and ML?

AI consists of tasks that are characteristic of human intelligence, such as language and speech understanding, recognizing objects and sounds, and planning. The word tasks is used because, technically, you can complete these tasks with two different approaches: classical programming and ML.

At the beginning of 1990, some companies introduced Optical Character Recognition (OCR) software. They invested millions of dollars and hired hundreds of developers who wrote code to recognize handwritten text. This was classical programming with simple tools, such as if-else. The approach worked, but the result was quite poor. The accuracy was low and the number of mistakes was high.

Why did this approach fail? Because what is natural for a human brain is very difficult to be programmed.

So, how we can solve this task in another way? The answer is ML!

"Machine...

An overview of the ML process

According to its definition, ML is an application of AI that provides systems with the ability to learn and improve on their own, from experience, and not by being explicitly programmed.

Here is the classic ML process. It's when you try to predict an answer based on answers from previous experience:

Let's go through the preceding diagram in detail:

  1. Define a question: ML is not a magic box. To get an answer, you should know the question, and you should build a model that will answer that exact question.

Remember: the exact question is the key to the right answer!

  1. Find data: You should find data that will answer your question. The data, which, in (ML) terminology, is usually called a dataset, should be relevant, complete, exact, and sufficient. In this chapter, we will use Dynamics 365 Business Central as...

Understanding the Business Central ML Framework

Building your own (custom) ML model from scratch could be complicated. It usually requires experience in Python, R, or services such as Azure ML Studio. If you don't want to invest in that but still want to use the power of AI with your data, you can use Dynamics 365 Business Central ML Framework.

Technically, it can be divided into four different frameworks:

  • The Time Series API
  • The ML Prediction API
  • The custom Azure ML API
  • The custom Vision API

Each framework is intended for its own task and uses different algorithms:

  • For example, with the Time Series API, you can predict numbers (such as sales and quantities) with the power of regression algorithms just by knowing dates and numbers from the past.
  • With the ML Prediction API, you can predict classes, such as yes/no or colors.
  • The Custom Azure ML API allows...

Understanding the ML Prediction API

In the previous section, we trained an ML model based on the Time Series API. As there is a limit of only two features, the resulting model had poor accuracy. With the ML Prediction API, you can set as many features as you want. This approach gives you more flexibility and opportunities to experiment, allowing you to improve model quality by changing features and generating new features.

Also, the ML Prediction API allows you to train a custom ML model directly from AL.

If you are building an industry solution, you can add the train-ml-model function directly to your Dynamics 365 Business Central app.

The API is available in codeunit 2003, ML Prediction Management. Let's look at how it works.

In Visual Studio Code, open the project you cloned from https://github.com/dkatson/BC-ML-Framework and switch to the Train-ML-Model...

Summary

In this chapter, we looked through the ML APIs available with Dynamics 365 Business Central. I've made a comparative analysis of the three ML APIs in the following table:

 

The Time Series API

The ML Prediction API

The Custom Azure ML API

ML Experience required

Low

Medium

High

ML Model

Microsoft

Microsoft

Custom

Data preparation level

Low

Medium

High

Max Features

2

Unlimited

Unlimited

Training service

-

Business Central

Azure ML Studio

Trained model storage

-

Business Central

Azure ML Studio

ML Model quality

Low

Medium

High

ML Model usage level

General

Industry

Company

 

The comparison is based on the example provided in this chapter. Use this table as a guide to help you to choose the best way of applying AI in your app.

As we learned here, building custom ML models...

lock icon The rest of the chapter is locked
You have been reading a chapter from
Mastering Microsoft Dynamics 365 Business Central
Published in: Dec 2019 Publisher: Packt ISBN-13: 9781789951257
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.
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}