5 instantiations of OneHotEncodingEstimator
Microsoft.ML.Transforms (5)
CategoricalCatalog.cs (4)
50
=> new
OneHotEncodingEstimator
(CatalogUtils.GetEnvironment(catalog),
87
return new
OneHotEncodingEstimator
(env, columnOptions, keyData);
98
=> new
OneHotEncodingEstimator
(CatalogUtils.GetEnvironment(catalog), columns);
111
=> new
OneHotEncodingEstimator
(CatalogUtils.GetEnvironment(catalog), columns, keyData);
OneHotEncoding.cs (1)
121
var transformed = new
OneHotEncodingEstimator
(env, columns.ToArray(), keyData).Fit(input).Transform(input);
169 references to OneHotEncodingEstimator
Microsoft.ML.IntegrationTests (1)
IntrospectiveTraining.cs (1)
340
maximumNumberOfInverts: -1, outputKind:
OneHotEncodingEstimator
.OutputKind.Bag));
Microsoft.ML.Samples (5)
Dynamic\Transforms\Categorical\OneHotEncoding.cs (3)
30
var
pipeline = mlContext.Transforms.Categorical.OneHotEncoding(
48
var
keyPipeline = mlContext.Transforms.Categorical.OneHotEncoding(
50
OneHotEncodingEstimator
.OutputKind.Key);
Dynamic\Transforms\Categorical\OneHotEncodingMultiColumn.cs (1)
29
var
multiColumnKeyPipeline =
Dynamic\Transforms\Categorical\OneHotHashEncoding.cs (1)
49
OneHotEncodingEstimator
.OutputKind.Key, 3);
Microsoft.ML.Tests (102)
OnnxConversionTest.cs (4)
462
OneHotEncodingEstimator
.OutputKind outputKind)
481
var
pipeline = mlContext.Transforms.Categorical.OneHotEncoding("Vector", "Key", outputKind);
485
if (
OneHotEncodingEstimator
.OutputKind.Binary == outputKind) break;
792
var pipeline = mlContext.Transforms.Categorical.OneHotEncoding("F2", "F2", Transforms.
OneHotEncodingEstimator
.OutputKind.Bag)
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (1)
597
.Append(mlContext.Transforms.Categorical.OneHotEncoding("CategoricalBag", "CategoricalFeatures",
OneHotEncodingEstimator
.OutputKind.Bag))
Transformers\CategoricalHashTests.cs (29)
53
new OneHotHashEncodingEstimator.ColumnOptions("CatA", "A",
OneHotEncodingEstimator
.OutputKind.Bag),
54
new OneHotHashEncodingEstimator.ColumnOptions("CatB", "A",
OneHotEncodingEstimator
.OutputKind.Binary),
55
new OneHotHashEncodingEstimator.ColumnOptions("CatC", "A",
OneHotEncodingEstimator
.OutputKind.Indicator),
56
new OneHotHashEncodingEstimator.ColumnOptions("CatD", "A",
OneHotEncodingEstimator
.OutputKind.Key),
57
new OneHotHashEncodingEstimator.ColumnOptions("CatVA", "B",
OneHotEncodingEstimator
.OutputKind.Bag),
58
new OneHotHashEncodingEstimator.ColumnOptions("CatVB", "B",
OneHotEncodingEstimator
.OutputKind.Binary),
59
new OneHotHashEncodingEstimator.ColumnOptions("CatVC", "B",
OneHotEncodingEstimator
.OutputKind.Indicator),
60
new OneHotHashEncodingEstimator.ColumnOptions("CatVD", "B",
OneHotEncodingEstimator
.OutputKind.Key),
61
new OneHotHashEncodingEstimator.ColumnOptions("CatVVA", "C",
OneHotEncodingEstimator
.OutputKind.Bag),
62
new OneHotHashEncodingEstimator.ColumnOptions("CatVVB", "C",
OneHotEncodingEstimator
.OutputKind.Binary),
63
new OneHotHashEncodingEstimator.ColumnOptions("CatVVC", "C",
OneHotEncodingEstimator
.OutputKind.Indicator),
64
new OneHotHashEncodingEstimator.ColumnOptions("CatVVD", "C",
OneHotEncodingEstimator
.OutputKind.Key),
90
.Append(ML.Transforms.Categorical.OneHotHashEncoding("A", "ScalarString", outputKind:
OneHotEncodingEstimator
.OutputKind.Indicator))
91
.Append(ML.Transforms.Categorical.OneHotHashEncoding("B", "VectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Indicator))
92
.Append(ML.Transforms.Categorical.OneHotHashEncoding("C", "VectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Bag))
93
.Append(ML.Transforms.Categorical.OneHotHashEncoding("D", "ScalarString", outputKind:
OneHotEncodingEstimator
.OutputKind.Binary))
94
.Append(ML.Transforms.Categorical.OneHotHashEncoding("E", "VectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Binary))
95
.Append(ML.Transforms.Categorical.OneHotHashEncoding("F", "VarVectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Bag))
97
.Append(ML.Transforms.Categorical.OneHotHashEncoding("G", "SingleVectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Bag));
121
new OneHotHashEncodingEstimator.ColumnOptions("CatA", "A",
OneHotEncodingEstimator
.OutputKind.Bag, maximumNumberOfInverts: -1),
122
new OneHotHashEncodingEstimator.ColumnOptions("CatB", "B",
OneHotEncodingEstimator
.OutputKind.Bag, maximumNumberOfInverts: -1),
123
new OneHotHashEncodingEstimator.ColumnOptions("CatC", "C",
OneHotEncodingEstimator
.OutputKind.Bag, maximumNumberOfInverts: -1),
124
new OneHotHashEncodingEstimator.ColumnOptions("CatD", "D",
OneHotEncodingEstimator
.OutputKind.Bag, maximumNumberOfInverts: -1),
125
new OneHotHashEncodingEstimator.ColumnOptions("CatE", "E",
OneHotEncodingEstimator
.OutputKind.Indicator, maximumNumberOfInverts: -1),
126
new OneHotHashEncodingEstimator.ColumnOptions("CatF", "F",
OneHotEncodingEstimator
.OutputKind.Indicator, maximumNumberOfInverts: -1),
127
new OneHotHashEncodingEstimator.ColumnOptions("CatG", "A",
OneHotEncodingEstimator
.OutputKind.Key, maximumNumberOfInverts: -1),
128
new OneHotHashEncodingEstimator.ColumnOptions("CatH", "B",
OneHotEncodingEstimator
.OutputKind.Key, maximumNumberOfInverts: -1),
129
new OneHotHashEncodingEstimator.ColumnOptions("CatI", "A",
OneHotEncodingEstimator
.OutputKind.Binary, maximumNumberOfInverts: -1),
130
new OneHotHashEncodingEstimator.ColumnOptions("CatJ", "B",
OneHotEncodingEstimator
.OutputKind.Binary, maximumNumberOfInverts: -1));
Transformers\CategoricalTests.cs (63)
71
var
pipe = ML.Transforms.Categorical.OneHotEncoding(new[]{
72
new
OneHotEncodingEstimator
.ColumnOptions("CatA", "A",
OneHotEncodingEstimator
.OutputKind.Bag),
73
new
OneHotEncodingEstimator
.ColumnOptions("CatB", "A",
OneHotEncodingEstimator
.OutputKind.Binary),
74
new
OneHotEncodingEstimator
.ColumnOptions("CatC", "A",
OneHotEncodingEstimator
.OutputKind.Indicator),
75
new
OneHotEncodingEstimator
.ColumnOptions("CatD", "A",
OneHotEncodingEstimator
.OutputKind.Key),
76
new
OneHotEncodingEstimator
.ColumnOptions("CatVA", "B",
OneHotEncodingEstimator
.OutputKind.Bag),
77
new
OneHotEncodingEstimator
.ColumnOptions("CatVB", "B",
OneHotEncodingEstimator
.OutputKind.Binary),
78
new
OneHotEncodingEstimator
.ColumnOptions("CatVC", "B",
OneHotEncodingEstimator
.OutputKind.Indicator),
79
new
OneHotEncodingEstimator
.ColumnOptions("CatVD", "B",
OneHotEncodingEstimator
.OutputKind.Key),
80
new
OneHotEncodingEstimator
.ColumnOptions("CatVVA", "C",
OneHotEncodingEstimator
.OutputKind.Bag),
81
new
OneHotEncodingEstimator
.ColumnOptions("CatVVB", "C",
OneHotEncodingEstimator
.OutputKind.Binary),
82
new
OneHotEncodingEstimator
.ColumnOptions("CatVVC", "C",
OneHotEncodingEstimator
.OutputKind.Indicator),
83
new
OneHotEncodingEstimator
.ColumnOptions("CatVVD", "C",
OneHotEncodingEstimator
.OutputKind.Key),
114
.Append(mlContext.Transforms.Categorical.OneHotEncoding("Features", outputKind:
OneHotEncodingEstimator
.OutputKind.Indicator));
137
var ci = new
OneHotEncodingEstimator
.ColumnOptions("CatA", "A",
OneHotEncodingEstimator
.OutputKind.Bag);
138
var
pipe = mlContext.Transforms.Categorical.OneHotEncoding(new[] { ci }, sideData);
165
.Append(ML.Transforms.Categorical.OneHotEncoding("A", "ScalarString", outputKind:
OneHotEncodingEstimator
.OutputKind.Indicator))
166
.Append(ML.Transforms.Categorical.OneHotEncoding("B", "VectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Indicator))
167
.Append(ML.Transforms.Categorical.OneHotEncoding("C", "VectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Bag))
168
.Append(ML.Transforms.Categorical.OneHotEncoding("D", "ScalarString", outputKind:
OneHotEncodingEstimator
.OutputKind.Binary))
169
.Append(ML.Transforms.Categorical.OneHotEncoding("E", "VectorString", outputKind:
OneHotEncodingEstimator
.OutputKind.Binary));
193
var
pipe = ML.Transforms.Categorical.OneHotEncoding(new[] {
194
new
OneHotEncodingEstimator
.ColumnOptions("CatA", "A",
OneHotEncodingEstimator
.OutputKind.Bag),
195
new
OneHotEncodingEstimator
.ColumnOptions("CatB", "B",
OneHotEncodingEstimator
.OutputKind.Bag),
196
new
OneHotEncodingEstimator
.ColumnOptions("CatC", "C",
OneHotEncodingEstimator
.OutputKind.Bag),
197
new
OneHotEncodingEstimator
.ColumnOptions("CatD", "D",
OneHotEncodingEstimator
.OutputKind.Bag),
198
new
OneHotEncodingEstimator
.ColumnOptions("CatE", "E",
OneHotEncodingEstimator
.OutputKind.Indicator),
199
new
OneHotEncodingEstimator
.ColumnOptions("CatF", "F",
OneHotEncodingEstimator
.OutputKind.Indicator),
200
new
OneHotEncodingEstimator
.ColumnOptions("CatG", "G",
OneHotEncodingEstimator
.OutputKind.Key),
201
new
OneHotEncodingEstimator
.ColumnOptions("CatH", "H",
OneHotEncodingEstimator
.OutputKind.Key),
202
new
OneHotEncodingEstimator
.ColumnOptions("CatI", "A",
OneHotEncodingEstimator
.OutputKind.Binary),
203
new
OneHotEncodingEstimator
.ColumnOptions("CatJ", "B",
OneHotEncodingEstimator
.OutputKind.Binary),
204
new
OneHotEncodingEstimator
.ColumnOptions("CatK", "C",
OneHotEncodingEstimator
.OutputKind.Binary),
205
new
OneHotEncodingEstimator
.ColumnOptions("CatL", "D",
OneHotEncodingEstimator
.OutputKind.Binary) });
319
var
pipe = ML.Transforms.Categorical.OneHotEncoding(new[]{
320
new
OneHotEncodingEstimator
.ColumnOptions("CatA", "A"),
321
new
OneHotEncodingEstimator
.ColumnOptions("CatB", "B"),
322
new
OneHotEncodingEstimator
.ColumnOptions("CatC", "C")
Transformers\ConvertTests.cs (4)
339
new
OneHotEncodingEstimator
.ColumnOptions("CatA", "A",
OneHotEncodingEstimator
.OutputKind.Indicator),
340
new
OneHotEncodingEstimator
.ColumnOptions("CatB", "B",
OneHotEncodingEstimator
.OutputKind.Key)
Transformers\NAIndicatorTests.cs (1)
138
var
pipe = ML.Transforms.Categorical.OneHotEncoding("CatA", "A");
Microsoft.ML.Transforms (61)
CategoricalCatalog.cs (34)
19
/// Create a <see cref="
OneHotEncodingEstimator
"/>, which converts the input column specified by <paramref name="inputColumnName"/>
25
/// <see cref="
OneHotEncodingEstimator
.OutputKind.Bag"/>, <see cref="
OneHotEncodingEstimator
.OutputKind.Indicator"/>, and <see cref="
OneHotEncodingEstimator
.OutputKind.Binary"/>.
26
/// If <paramref name="outputKind"/> is <see cref="
OneHotEncodingEstimator
.OutputKind.Key"/>, this column's data type will be a key in the case of a scalar input column
43
public static
OneHotEncodingEstimator
OneHotEncoding(this TransformsCatalog.CategoricalTransforms catalog,
46
OneHotEncodingEstimator
.OutputKind outputKind =
OneHotEncodingEstimator
.Defaults.OutKind,
51
new[] { new
OneHotEncodingEstimator
.ColumnOptions(outputColumnName, inputColumnName, outputKind, maximumNumberOfKeys, keyOrdinality) }, keyData);
54
/// Create a <see cref="
OneHotEncodingEstimator
"/>, which converts one or more input text columns specified in <paramref name="columns"/>
61
/// <see cref="
OneHotEncodingEstimator
.OutputKind.Bag"/>, <see cref="
OneHotEncodingEstimator
.OutputKind.Indicator"/>, and <see cref="
OneHotEncodingEstimator
.OutputKind.Binary"/>.
62
/// If <paramref name="outputKind"/> is <see cref="
OneHotEncodingEstimator
.OutputKind.Key"/>, the output columns' data type will be a key in the case of scalar input column
77
public static
OneHotEncodingEstimator
OneHotEncoding(this TransformsCatalog.CategoricalTransforms catalog,
79
OneHotEncodingEstimator
.OutputKind outputKind =
OneHotEncodingEstimator
.Defaults.OutKind,
86
var columnOptions = columns.Select(x => new
OneHotEncodingEstimator
.ColumnOptions(x.OutputColumnName, x.InputColumnName, outputKind, maximumNumberOfKeys, keyOrdinality)).ToArray();
96
internal static
OneHotEncodingEstimator
OneHotEncoding(this TransformsCatalog.CategoricalTransforms catalog,
97
params
OneHotEncodingEstimator
.ColumnOptions[] columns)
108
internal static
OneHotEncodingEstimator
OneHotEncoding(this TransformsCatalog.CategoricalTransforms catalog,
109
OneHotEncodingEstimator
.ColumnOptions[] columns,
120
/// <see cref="
OneHotEncodingEstimator
.OutputKind.Bag"/>, <see cref="
OneHotEncodingEstimator
.OutputKind.Indicator"/>, and <see cref="
OneHotEncodingEstimator
.OutputKind.Binary"/>.
121
/// If <paramref name="outputKind"/> is <see cref="
OneHotEncodingEstimator
.OutputKind.Key"/>, this column's data type will be a key in the case of a scalar input column
142
OneHotEncodingEstimator
.OutputKind outputKind =
OneHotEncodingEstimator
.OutputKind.Indicator,
159
/// <see cref="
OneHotEncodingEstimator
.OutputKind.Bag"/>, <see cref="
OneHotEncodingEstimator
.OutputKind.Indicator"/>, and <see cref="
OneHotEncodingEstimator
.OutputKind.Binary"/>.
160
/// If <paramref name="outputKind"/> is <see cref="
OneHotEncodingEstimator
.OutputKind.Key"/>, the output columns' data type will be a key in the case of scalar input column
178
OneHotEncodingEstimator
.OutputKind outputKind =
OneHotEncodingEstimator
.OutputKind.Indicator,
OneHotEncoding.cs (12)
26
/// <see cref="ITransformer"/> resulting from fitting a <see cref="
OneHotEncodingEstimator
"/>.
33
public
OneHotEncodingEstimator
.OutputKind? OutputKind;
53
if (!Enum.TryParse(extra, true, out
OneHotEncodingEstimator
.OutputKind kind))
65
if (!Enum.IsDefined(typeof(
OneHotEncodingEstimator
.OutputKind), kind))
79
public
OneHotEncodingEstimator
.OutputKind OutputKind =
OneHotEncodingEstimator
.Defaults.OutKind;
102
var columns = new List<
OneHotEncodingEstimator
.ColumnOptions>();
105
var col = new
OneHotEncodingEstimator
.ColumnOptions(
194
/// <seealso cref="CategoricalCatalog.OneHotEncoding(TransformsCatalog.CategoricalTransforms, InputOutputColumnPair[],
OneHotEncodingEstimator
.OutputKind, int, ValueToKeyMappingEstimator.KeyOrdinality, IDataView)"/>
195
/// <seealso cref="CategoricalCatalog.OneHotEncoding(TransformsCatalog.CategoricalTransforms, string, string,
OneHotEncodingEstimator
.OutputKind, int, ValueToKeyMappingEstimator.KeyOrdinality, IDataView)"/>
267
/// Initializes an instance of the <see cref="
OneHotEncodingEstimator
"/>.
281
_host = env.Register(nameof(
OneHotEncodingEstimator
));
OneHotHashEncoding.cs (15)
45
public
OneHotEncodingEstimator
.OutputKind? OutputKind;
111
public
OneHotEncodingEstimator
.OutputKind OutputKind = OneHotHashEncodingEstimator.Defaults.OutputKind;
138
OneHotEncodingEstimator
.OutputKind outputKind = OneHotHashEncodingEstimator.Defaults.OutputKind)
249
/// <seealso cref="CategoricalCatalog.OneHotHashEncoding(TransformsCatalog.CategoricalTransforms, string, string,
OneHotEncodingEstimator
.OutputKind, int, uint, bool, int)"/>
250
/// <seealso cref="CategoricalCatalog.OneHotHashEncoding(TransformsCatalog.CategoricalTransforms, InputOutputColumnPair[],
OneHotEncodingEstimator
.OutputKind, int, uint, bool, int)"/>
260
public const
OneHotEncodingEstimator
.OutputKind OutputKind =
OneHotEncodingEstimator
.OutputKind.Bag;
270
public readonly
OneHotEncodingEstimator
.OutputKind OutputKind;
286
OneHotEncodingEstimator
.OutputKind outputKind = Defaults.OutputKind,
319
OneHotEncodingEstimator
.OutputKind outputKind = Defaults.OutputKind)
336
OneHotEncodingEstimator
.OutputKind kind = columns[i].OutputKind;
341
case
OneHotEncodingEstimator
.OutputKind.Key:
343
case
OneHotEncodingEstimator
.OutputKind.Binary:
348
case
OneHotEncodingEstimator
.OutputKind.Indicator:
351
case
OneHotEncodingEstimator
.OutputKind.Bag: