---
title: "Codeunit 2003 ML Prediction Management"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/2003-ml-prediction-management/
type: codeunit
id: 2003
name: "ML Prediction Management"
app: "Base Application"
namespace: System.AI
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/2003-ml-prediction-management/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 2003 ML Prediction Management

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/2003-ml-prediction-management/

| | |
| --- | --- |
| App | Base Application |
| Namespace | System.AI |
| Versions | 17-28 |
| Source file | System/AI/MLPredictionManagement.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| DefaultInitialize | () | - | public | 17-28 | - | - |
| Initialize | (Text[250], Text[200], Integer) | - | public | 17-26 | Pending 24.0 | Use "Initialize(Uri: Text[250]; "Key": SecretText; TimeOutSeconds: Integer)" instead. |
| InitializeWithKeyVaultCredentials | (Integer) | - | public | 17-28 | - | - |
| SetMessageHandler | (DotNet HttpMessageHandler) | - | public | 17-28 | - | - |
| SetRecord | (Variant) | - | public | 17-28 | - | - |
| GetRecord | (var Variant) | - | public | 17-28 | - | - |
| AddFeature | (Integer) | - | public | 17-28 | - | - |
| SetLabel | (Integer) | - | public | 17-28 | - | - |
| SetConfidence | (Integer) | - | public | 17-28 | - | - |
| SetTrainingPercent | (Decimal) | - | public | 17-28 | - | - |
| GetTrainingPercent | () | Decimal | public | 17-28 | - | - |
| Train | (var Text, var Decimal) | - | public | 17-28 | - | - |
| Predict | (Text) | - | public | 17-28 | - | - |
| Evaluate | (Text, var Decimal) | - | public | 17-28 | - | - |
| PlotModel | (Text, Text, Text) | Text | public | 17-28 | - | - |
| DownloadPlot | (Text, Text) | - | public | 17-28 | - | - |
| IsDataSufficientForClassification | () | Boolean | public | 17-28 | - | - |
| IsDataSufficientForRegression | () | Boolean | public | 17-28 | - | - |
| IsDataSufficientBase | (var RecordRef) | Boolean | public | 17-28 | - | - |
| GetParameter | (Text) | Text | public | 17-28 | - | - |
| GetInput | (Integer, Integer) | Text | public | 17-28 | - | - |
| GetInputLength | () | Integer | public | 17-28 | - | - |
| MaxNoFeatures | () | Integer | public | 17-28 | - | - |
| GetMachineLearningCredentials | (var Text[250], var Text[200], var Option, var Decimal) | Boolean | public | 17-26 | Pending 24.0 | Use "GetMachineLearningCredentials(var MLApiUri: SecretText; var MLApiKey: SecretText; var LimitType: Option; var Limit: Decimal)" instead. |
| GetMachineLearningCredentials | (var Text[250], var SecretText, var Option, var Decimal) | Boolean | public | 23-28 | - | - |
| Initialize | (Text[250], SecretText, Integer) | - | public | 24-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnBeforeTrain | (var Text, var Decimal, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforePredict | (var Variant, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeEvaluate | (Text, var Decimal, var Variant, var Boolean) | 17-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
