Skip to content

Commit ed14986

Browse files
author
oliag
committed
Add README for GettingStarted sln
1 parent 78f10e3 commit ed14986

File tree

3 files changed

+57
-0
lines changed
  • examples/GettingStarted

3 files changed

+57
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Goal
2+
This is a getting started example that shows the simplest way of using ML.NET APIs for solving a binary classification problem on sentiment analysis example.
3+
4+
## Problem
5+
The task is to build and train ML model (machine learning model) that will predict if a text has positive or negative sentiment. For training and evaluating the model we used imdb and yelp comments with known sentiments.
6+
7+
## Problem Class - Binary Classification
8+
The described task is an example of a binary classification problem.
9+
> In machine learning, `binary classification` is the problem of classifying instances into one of a two classes. (Classifying instances into more than two classes is called `multiclass classification`.)
10+
11+
Machine learning engineering process includes three steps: training ML model, evaluating how good it is, and if the quality is acceptable, using this model for predictions. If the quality of the model is not good enough, different algorithms and/or additional data transformations can be applied and the model should be trained and evaluated again.
12+
13+
1. **Training** the ML model is implemented in `TrainAsync()` method that constructs `LearningPipeline`, trains it and saves the trained model as a .zip file.
14+
2. **Evaluating** the ML model is implemented in `Evaluate()` method which runs the model against a test data (new data with known answers, that was not involved in training). As a result it produces a set of metrics describing the quality of the model.
15+
3. **Predicting** the sentiment is performed in the `Main()` method:
16+
```CSharp
17+
var predictions = model.Predict(TestSentimentData.Sentiments);
18+
```
19+
where you send a text as a `SentimentData` object. As a result you receive `SentimentPrediction` object that contains a boolean field `Sentiment`: true for positive, false for negative sentiments.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Goal
2+
This is a getting started example that shows the simplest way of using ML.NET APIs for solving a multiclass classification problem on iris flower classification example.
3+
4+
## Problem
5+
The task is to build and train ML model (machine learning model) that will predict the type of iris flower (setosa, versicolor, or virginica) based on four features: petal length, petal width, sepal length, and sepal width.
6+
7+
## Problem Class - Multiclass Classification
8+
The described task is an example of multiclass classification problem.
9+
> In machine learning, `multiclass classification` is the problem of classifying instances into one of three or more classes. (Classifying instances into one of the two classes is called `binary classification`.)
10+
11+
Machine learning engineering process includes three steps: training ML model, evaluating how good it is, and if the quality is acceptable, using this model for predictions. If the quality of the model is not good enough, different algorithms and/or additional data transformations can be applied and the model should be trained and evaluated again.
12+
13+
1. **Training** the ML model is implemented in `TrainAsync()` method that constructs `LearningPipeline`, trains it and saves the trained model as a .zip file.
14+
2. **Evaluating** the ML model is implemented in `Evaluate()` method which runs the model against a test data (new data with known answers, that was not involved in training). As a result it produces a set of metrics describing the quality of the model.
15+
3. **Predicting** the type of the flower is performed in the `Main()` method:
16+
```CSharp
17+
var prediction = model.Predict(TestIrisData.Iris1);
18+
```
19+
where you send an instance of the `TestIrisData` - the type that contains all features: petal length, width, etc. As a result you receive `IrisPrediction` with `Score` - array of probabilities that the given flower belongs to the type setosa, versicolor, or virginica correspondently.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Goal
2+
This is a getting started example that shows the simplest way of using ML.NET APIs for solving a regression problem on taxi fare prediction example.
3+
4+
## Problem
5+
The task is to build and train ML model (machine learning model) that will predict a taxi fare based on taxi vendor id, passengers count, rate code, etc.
6+
7+
## Problem Class - Regression
8+
The described task is an example of regression problem.
9+
> In machine learning, `regression` is the problem of predicting a continuous quantity for a given parameters. Unlike `classification` problems where the result we want to predict can have one of a few values (classes), the regression problem is predicting a continuous value, such as an integer or floating point value. These are often amounts, prices, sizes, etc.
10+
11+
Machine learning engineering process includes three steps: training ML model, evaluating how good it is, and if the quality is acceptable, using this model for predictions. If the quality of the model is not good enough, different algorithms and/or additional data transformations can be applied and the model should be trained and evaluated again.
12+
13+
1. **Training** the ML model is implemented in `TrainAsync()` method that constructs `LearningPipeline`, trains it and saves the trained model as a .zip file.
14+
2. **Evaluating** the ML model is implemented in `Evaluate()` method which runs the model against a test data (new data with known answers, that was not involved in training). As a result it produces a set of metrics describing the quality of the model.
15+
3. **Predicting** the predicting of the taxi fare amount is performed in the `Main()` method:
16+
```CSharp
17+
var prediction = model.Predict(TestTaxiTrips.Trip1);
18+
```
19+
where you send an instance of the `TaxiTrip` - the type that contains all features: taxi vendor id, passengers count, etc. As a result you receive `TaxiTripFarePrediction` object that has predicted `FareAmount`.

0 commit comments

Comments
 (0)