With Google, Facebook and now Microsoft releasing their tools, 2019 is already turning out to be a great year for the machine learning community. These releases clearly indicate the direction in which the tech industry is headed. From datasets to improve the models to new updates to optimise the hardware usage, AI pioneers are leaving no stone unturned.

Last week Microsoft too has open sourced ML.NET 1.0, a new framework for machine learning developers.

AIM Daily XO

Join our editors every weekday evening as they steer you through the most significant news of the day, introduce you to fresh perspectives, and provide unexpected moments of joy
Your newsletter subscriptions are subject to AIM Privacy Policy and Terms and Conditions.

ML.NET has been under works at the research wing of Microsoft. The innovations have been put to use to their own products like Windows Defender, Microsoft Office (Powerpoint design ideas, Excel Chart recommendations), Azure Machine Learning, PowerBI.

ML.NET is aimed at providing the end-end workflow for consuming ML into .NET apps across various steps of machine learning (pre-processing, feature engineering, modeling, evaluation and operationalization). ML.NET 1.0 provides the following key components:


Download our Mobile App



Machine learning models were supposed to make life easier for the analysts and now even building these models as new frameworks are designed keeping AutoML in mind. Apart from the usual machine learning tasks, ML.NET also supports AutoML.

For machine learning beginners, Microsoft developers suggest to start with the ML.NET Model Builder in Visual Studio and the ML.NET CLI on any platform.  The AutoML API is also very handy for scenarios where one can build models on the go..

With ML.NET Model builder adding machine learning to the apps is only a right-click away.

Source: Microsoft

ML At Command Line

Another tool ML.NET CLI (command-line interface) is also introduced which allows for generating ML.NET Models using AutoML and ML.NET. The ML.NET CLI quickly iterates through the dataset for a specific ML Task (currently supports regression and classification) and produces the best model.

The CLI in addition to producing the best model also allows users to generate model training and model consumption code for the best performing model.

ML.NET CLI is cross-platform and is an easy add-on to the .NET CLI. The Model Builder Visual Studio extension also uses ML.NET CLI to provide model builder capabilities.

Installing the ML.NET CLI :

dotnet tool install -g mlnet

Here is a code snipped on taxi fare prediction using regression

Loading datasets

IDataView trainingDataView = mlContext.Data.LoadFromTextFile(TrainDataPath, hasHeader: true); IDataView testDataView = mlContext.Data.LoadFromTextFile(TestDataPath, hasHeader: true);

Running AutoML binary classification

ExperimentResult experimentResult = mlContext.Auto()    .CreateRegressionExperiment(ExperimentTime)    

.Execute(trainingDataView, LabelColumnName, progressHandler: new RegressionExperimentProgressHandler());

Model Evaluation

ITransformer model = experimentResult.BestRun.Model;

and evaluate its quality on a test dataset that was not used in training (taxi-fare-test.csv).

Regression.Evaluate()  calculates the difference between known fares and values predicted by the model to produce various metrics.

var predictions = trainedModel.Transform(testDataView);

var metrics = mlContext.Regression.Evaluate(predictions, scoreColumnName: “Score”);

Create prediction engine

var predEngine = mlContext.Model.CreatePredictionEngine<TaxiTrip, TaxiTripFarePrediction>(model);

Calculating Score

var predictedResult = predEngine.Predict(taxiTripSample);

Know more about applications of ML.NET here