-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
PcaTrainer as estimator #996
Conversation
@@ -108,6 +137,18 @@ public override PcaPredictor Train(TrainContext context) | |||
} | |||
} | |||
|
|||
private static SchemaShape.Column MakeWeightColumn(string weightColumn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use trainerUtils #Resolved
src/Microsoft.ML.PCA/PcaTrainer.cs
Outdated
} | ||
|
||
protected override BinaryPredictionTransformer<PcaPredictor> MakeTransformer(PcaPredictor model, ISchema trainSchema) | ||
=> new BinaryPredictionTransformer<PcaPredictor>(Host, model, trainSchema, _featureColumn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a, _featu [](start = 84, length = 9)
@zruty do we have a threeshold, to pass? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public IDataView Transform(IDataView input) | ||
{ | ||
Host.CheckValue(input, nameof(input)); | ||
return Scorer.ApplyToData(Host, input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scorer [](start = 19, length = 6)
SDCA, FastTree, LightGbm, GAM don't have Scorer setup, so tests are failing. #Resolved
src/Microsoft.ML.PCA/PcaTrainer.cs
Outdated
@@ -41,7 +42,7 @@ namespace Microsoft.ML.Runtime.PCA | |||
/// <remarks> | |||
/// This PCA can be made into Kernel PCA by using Random Fourier Features transform | |||
/// </remarks> | |||
public sealed class RandomizedPcaTrainer : TrainerBase<PcaPredictor> | |||
public sealed class RandomizedPcaTrainer : TrainerEstimatorBase<BinaryPredictionTransformer<PcaPredictor>, PcaPredictor> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BinaryPredictionTransformer [](start = 68, length = 27)
So, why is this a binary prediction transformer? Prior to your change it was not a binary predictor, it was part of the anomaly detection task. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ | ||
return scoreType == NumberType.Float; | ||
} | ||
=> scoreType == NumberType.Float; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bit of a nit, but while you're at it, maybe indent properly. #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sfilipi !
Closing and re-opening to trigger rebuild. The local build is fine.. |
/// <param name="rank">The number of components in the PCA.</param> | ||
/// <param name="oversampling">Oversampling parameter for randomized PCA training.</param> | ||
/// <param name="center">If enabled, data is centered to be zero mean.</param> | ||
/// <param name="seed">The seed for random number generation.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seed [](start = 25, length = 4)
why do we use a separate seed here? #Pending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var pipeline = new RandomizedPcaTrainer(Env, featureColumn, rank:10); | ||
|
||
TestEstimatorCore(pipeline, data); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} [](start = 7, length = 2)
Done()
#Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addresses part of #754