ML.Net for Delphi

The ML.Net for Delphi (mldotNet4Delphi) are sets of APIs that can help you train, build, and ship custom machine-learning models. It gives you ability to add machine learning to Delphi applications.

The ML.Net for Delphi is built on top of the .Net Core for Delphi, which is required in order to run the machine learning runtime libraries in Delphi.

Free Trial

 Latest: 1.0.0.0 - What's New

mldotNet4Delphi

Machine Learning

Machine learning is a branch of artificial intelligence that enables algorithms to uncover hidden patterns within datasets. It allows them to predict new, similar data without explicit programming for each task. Machine learning finds applications in diverse fields such as image and speech recognition, natural language processing, recommendation systems, fraud detection, portfolio optimization, and automating tasks.

Machine learning’s impact extends to autonomous vehicles, drones, and robots, enhancing their adaptability in dynamic environments. This approach marks a breakthrough where machines learn from data examples to generate accurate outcomes, closely intertwined with data mining and data science.

Overview of ML.Net for Delphi

ML.Net for Delphi (mldotNet4Delphi) is a machine learning framework for Delphi developers that enables integration of custom machine learning models into Delphi applications. Machine learning applications make use of patterns in the data to make predictions rather than needing to be explicitly programmed.

Central to ML.Net for Delphi is a machine learning model. The model specifies the steps needed to transform your input data into a prediction. With ML.Net for Delphi, you can train a custom model by specifying an algorithm. Once you have a model, you can add it to your application to make the predictions.

The ML.Net for Delphi runs on Windows currently and in future it will be available in Linux and macOS.

ML.Net for Delphi Model Builder

The Model Builder provides an easy to understand visual interface to build, train, and deploy custom machine learning models. Prior machine learning expertise is not required. Model Builder supports AutoML, which automatically explores different machine learning algorithms and settings to help you find the one that best suits your scenario. Model Builder gives you everything you need on your machine. No need to connect to cloud resources, or other services, to build and consume your model.

The Model Builder builder will be available in the NEXT RELEASE!

Competitive Advantages

  • Cross-platform framework that runs on Windows, Linux(very soon) and macOS(soon) operating systems.
  • Full access to ML.Net Core Library.
  • No extra dll is required when deployed.
  • There is no configuration required and no external tools installation needed. Project can be moved shared across developer and build & test machines with just granting access to source code and transitioned to production within the main application archive.
  • Allows Delphi to consume ML.Net Core libraries as if they were native code.
  • Lightweight and easy to use.
  • ...and many more.

What ML.Net for Delphi can do:

  • Sentiment analysis: Analyze the sentiment of customer reviews using a binary classification algorithm.
  • Product Recommendation: Recommend products based on purchase history using a matrix factorization algorithm.
  • Price Prediction: Predict taxi fares based on parameters such as distance traveled using a regression algorithm.
  • Customer Segmentation: Identify groups of customers with similar profiles using a clustering algorithm.
  • Fraud Detection: Detect fraudulent credit card transactions using a binary classification algorithm.
  • Sales Spike Detection: Detect spikes and changes in product sales using an anomaly detection model.
  • Sales Forecasting: Forecast future sales for products using a regression algorithm.
  • Image classification: Classify images (for example, broccoli vs. pizza) using a TensorFlow deep learning model.

Simple ML.Net for Delphi App

Exported from Notepad++
program SimpleApp; {$APPTYPE CONSOLE} {$R *.res} uses MLCore, MLAttributes, MLContextMgr, MLData, MLOptions; type THouseData = class(TMLEntity) private FSize : Single; FPrice : Single; public property Size: Single read FSize write FSize; property Price: Single read FPrice write FPrice; end; TPrediction = class(TMLEntity) private FPrice: Single; public [ColumnName('Score')] property Price: Single read FPrice write FPrice; end; var houseData : TArray<THouseData>; mlContext: TMLContextManager; begin try mlContext := TMLContextManager.Create; try // 1. Import or create training data SetLength(houseData, 4); houseData[0] := THouseData.Create; houseData[0].Size := 1.1; houseData[0].Price := 1.2; houseData[1] := THouseData.Create; houseData[1].Size := 1.9; houseData[1].Price := 2.3; houseData[2] := THouseData.Create; houseData[2].Size := 2.8; houseData[2].Price := 3.0; houseData[3] := THouseData.Create; houseData[3].Size := 3.4; houseData[3].Price := 3.7; var trainingData: IMLDataView := mlContext.Data.LoadFromEnumerable<THouseData>(houseData); // 2. Specify data preparation and model training pipeline var Options:IMLSdcaRegressionTrainerOptions := TMLSdcaRegressionTrainerOptions.Create; Options.LabelColumnName := ''; Options.MaximumNumberOfIterations := 100; var pipeline := mlContext.Transforms.Concatenate('Features', ['Size']) .Append(mlContext.Regression.Trainers.Sdca(Options)); // 3. Train model var model := pipeline.Fit(trainingData); // 4. Make a prediction var size := THouseData.Create; size.Size := 2.5; var price := mlContext.Model.CreatePredictionEngine<THouseData, TPrediction>(model).Predict(size); WriteLn('Predicted price for size: '+ FloatToStr(size.Size*1000) + ' sq ft= ' + FloatToStr(price.Price*100)); finally mlContext.Free; end; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end.

Code workflow

The following diagram represents the application code structure and the iterative process of model development:

  • Collect and load training data into an IMLDataView object
  • Specify a pipeline of operations to extract features and apply a machine learning algorithm
  • Train a model by calling Fit(IMLDataView) on the pipeline
  • Evaluate the model and iterate to improve
  • Save the model into binary format, for use in an application
  • Load the model back into an IMLTransformer object
  • Make predictions by calling IMLPredictionEngineBase.Predict
mldotNet4Delphi

Supported Platforms

Delphi

IDE Compatibility

Delphi
  • Embarcadero Delphi 12 Athens
  • Embarcadero Delphi 11 Alexandria
  • Embarcadero Delphi 10.4 Sydney
  • Embarcadero Delphi 10.3 Rio

.NET Core

Supported .NET

.NET
  • Support for .NET 8

OS

Supported Platforms

OS
  • Windows.

Download Free Trial


30-Day Fully-Functional Free Trial

Get started today and see why developers worldwide
choose CrystalNet mldotNet4Delphi.

 Download
 
a