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

ValueMappingTransform does not handle type string for keys and values #2114

Open
singlis opened this Issue Jan 10, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@singlis
Copy link
Member

singlis commented Jan 10, 2019

ValueMappingTransform does handle ReadOnlyMemory for values and keys, it does not handle strings.

This should be updated as users will naturally want to use strings for the data type. With this support, the following should work:

            var educationKeys = new List<string>()
            {
                "0-5yrs",
                "6-11yrs",
                "12+yrs"
            };

            var educationValues = new List<string>()
            {
                "Cat1",
                "Cat2", 
                "Cat3"
            };

            var pipeline = new ValueMappingEstimator<string, string>(ml, educationKeys, educationValues, ("Education", "EducationCategory"));

@singlis singlis added the enhancement label Jan 10, 2019

@singlis singlis self-assigned this Jan 10, 2019

singlis pushed a commit to singlis/machinelearning that referenced this issue Jan 10, 2019

Scott Inglis
This adds support for strings to be used for keys and values for the
ValueMappingEstimator (as opposed to ReadOnlyMemory<char>).
This also converts all tests to use string types as well as adds an
additional test for string vector values.

Fixes dotnet#2114

@singlis singlis referenced a pull request that will close this issue Jan 10, 2019

Open

Adds string support for ValueMappingEstimator #2115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment