Skip to content

ValueMappingEstimator does not produce the correct output schema with metadata #2083

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

Closed
singlis opened this issue Jan 9, 2019 · 0 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@singlis
Copy link
Member

singlis commented Jan 9, 2019

The ValueMappingEstimator when calling GetOutputSchema and setting the treatAsKeyTypes to true does not return an output schema that contains metadata. This is can be reproduced by creating a ValueMappingEstimator and appending with a KeyToValueMappingEstimator to do a reverse lookup of the KeyType to the original value.

Here is the code snippet that reproduces the error:

            var pipeline = new ValueMappingEstimator<string, string>(ml, educationKeys, educationValues, true, ("Education", "EducationKeyType"))
                              .Append(new KeyToValueMappingEstimator(ml, ("EducationKeyType", "EducationCategory")));
@singlis singlis added the bug Something isn't working label Jan 9, 2019
@singlis singlis self-assigned this Jan 9, 2019
@singlis singlis changed the title ValueMappingEstimator ValueMappingEstimator does not produce the correct output schema with metadata Jan 9, 2019
singlis added a commit to singlis/machinelearning that referenced this issue Jan 9, 2019
ValueMappingEstimator used a key type resulted in the reverse key lookup
to fail. This was due to first the ValueMappingEstimator had an
incorrect metadata set for GetOutputSchema. Also the reverse lookup data
was set incorrectly and it would instead return the ValueMapping's Key
data instead of the Value data.

This also adds a test to verify the changes.

Fixes dotnet#2086
Fixes dotnet#2083
singlis added a commit to singlis/machinelearning that referenced this issue Jan 9, 2019
Values as KeyTypes:
1) The output schema for the Estimator did not contain the KeyType
information in the metadata.
2) The reverse lookup of the metadata had the incorrect value.

This now sets the correct metadata on the output schema and uses the
value data for the reverse lookup. A test was added to confirm the
changes using the KeyToValueMapping appended to a ValueMappingEstimator
for the reverse lookup.

Fixes dotnet#2086
Fixes dotnet#2083
singlis added a commit to singlis/machinelearning that referenced this issue Jan 9, 2019
Values as KeyTypes:
1) The output schema for the Estimator did not contain the KeyType
information in the metadata.
2) The reverse lookup of the metadata had the incorrect value.

This now sets the correct metadata on the output schema and uses the
value data for the reverse lookup. A test was added to confirm the
changes using the KeyToValueMapping appended to a ValueMappingEstimator
for the reverse lookup.

Fixes dotnet#2086
Fixes dotnet#2083
singlis added a commit that referenced this issue Jan 15, 2019
* The ValueMappingEstimator had a couple of issues when using setting the
Values as KeyTypes:
1) The output schema for the Estimator did not contain the KeyType
information in the metadata.
2) The reverse lookup of the metadata had the incorrect value.

This now sets the correct metadata on the output schema and uses the
value data for the reverse lookup. A test was added to confirm the
changes using the KeyToValueMapping appended to a ValueMappingEstimator
for the reverse lookup.

Fixes #2086
Fixes #2083
@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
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant