-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Samples for categorical transform estimators #3179
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
Codecov Report
@@ Coverage Diff @@
## master #3179 +/- ##
==========================================
+ Coverage 72.54% 72.58% +0.04%
==========================================
Files 807 807
Lines 144774 144956 +182
Branches 16208 16212 +4
==========================================
+ Hits 105021 105212 +191
+ Misses 35339 35326 -13
- Partials 4414 4418 +4
|
|
||
// A pipeline for one hot encoding the Education column. | ||
var bagPipeline = mlContext.Transforms.Categorical.OneHotEncoding("EducationOneHotEncoded", "Education", OutputKind.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.
", OutputKind.Bag); [](start = 114, length = 19)
I would leave it, so that it makes sense why we call it bagPipeline. #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.
am using the default (which is uses Indicator , not bagging) .. also renamed it to pipeline
In reply to: 271811206 [](ancestors = 271811206)
// 1 0 0 0 1 | ||
// 0 1 0 1 0 | ||
// 0 1 0 0 1 | ||
// 0 0 1 1 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.
make it a separate example, because the multi-output is a different API. #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.
// 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 | ||
// 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 | ||
// 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 | ||
} |
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.
separate example. #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.
private class DataPoint | ||
{ | ||
public float Label { get; set; } | ||
|
||
public string Education { get; set; } | ||
|
||
public string ZipCode { get; set; } |
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 string ZipCode { get; set; } [](start = 11, length = 36)
please remove since it's not used here #Resolved
|
||
public string Education { get; set; } | ||
|
||
public string ZipCode { get; set; } |
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 string ZipCode { get; set; } [](start = 11, length = 36)
please remove since it's not used here #Resolved
Console.Write($"{row[i]}\t"); | ||
Console.WriteLine(); | ||
} | ||
} | ||
private class DataPoint | ||
{ | ||
public float Label { get; set; } |
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 float Label { get; set; } [](start = 12, length = 32)
please remove #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.
@@ -1,6 +1,5 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using Microsoft.ML.Data; | |||
using static Microsoft.ML.Transforms.OneHotEncodingEstimator; |
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.
what is this for? can we remove it?
#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.
this is for the OutputKind.Key
parameter that we use in the example below
In reply to: 272292647 [](ancestors = 272292647)
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.
* categorical transform estimators * review comments * fix review comments * modify samples namespace
Towards #1209
The PR makes the following changes
OneHotHashEncoding
transform estimator.OneHotEncoding
transform estimator.