-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Metadata utils internalization, migration of few useful methods #2651
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
…c facing metadata methods.
…members to public.
Codecov Report
@@ Coverage Diff @@
## master #2651 +/- ##
==========================================
- Coverage 71.54% 71.54% -0.01%
==========================================
Files 800 801 +1
Lines 141848 141850 +2
Branches 16119 16120 +1
==========================================
- Hits 101482 101481 -1
- Misses 35916 35917 +1
- Partials 4450 4452 +2
|
@@ -998,16 +998,17 @@ private protected override IEnumerable<string> GetPerInstanceColumnsToSave(RoleM | |||
// Multi-class evaluator adds four per-instance columns: "Assigned", "Top scores", "Top classes" and "Log-loss". | |||
private protected override IDataView GetPerInstanceMetricsCore(IDataView perInst, RoleMappedSchema schema) | |||
{ | |||
// If the label column is a key without key values, convert it to I8, just for saving the per-instance | |||
// If the label column is a key without text key values, convert it to I8, just for saving the per-instance |
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 noticed that the code actually converts to R8, not I8.
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.
Ahhh. Delightful... seems a pity to update such a simple PR for an internal class. How about this, I'll locally fix it, and if for some other reason I need to update the PR it'll go in, otherwise it'll just go into my next PR.
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.
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.
/// </summary> | ||
public static bool IsNormalized(this DataViewSchema.Column column) | ||
{ | ||
var metaColumn = column.Metadata.Schema.GetColumnOrNull((MetadataUtils.Kinds.IsNormalized)); |
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.
(super nit): double params here. Can remove one 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.
|
||
[BestFriend] | ||
internal static bool HasKeyValues(this SchemaShape.Column col) | ||
public static bool HasKeyValues(this SchemaShape.Column col) |
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 for my information - what's the difference between this method and the public static bool HasKeyValues
in SchemaAnnotationsExtensions
?
I can see they contain different code, but they are named the same...?
Fixes #2622 by limiting the public surface area of metadata/annotations conveniences to a few places.
Note that that migrated methods are not exactly the same as the existing methods in the case of querying whether a key column type exists, since the existing methods predated the schema column type and therefore had some unnecessary parameters. Though I decided to expand it a bit so as to allow checks on whether other types of key values are present. Not sure if that's necessary or helpful.
Also internalized the rather innocuous but nonetheless probably unnecessary metadata builder extensions.
Commits structured incrementally as usual for the small steps.