Skip to content
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

Allow only binary classifiers in OVA #2949

Merged
merged 1 commit into from
Mar 14, 2019
Merged

Allow only binary classifiers in OVA #2949

merged 1 commit into from
Mar 14, 2019

Conversation

ganik
Copy link
Member

@ganik ganik commented Mar 13, 2019

fixes #2920

@@ -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)

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

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

Thanks @ganik! This should help prevent people from feeding in the "wrong" types of models I hope.

@TomFinley TomFinley merged commit 6a4df7c into dotnet:master Mar 14, 2019
@rogancarr
Copy link
Contributor

Broken build ! I'm fixing.

@rogancarr rogancarr mentioned this pull request Mar 14, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OVA Multiclass Classification can be instantiated for variety of sub-trainer training tasks
3 participants