-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Extend Gam Samples #3281
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
Extend Gam Samples #3281
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3281 +/- ##
==========================================
+ Coverage 72.62% 72.64% +0.01%
==========================================
Files 807 807
Lines 145080 145191 +111
Branches 16213 16223 +10
==========================================
+ Hits 105368 105477 +109
- Misses 35294 35295 +1
- Partials 4418 4419 +1
|
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/Gam.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/Gam.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/Gam.cs
Outdated
Show resolved
Hide resolved
docs/samples/Microsoft.ML.Samples/Dynamic/Trainers/BinaryClassification/Gam.cs
Outdated
Show resolved
Hide resolved
…ification/Gam.cs Co-Authored-By: rogancarr <[email protected]>
…ification/Gam.cs Co-Authored-By: rogancarr <[email protected]>
@@ -0,0 +1,150 @@ | |||
using System; |
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.
Similar comments for Gam without Options apply here (and other sample files) #Resolved
…ification/Gam.cs Co-Authored-By: rogancarr <[email protected]>
…ification/Gam.cs Co-Authored-By: rogancarr <[email protected]>
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.
Just leave some clarification comments. Overall LGTM.
else if (x < 0.25) | ||
return 1; | ||
else | ||
return 0; |
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.
0 [](start = 23, length = 1)
is this the same as x < 0 value? #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.
{ | ||
// Generate random, uncoupled features. | ||
var data = new Data { | ||
Features = new float[2] { (float)(rng.NextDouble() - 0.5), (float)(rng.NextDouble() - 0.5) } |
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.
(float)(rng.NextDouble() - 0.5) [](start = 46, length = 31)
i would define this as a lambda below rng definition to make the code cleaner.
var rndFloat => (float)(rng.NextDouble() - 0.5) #Resolved
// at least the default number of bins, as a small number of bins limits the capacity of | ||
// the model. | ||
var trainer = mlContext.BinaryClassification.Trainers.Gam( | ||
new GamBinaryTrainer.Options { MaximumBinCountPerFeature = 16 }); |
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.
ptions { MaximumBinCountPerFeature = 16 } [](start = 38, length = 41)
can we use some options that are only available through Options class? #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.
* Adding Regression and Binary Classification GAM samples. (cherry picked from commit e37e5b1)
This PR extends the current GAM samples for regression and adds them for Binary Classification.
Fixes #3280