-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Addition of the ValueMappingEstimator and ValueMappingTransform. #1710
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
This will be replacing the TermLookupTransform and provide a way to specify the mapping betweeen two values (note this is specified and not trained). A user can specify the mapping by providing a keys list and values list that must be equal in size. The Estimator will then generate a 1-1 mapping based on the two lists. The PR references dotnet#754 which covers the conversion of Transformer to use the new Estimator API.
|
@Ivanidzo4ka @sfilipi - I am thankful for your future code reviews! #Resolved |
|
@Ivanidzo4ka and @sfilipi - I have pushed an update. Can you review when you have a moment? #Resolved |
| /// <summary> | ||
| /// Base class that contains the mapping of keys to values. | ||
| /// </summary> | ||
| private abstract class ValueMap |
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.
ValueMap [](start = 31, length = 8)
You have only one child class for this abstract class, is it worth to have it? #ByDesign
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.
The main issue with combining the two classes and having a single class is the declaration of the ValueMap on the Transformer. It would go from ValueMap _valueMap to ValueMap<TKey, TValue> _valueMap -- this would be OK if TKey and TValue could be used directly, however the ValueMap is constructed based on the column types (which are similar!). Where they differr is when TValue is a vector type. When creating ValueMapping Transformer with an int vector, TValue is still only in. However in the value map its int[].
In reply to: 243464824 [](ancestors = 243464824)
Ivanidzo4ka
left a comment
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.
![]()
src/Microsoft.ML.Data/Transforms/ConversionsExtensionsCatalog.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.ML.Data/Transforms/ConversionsExtensionsCatalog.cs
Outdated
Show resolved
Hide resolved
|
@Ivanidzo4ka @sfilipi thanks a ton for your feedback! Just need one more approval. |
sfilipi
left a comment
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 will be replacing the TermLookupTransform and provide a way to
specify the mapping betweeen two values (note this is specified and not
trained). A user can specify the mapping by providing a keys list and
values list that must be equal in size. The Estimator will then generate
a 1-1 mapping based on the two lists.
The PR references #754 which covers the conversion of Transformer to use
the new Estimator API.