-
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
Fix NullReferenceException when it comes to Recommendation in AutoML and CodeGenerator #4774
Fix NullReferenceException when it comes to Recommendation in AutoML and CodeGenerator #4774
Conversation
{nameof(MatrixFactorizationTrainer.Options.Lambda), 0.01f }, | ||
{nameof(MatrixFactorizationTrainer.Options.LossFunction), MatrixFactorizationTrainer.LossFunctionType.SquareLossRegression }, | ||
{nameof(MatrixFactorizationTrainer.Options.Alpha), 1f }, | ||
{nameof(MatrixFactorizationTrainer.Options.C), 0.00001f }, |
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 for adding the MF options to a test.
ITrainerGenerator generator = TrainerGeneratorFactory.GetInstance(node); | ||
var trainerString = generator.GenerateTrainer(); | ||
var trainerUsings = generator.GenerateUsings(); | ||
return (trainerString, trainerUsings); |
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.
I'm not sure why the try/catch was needed. If no one else knows, we may want drill down in the code, or run a variety of datasets thru the CLI to show that nothing is expected to throw.
The old catch seem to eat the error without a hint of what went wrong.
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, that's why I removed that part of code
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.
LGTM. May want to check on why we had a try/catch before, seemed oddly written previously. Thanks for expanding the unit test to cover MF's options.
add code for handle enum case in CodeGen