Skip to content

Commit 5803c90

Browse files
committed
- Updating from feedback
1 parent 925f7df commit 5803c90

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Microsoft.ML.StandardLearners/Standard/MultiClass/OneVersusAllTrainer.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public sealed class OneVersusAllTrainer : MetaMulticlassTrainer<MulticlassPredic
4949
private readonly Options _options;
5050

5151
/// <summary>
52-
/// Options passed to OneVsAll.
52+
/// Options passed to <see cref="OneVersusAllTrainer"/>
5353
/// </summary>
5454
internal sealed class Options : OptionsBase
5555
{
@@ -78,26 +78,26 @@ internal OneVersusAllTrainer(IHostEnvironment env, Options options)
7878
/// <param name="env">The <see cref="IHostEnvironment"/> instance.</param>
7979
/// <param name="binaryEstimator">An instance of a binary <see cref="ITrainerEstimator{TTransformer, TPredictor}"/> used as the base trainer.</param>
8080
/// <param name="calibrator">The calibrator. If a calibrator is not provided, it will default to <see cref="PlattCalibratorTrainer"/></param>
81-
/// <param name="labelColumn">The name of the label colum.</param>
81+
/// <param name="labelColumnName">The name of the label colum.</param>
8282
/// <param name="imputeMissingLabelsAsNegative">If true will treat missing labels as negative labels.</param>
83-
/// <param name="maxCalibrationExamples">Number of instances to train the calibrator.</param>
83+
/// <param name="maximumCalibrationExampleCount">Number of instances to train the calibrator.</param>
8484
/// <param name="useProbabilities">Use probabilities (vs. raw outputs) to identify top-score category.</param>
8585
internal OneVersusAllTrainer(IHostEnvironment env,
8686
TScalarTrainer binaryEstimator,
87-
string labelColumn = DefaultColumnNames.Label,
87+
string labelColumnName = DefaultColumnNames.Label,
8888
bool imputeMissingLabelsAsNegative = false,
8989
ICalibratorTrainer calibrator = null,
90-
int maxCalibrationExamples = 1000000000,
90+
int maximumCalibrationExampleCount = 1000000000,
9191
bool useProbabilities = true)
9292
: base(env,
9393
new Options
9494
{
9595
ImputeMissingLabelsAsNegative = imputeMissingLabelsAsNegative,
96-
MaxCalibrationExamples = maxCalibrationExamples,
96+
MaxCalibrationExamples = maximumCalibrationExampleCount,
9797
},
98-
LoadNameValue, labelColumn, binaryEstimator, calibrator)
98+
LoadNameValue, labelColumnName, binaryEstimator, calibrator)
9999
{
100-
Host.CheckValue(labelColumn, nameof(labelColumn), "Label column should not be null.");
100+
Host.CheckValue(labelColumnName, nameof(labelColumnName), "Label column should not be null.");
101101
_options = (Options)Args;
102102
_options.UseProbabilities = useProbabilities;
103103
}
@@ -165,12 +165,12 @@ private IDataView MapLabels(RoleMappedData data, int cls)
165165
return MapLabelsCore(NumberDataViewType.Double, (in double val) => key == val, data);
166166
}
167167

168-
throw Host.ExceptNotSupp($"Label column type is not supported by OneVsAllTrainer: {lab.Type}");
168+
throw Host.ExceptNotSupp($"Label column type is not supported by OneVersusAllTrainer: {lab.Type.RawType}");
169169
}
170170

171-
/// <summary> Trains a <see cref="MulticlassPredictionTransformer{OneVsAllModelParameters}"/> model.</summary>
171+
/// <summary> Trains a <see cref="MulticlassPredictionTransformer{OneVersusAllModelParameters}"/> model.</summary>
172172
/// <param name="input">The input data.</param>
173-
/// <returns>A <see cref="MulticlassPredictionTransformer{OneVsAllModelParameters}"/> model./></returns>
173+
/// <returns>A <see cref="MulticlassPredictionTransformer{OneVersusAllModelParameters}"/> model./></returns>
174174
public override MulticlassPredictionTransformer<OneVersusAllModelParameters> Fit(IDataView input)
175175
{
176176
var roles = new KeyValuePair<CR, string>[1];
@@ -203,7 +203,7 @@ public override MulticlassPredictionTransformer<OneVersusAllModelParameters> Fit
203203
}
204204

205205
/// <summary>
206-
/// Contains the model parameters and prediction functions for OneVsAll.
206+
/// Contains the model parameters and prediction functions for <see cref="OneVersusAllTrainer"/>.
207207
/// </summary>
208208
public sealed class OneVersusAllModelParameters :
209209
ModelParametersBase<VBuffer<float>>,
@@ -305,7 +305,7 @@ internal static OneVersusAllModelParameters Create(IHost host, bool useProbabili
305305
}
306306

307307
/// <summary>
308-
/// Create a OneVsAll predictor from an array of predictors.
308+
/// Create a <see cref="OneVersusAllModelParameters"/> from an array of predictors.
309309
/// </summary>
310310
[BestFriend]
311311
internal static OneVersusAllModelParameters Create(IHost host, TScalarPredictor[] predictors)

src/Microsoft.ML.StandardLearners/Standard/MultiClass/Pkpd.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ namespace Microsoft.ML.Trainers
5050
/// logistic regression is a more principled way to solve a multiclass problem, it
5151
/// requires that the learner store a lot more intermediate state in the form of
5252
/// L-BFGS history for all classes *simultaneously*, rather than just one-by-one
53-
/// as would be needed for OneVersusAll.
53+
/// as would be needed for a one-versus-all classification model.
5454
/// </summary>
5555
public sealed class Pkpd : MetaMulticlassTrainer<MulticlassPredictionTransformer<PkpdModelParameters>, PkpdModelParameters>
5656
{
@@ -82,9 +82,9 @@ internal Pkpd(IHostEnvironment env, Options options)
8282
/// </summary>
8383
/// <param name="env">The <see cref="IHostEnvironment"/> instance.</param>
8484
/// <param name="binaryEstimator">An instance of a binary <see cref="ITrainerEstimator{TTransformer, TPredictor}"/> used as the base trainer.</param>
85-
/// <param name="calibrator">The calibrator. If a calibrator is not explicitely provided, it will default to <see cref="PlattCalibratorTrainer"/></param>
8685
/// <param name="labelColumn">The name of the label colum.</param>
8786
/// <param name="imputeMissingLabelsAsNegative">Whether to treat missing labels as having negative labels, instead of keeping them missing.</param>
87+
/// <param name="calibrator">The calibrator to use for each model instance. If a calibrator is not explicitely provided, it will default to <see cref="PlattCalibratorTrainer"/></param>
8888
/// <param name="maxCalibrationExamples">Number of instances to train the calibrator.</param>
8989
internal Pkpd(IHostEnvironment env,
9090
TScalarTrainer binaryEstimator,

0 commit comments

Comments
 (0)