5 min
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.
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:
- Data Representation
- ML tasks(classification, regression, anomaly detection etc)
- Data featurization
Source: Microsoft[/caption]
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(model);
Calculating Score
var predictedResult = predEngine.Predict(taxiTripSample);
Know more about applications of ML.NET here
- The AI Slowdown Narrative Doesn’t Reflect Enterprise Reality
- India’s Enterprises are Scaling AI. Is the Infrastructure Ready?
- Industry Wants Faster Approvals and Cheaper Power in India’s Data Centre Policy
- Inside Jio Platforms: Its Tech Bets, Loss-Making Subsidiaries and Hidden Risks
- India’s GCCs to Add 1.4 Million Jobs, Drive 170 Million Sq. Ft. Office Demand by 2031
- AI Can Be Cyborg or Centaur. But Can Enterprises Monetise It?

