Skip to content

Make ScoreMapperSchema and its relatives not ISchema #2107

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

Merged
merged 3 commits into from
Jan 11, 2019

Conversation

wschin
Copy link
Member

@wschin wschin commented Jan 10, 2019

  1. Remove ScoreMapperSchema and its relatives entirely
  2. Create static functions to generate commonly-used Schema

This PR wants to join the march of #1501.

/// </summary>
public abstract class ScoreMapperSchemaBase : ISchema
[BestFriend]
internal static class ScoreSchemaFactory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this file to match the class that is inside of it? ScoreSchemaFactory.cs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

}
}
// Schema of Score column. We are going to extend it by adding a Probability column.
var partialSchema = Create(NumberType.Float, MetadataUtils.Const.ScoreColumnKind.BinaryClassification, scoreColumnName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) It feels a bit heavy-weight to create a whole schema object just to get 1 column out of it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This saves lines of creating metadata for that column (~6 lines). :)

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

1. Remove ScoreMapperSchema and its relatives entirely
2. Create static functions to generate commonly-used Schema
@wschin wschin force-pushed the make-score-mapper-schema-not-ischema branch from 813a0ff to acf718f Compare January 10, 2019 16:39
}
}

public sealed class SequencePredictorSchema : ScoreMapperSchemaBase
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SequencePredictorSchema [](start = 24, length = 23)

We use this schema in internal schema, if you remove it, that would force someone else to write code in internal repo.

Copy link
Member

@eerhardt eerhardt Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ivanidzo4ka - that's the intention. ISchema is going away, so any code (internal or public) that depends on it will need to be updated. #Resolved

Copy link
Member Author

@wschin wschin Jan 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@[email protected], after running 5 out of 7 sequence-related TLC tests, I still don't find a place where this object is actually used. In TLC code base, SequencePredictorSchema's constructor always bypasses the part which distinguish it from ScoreMapperSchemaBase because keyNames.Length is always 0. Therefore, we don't even know if this class was created correctly. Is a replacement to this class required?

[Update] I am adding a test based on what I can find in TLC and creating a factory maethod to sequence predictor.


In reply to: 246872132 [](ancestors = 246872132)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added it back with tests. Please take a look.


In reply to: 246871022 [](ancestors = 246871022)

Copy link
Contributor

@Ivanidzo4ka Ivanidzo4ka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@wschin wschin merged commit d26510f into dotnet:master Jan 11, 2019
@wschin wschin deleted the make-score-mapper-schema-not-ischema branch January 11, 2019 01:39
@eerhardt
Copy link
Member

using System;

Can you add a copyright header?


Refers to: test/Microsoft.ML.Core.Tests/UnitTests/ScoreSchemaTest.cs:1 in e1ad7d3. [](commit_id = e1ad7d3, deletion_comment = False)

@ghost ghost locked as resolved and limited conversation to collaborators Mar 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants