Skip to content

Allow only binary classifiers in OVA #2949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -628,7 +628,7 @@ private static ICalibratorTrainer GetCalibratorTrainerOrThrow(IExceptionContext
/// <param name="useProbabilities">Use probabilities (vs. raw outputs) to identify top-score category.</param>
/// <typeparam name="TModel">The type of the model. This type parameter will usually be inferred automatically from <paramref name="binaryEstimator"/>.</typeparam>
public static OneVersusAllTrainer OneVersusAll<TModel>(this MulticlassClassificationCatalog.MulticlassClassificationTrainers catalog,
ITrainerEstimator<ISingleFeaturePredictionTransformer<TModel>, TModel> binaryEstimator,
ITrainerEstimator<BinaryPredictionTransformer<TModel>, TModel> binaryEstimator,
Copy link
Contributor

@rogancarr rogancarr Mar 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BinaryPredictionTransformer [](start = 30, length = 27)

Might not be so easy because any given BinaryPredictionTransformer might not be an ISingleFeaturePredictionTransformer; from what I understand, OVA is currently limited to learners with single feature vectors (e.g. not FieldAwareFactorizationMachines). #Resolved

Copy link
Member Author

@ganik ganik Mar 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the definition for BinaryPredictionTransformer:

/// <summary>
/// Base class for the <see cref="ISingleFeaturePredictionTransformer{TModel}"/> working on binary classification tasks.
/// </summary>
/// <typeparam name="TModel">An implementation of the <see cref="IPredictorProducing{TResult}"/></typeparam>
public sealed class BinaryPredictionTransformer<TModel> : SingleFeaturePredictionTransformerBase<TModel>

so it looks like its a base transformer class for all ISingleFeaturePredictionTransformer and thats exactly what we need.


In reply to: 265408746 [](ancestors = 265408746)

string labelColumnName = DefaultColumnNames.Label,
bool imputeMissingLabelsAsNegative = false,
IEstimator<ISingleFeaturePredictionTransformer<ICalibrator>> calibrator = null,