Skip to content

Commit 36ffe1c

Browse files
committed
Addition of the ValueMappingEstimator and ValueMappingTransform.
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.
1 parent 8099f58 commit 36ffe1c

File tree

4 files changed

+635
-1
lines changed

4 files changed

+635
-1
lines changed

src/Microsoft.ML.Data/Transforms/ExtensionsCatalog.cs

+14
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Microsoft.ML.Runtime;
66
using Microsoft.ML.Runtime.Data;
77
using Microsoft.ML.Transforms;
8+
using System.Collections.Generic;
89

910
namespace Microsoft.ML
1011
{
@@ -90,4 +91,17 @@ public static ColumnSelectingEstimator SelectColumns(this TransformsCatalog cata
9091
=> new ColumnSelectingEstimator(CatalogUtils.GetEnvironment(catalog),
9192
keepColumns, dropColumns, keepHidden, ignoreMissing);
9293
}
94+
95+
/*
96+
97+
public static class ValueMappingCatalog
98+
{
99+
public static ValueMappingEstimator<TInputType, TOutputType> ValueMap<TInputType, TOutputType>(
100+
this TransformsCatalog catalog,
101+
IEnumerable<TInputType> keys,
102+
IEnumerable<TOutputType> values,
103+
params (string source, string name)[] columns)
104+
=> new ValueMappingEstimator<TInputType, TOutputType>(CatalogUtils.GetEnvironment(catalog), keys, values, columns);
105+
}
106+
*/
93107
}

0 commit comments

Comments
 (0)