-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Prevent learning pipeline from adding null transform model to the pipeline #154
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
Conversation
@@ -182,7 +182,9 @@ public LearningPipeline() | |||
|
|||
if (transformModels.Count > 0) | |||
{ | |||
transformModels.Insert(0,lastTransformModel); | |||
if (lastTransformModel != null) | |||
transformModels.Insert(0, lastTransformModel); |
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.
transformModels [](start = 24, length = 15)
would be nice to add test coverage
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.
Done.
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.
else | ||
Assert.Equal(0, predictionModel.TransformedF1[index]); | ||
|
||
predictionModel.TransformedF1 = null; |
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.
predictionModel.TransformedF1 = null; [](start = 11, length = 38)
out of curiosity, why? #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.
compiler warning that is treated as an error.
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.
fixed.
public string F1; | ||
} | ||
|
||
class TransformedData |
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.
explicit access modifer, same for class above #Closed
const string _dataPath = @"..\..\Data\breast-cancer.txt"; | ||
var pipeline = new LearningPipeline(); | ||
pipeline.Add(new TextLoader<InputData>(_dataPath, useHeader: false)); | ||
pipeline.Add(new CategoricalHashOneHotVectorizer("F1") { HashBits = 10, Seed = 314489979, OutputKind = CategoricalTransformOutputKind.Bag }); |
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.
Is this issue only affecting transforms only pipeline?
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.
yeah
…eline (dotnet#154) * Prevent learning pipeline from adding null transform model to the pipeline. * Add test.
fixes #153