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

Re-train OneVersus all models #4641

Open
srqdev opened this issue Jan 10, 2020 · 2 comments
Open

Re-train OneVersus all models #4641

srqdev opened this issue Jan 10, 2020 · 2 comments
Assignees
Labels

Comments

@srqdev
Copy link

@srqdev srqdev commented Jan 10, 2020

System information

  • Win 10
  • .NET 4.7.2

Question

Looking at https://docs.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/retrain-model-ml-net I see that an AveragedPercepton model can be retrained but this only seems to be when used as a binary classifier. Using it as part of a multiclass pipeline (see below) then the fit method does not support model parameters. I may be missing something but it does not appear that you can retrain binary classifiers in this scenario.

Source code / logs

var dataProcessPipeline = 
   ctx.Transforms.Conversion.MapValueToKey("Category", "Prediction")
  .Append(ctx.Transforms.Text.FeaturizeText("Description_tf", textOptions, "Features"))
  .Append(ctx.Transforms.CopyColumns("Features", "Description_tf"))
  .Append(ctx.Transforms.NormalizeMinMax("Features", "Features"))
  .AppendCacheCheckpoint(ctx);

var trainer = ctx.MulticlassClassification.Trainers
  .OneVersusAll(ctx.BinaryClassification.Trainers
  .AveragedPerceptron("Category", numberOfIterations: iterations), "Category")
  .Append(ctx.Transforms.Conversion.MapKeyToValue("PredictedLabel", "PredictedLabel"));

var trainingPipeline = dataProcessPipeline.Append(trainer);
return trainingPipeline.Fit(trainingDataView);
@antoniovs1029

This comment has been minimized.

Copy link
Member

@antoniovs1029 antoniovs1029 commented Jan 10, 2020

Hi, @srqdev . As you have noted, it is not possible to retrain a OneVersusAll trainer, and that's why it doesn't have a Fit() method that accepts both a DataView and a set of pretrained model parameters.

Because of this, I will rephrase the title of your issue, and label it as a feature request.

@antoniovs1029 antoniovs1029 changed the title How can your re-train an AveragedPerceptronTrainer when used in the OneVersus all Multiclass scenario Re-train OneVersus all models Jan 10, 2020
@antoniovs1029 antoniovs1029 added enhancement P2 and removed P3 question labels Jan 10, 2020
@srqdev

This comment has been minimized.

Copy link
Author

@srqdev srqdev commented Jan 11, 2020

Hi, @antoniovs1029, thanks. The lack of re-trainability has stopped a project moving forward, at least the idea of using model retraining.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.