Skip to content

Commit 27a0f84

Browse files
Ivanidzo4kaShauheen
authored andcommitted
Add more documentation for ova (#447)
Add more documentation for OneVersusAll
1 parent 2f6b678 commit 27a0f84

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/Microsoft.ML/Models/OneVersusAll.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,26 @@ namespace Microsoft.ML.Models
1313
public sealed partial class OneVersusAll
1414
{
1515
/// <summary>
16-
/// Create OneVersusAll multiclass trainer.
16+
/// One-versus-all, OvA, learner (also known as One-vs.-rest, "OvR") is a multi-class learner
17+
/// with the strategy to fit one binary classifier per class in the dataset.
18+
/// It trains the provided binary classifier for each class against the other classes, where the current
19+
/// class is treated as the positive labels and examples in other classes are treated as the negative classes.
20+
/// See <a href="https://en.wikipedia.org/wiki/Multiclass_classification#One-vs.-rest">wikipedia</a> page.
1721
/// </summary>
22+
///<example>
23+
/// In order to use it all you need to do is add it to pipeline as regular learner:
24+
///
25+
/// pipeline.Add(OneVersusAll.With(new StochasticDualCoordinateAscentBinaryClassifier()));
26+
/// </example>
27+
/// <remarks>
28+
/// The base trainer must be a binary classifier. To check the available binary classifiers, type BinaryClassifiers,
29+
/// and look at the available binary learners as suggested by IntelliSense.
30+
/// </remarks>
1831
/// <param name="trainer">Underlying binary trainer</param>
19-
/// <param name="useProbabilities">"Use probabilities (vs. raw outputs) to identify top-score category</param>
32+
/// <param name="useProbabilities">"Use probabilities (vs. raw outputs) to identify top-score category.
33+
/// By specifying it to false, you can tell One-versus-all to not use the probabilities but instead
34+
/// the raw uncalibrated scores from each predictor. This is generally not recommended, since these quantities
35+
/// are not meant to be comparable from one predictor to another, unlike calibrated probabilities.</param>
2036
public static ILearningPipelineItem With(ITrainerInputWithLabel trainer, bool useProbabilities = true)
2137
{
2238
return new OvaPipelineItem(trainer, useProbabilities);

test/Microsoft.ML.Tests/Scenarios/IrisPlantClassificationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public class IrisPrediction
138138
}
139139

140140
[Fact]
141-
public void TrainOva()
141+
public void TrainOneVersusAll()
142142
{
143143
string dataPath = GetDataPath("iris.txt");
144144

0 commit comments

Comments
 (0)