-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
36ffe1c
Addition of the ValueMappingEstimator and ValueMappingTransform.
singlis f31c7e6
Merge remote-tracking branch 'origin/master' into singlis/term
singlis 7335dd4
Re-enabled workout test, fixed build errors
singlis fc39679
Merge remote-tracking branch 'origin/master' into singlis/term
singlis 03950c8
- Added command line bindings
singlis b6d17e7
Merge remote-tracking branch 'origin/master' into singlis/term
singlis ec593b6
- Fix for ColumnCopyingTransformer
singlis 74c700c
- Adding support for missing value.
singlis 430e5ac
- Removed array types for keys
singlis 03c0143
- Support for treat values as key types, and support for back-compat…
singlis 68ec5bf
- TermLookup compatibility with tests
singlis 1e6b09d
Merge remote-tracking branch 'origin/master' into singlis/term
singlis c210916
...updating...
singlis cf00b81
Merge remote-tracking branch 'origin/master' into singlis/term
singlis 5445667
...updating...
singlis cefe1a8
- Added support for the values to be represented as key types
singlis 6718322
- Renaming ValueMappingTransform to ValueMappingTransformer
singlis 3711406
Merge remote-tracking branch 'origin/master' into singlis/term
singlis 47b605d
- Updates after merging to master
singlis 6588644
- Fixing release build.
singlis ce8c95b
- Updating based upon feedback."
singlis 06d4dd2
Merge branch 'master' of https://github.com/dotnet/machinelearning in…
singlis 88f759e
- Updating from further feedback
singlis 3624f5d
Merge remote-tracking branch 'origin/master' into singlis/term
singlis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,9 @@ | |
|
|
||
| using Microsoft.ML.Runtime; | ||
| using Microsoft.ML.Runtime.Data; | ||
| using Microsoft.ML.Transforms; | ||
| using Microsoft.ML.Transforms.Conversions; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace Microsoft.ML | ||
| { | ||
|
|
@@ -125,5 +127,23 @@ public static ValueToKeyMappingEstimator MapValueToKey(this TransformsCatalog.Co | |
| string termsColumn = null, | ||
| IComponentFactory<IMultiStreamSource, IDataLoader> loaderFactory = null) | ||
| => new ValueToKeyMappingEstimator(CatalogUtils.GetEnvironment(catalog), columns, file, termsColumn, loaderFactory); | ||
|
|
||
| /// <summary> | ||
| /// Maps specified keys to specified values | ||
| /// </summary> | ||
| /// <typeparam name="TInputType">The key type.</typeparam> | ||
| /// <typeparam name="TOutputType">The value type.</typeparam> | ||
| /// <param name="catalog">The categorical transform's catalog</param> | ||
| /// <param name="keys">The list of keys to use for the mapping. The mapping is 1-1 with values. This list must be the same length as values and | ||
| /// cannot contain duplicate keys.</param> | ||
| /// <param name="values">The list of values to pair with the keys for the mapping. This list must be equal to the same length as keys.</param> | ||
| /// <param name="columns">The columns to apply this transform on.</param> | ||
| /// <returns></returns> | ||
| public static ValueMappingEstimator<TInputType, TOutputType> ValueMap<TInputType, TOutputType>( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
we like to have summary comments for our public code. #Resolved |
||
| this TransformsCatalog.ConversionTransforms catalog, | ||
| IEnumerable<TInputType> keys, | ||
| IEnumerable<TOutputType> values, | ||
| params (string source, string name)[] columns) | ||
| => new ValueMappingEstimator<TInputType, TOutputType>(CatalogUtils.GetEnvironment(catalog), keys, values, columns); | ||
| } | ||
| } | ||
975 changes: 975 additions & 0 deletions
975
src/Microsoft.ML.Data/Transforms/ValueMappingTransformer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.