In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how to use ML.NET for you. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
ML.NET has been working in Microsoft's research department. These innovations have been used in their own products, such as Windows Defender,Microsoft Office (Powerpoint Design philosophy, Excel Chart recommendation), Azure machine learning, PowerBI. ML.NET aims to provide terminal workflows for the use of ML in .NET applications in all steps of machine learning (preprocessing, feature engineering, modeling, evaluation, and operation).
ML.NET 1.0 provides the following key components: data representation machine learning tasks (classification, regression, anomaly detection, etc.) data feature engineering
Machine learning models should make life easier for analysts, and they can even be built now because the new framework is designed with AutoML in mind. In addition to normal machine learning tasks, ML.NET also supports AutoML.
For machine learning beginners, Microsoft developers recommend starting with the ML.NET model builder in Visual Studio and ML.NET CLI on any platform. AutoML API is also convenient for scenarios where you can build a model at any time.
Using the ML.NET model builder, you can add machine learning to your application with just a right click.
Use ML.NET on the command line
Another tool, ML.NET CLI (command line tool), has also been introduced, which allows you to generate ML.NET models using AutoML and ML.NET. ML.NET CLI quickly traverses the dataset of a particular ML task (currently supports regression and classification) and generates the best model.
In addition to generating the best model, CLI also allows users to generate model training and consumption model code for the best performance model.
ML.NET CLI is cross-platform and is the global tool for the .NET CLI. The Visual Studio extension ML.NET Model Builder also uses ML.NET CLI to provide model builder functionality.
Install ML.NET CLI:
Dotnet tool install-g mlnet
This is the code that uses regression to predict taxi fares.
Load dataset
IDataView trainingDataView = mlContext.Data.LoadFromTextFile (TrainDataPath, hasHeader: true); IDataView testDataView = mlContext.Data.LoadFromTextFile (TestDataPath, hasHeader: true)
Run AutoML binary classification
ExperimentResult experimentResult = mlContext.Auto () .CreateRegressionExperiment (ExperimentTime) .execute (trainingDataView, LabelColumnName, progressHandler: new RegressionExperimentProgressHandler ())
Model evaluation
ITransformer model = experimentResult.BestRun.Model
And use the test data set to evaluate its quality (taxi-fare-test.csv).
Regression.Evaluate () calculates the differences between known fares and model predictions to generate various indicators.
Var predictions = trainedModel.Transform (testDataView); var metrics = mlContext.Regression.Evaluate (predictions,scoreColumnName: "Score")
Create a prediction engine
Var predEngine = mlContext.Model.CreatePredictionEngine (model)
Calculate the score
Var predictedResult = predEngine.Predict (taxiTripSample)
The above is to test AutoML using the model builder inside Visual Studio and the CLI command, and there is an API that can be used in .net applications. It is very easy to use. Add the [Microsoft.ML.AutoML] nuget package to the project and you can use API to work.
There is a complete set of examples in the ML.Net sample repository. You can reuse some classes in the Common folder to use AutoML with API.
This is the end of the article on "how to use ML.NET". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.