-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Making Schema implement ISchema explicitly #1894
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
@@ -85,7 +85,7 @@ public static void FeatureContributionCalculationTransform_Regression() | |||
var value = row.Features[featureOfInterest]; | |||
var contribution = row.FeatureContributions[featureOfInterest]; | |||
var percentContribution = 100 * contribution / row.Score; | |||
var name = data.Schema.GetColumnName(featureOfInterest + 1); | |||
var name = data.Schema[(int) (featureOfInterest + 1)].Name; |
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.
(int) [](start = 39, length = 5)
why cast to int if it's already int?
To catch overflow? #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.
I have no idea, this is Resharper doing the work for me. I believe you are right, it's for the overflow.
In reply to: 242359826 [](ancestors = 242359826)
5ecf4ed
to
6ed35f0
Compare
You can start looking now. Again, biggest changes are in |
@@ -310,38 +300,37 @@ private static Delegate GetMetadataGetterDelegate<TValue>(ISchema schema, int co | |||
return getter; | |||
} | |||
|
|||
/// <summary> | |||
/// Legacy method to get the column index. | |||
/// DO NOT USE: use <see cref="GetColumnOrNull"/> instead. |
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.
DO NOT USE [](start = 12, length = 10)
I'm guessing using actual Obsolete
on this and other code is undesirable? This one also looks very different from the others -- this is [BestFriend] internal
while the remainder are explicit, was that intentional, or just an artifact of the work being staged somehow? #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.
It's 450+ uses, and they cannot be all fixed mechanically with Resharper. So I opted to internal-best-friend it. The rest of the ISchema
will be removed, but this one, I think, may stay for longer.
Actually obsolete-ing is going to be quite disruptive to the code base either...
In reply to: 242417023 [](ancestors = 242417023)
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.
Thank you muchly @Zruty0 !!
I will know today. The 2 major blockers was Schema and ColumnBindingsBase. In reply to: 448109260 [](ancestors = 448109260) Refers to: src/Microsoft.ML.Core/Data/Schema.cs:25 in 5b17cc4. [](commit_id = 5b17cc4, deletion_comment = False) |
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.
Addresses #1500
Made Schema implement ISchema explicitly. Removed all calls to the ISchema inteface when Schema is accessed, with the exception of TryGetColumnIndex, which was made internal.