3 instantiations of KeyToVectorMappingEstimator
Microsoft.ML.Data (3)
Transforms\ConversionsExtensionsCatalog.cs (3)
175
=> new
KeyToVectorMappingEstimator
(CatalogUtils.GetEnvironment(catalog), columns);
195
=> new
KeyToVectorMappingEstimator
(CatalogUtils.GetEnvironment(catalog), outputColumnName, inputColumnName, outputCountVector);
218
return new
KeyToVectorMappingEstimator
(env, columnOptions);
46 references to KeyToVectorMappingEstimator
Microsoft.ML.Data (21)
Transforms\ConversionsExtensionsCatalog.cs (10)
167
/// Create a <see cref="
KeyToVectorMappingEstimator
"/>, which maps the value of a key into a floating point vector representing the value.
173
internal static
KeyToVectorMappingEstimator
MapKeyToVector(this TransformsCatalog.ConversionTransforms catalog,
174
params
KeyToVectorMappingEstimator
.ColumnOptions[] columns)
178
/// Create a <see cref="
KeyToVectorMappingEstimator
"/>, which maps the value of a key into a floating point vector representing the value.
193
public static
KeyToVectorMappingEstimator
MapKeyToVector(this TransformsCatalog.ConversionTransforms catalog,
194
string outputColumnName, string inputColumnName = null, bool outputCountVector =
KeyToVectorMappingEstimator
.Defaults.OutputCountVector)
198
/// Create a <see cref="
KeyToVectorMappingEstimator
"/>, which maps the value of a key into a floating point vector representing the value.
212
public static
KeyToVectorMappingEstimator
MapKeyToVector(this TransformsCatalog.ConversionTransforms catalog,
213
InputOutputColumnPair[] columns, bool outputCountVector =
KeyToVectorMappingEstimator
.Defaults.OutputCountVector)
217
var columnOptions = columns.Select(x => new
KeyToVectorMappingEstimator
.ColumnOptions(x.OutputColumnName, x.InputColumnName, outputCountVector)).ToArray();
Transforms\KeyToVector.cs (11)
34
/// <see cref="ITransformer"/> resulting from fitting a <see cref="
KeyToVectorMappingEstimator
"/>.
93
public bool Bag =
KeyToVectorMappingEstimator
.Defaults.OutputCountVector;
98
internal IReadOnlyCollection<
KeyToVectorMappingEstimator
.ColumnOptions> Columns => _columns.AsReadOnly();
99
private readonly
KeyToVectorMappingEstimator
.ColumnOptions[] _columns;
101
private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(
KeyToVectorMappingEstimator
.ColumnOptions[] columns)
122
internal KeyToVectorMappingTransformer(IHostEnvironment env, params
KeyToVectorMappingEstimator
.ColumnOptions[] columns) :
187
_columns = new
KeyToVectorMappingEstimator
.ColumnOptions[columnsLength];
189
_columns[i] = new
KeyToVectorMappingEstimator
.ColumnOptions(ColumnPairs[i].outputColumnName, ColumnPairs[i].inputColumnName, bags[i]);
200
var cols = new
KeyToVectorMappingEstimator
.ColumnOptions[options.Columns.Length];
205
cols[i] = new
KeyToVectorMappingEstimator
.ColumnOptions(
810
: base(Contracts.CheckRef(env, nameof(env)).Register(nameof(
KeyToVectorMappingEstimator
)), transformer)
Microsoft.ML.EntryPoints (5)
FeatureCombiner.cs (5)
87
private static IDataView ApplyKeyToVec(List<
KeyToVectorMappingEstimator
.ColumnOptions> ktv, IDataView viewTrain, IHost host)
110
viewTrain = new KeyToVectorMappingTransformer(host, ktv.Select(c => new
KeyToVectorMappingEstimator
.ColumnOptions(c.Name, c.Name)).ToArray()).Transform(viewTrain);
152
private static List<
KeyToVectorMappingEstimator
.ColumnOptions> ConvertFeatures(IEnumerable<DataViewSchema.Column> feats, HashSet<string> featNames, List<KeyValuePair<string, string>> concatNames, IChannel ch,
159
List<
KeyToVectorMappingEstimator
.ColumnOptions> ktv = null;
177
Utils.Add(ref ktv, new
KeyToVectorMappingEstimator
.ColumnOptions(colName, col.Name));
Microsoft.ML.Samples (1)
Dynamic\Transforms\Conversion\MapKeyToVectorMultiColumn.cs (1)
34
var
pipeline = mlContext.Transforms.Conversion.MapKeyToVector(new[]{
Microsoft.ML.Tests (17)
Transformers\KeyToVectorEstimatorTests.cs (17)
61
var
pipe = ML.Transforms.Conversion.MapKeyToVector(new
KeyToVectorMappingEstimator
.ColumnOptions("CatA", "TermA", false),
62
new
KeyToVectorMappingEstimator
.ColumnOptions("CatB", "TermB", true),
63
new
KeyToVectorMappingEstimator
.ColumnOptions("CatC", "TermC", true),
64
new
KeyToVectorMappingEstimator
.ColumnOptions("CatCNonBag", "TermC", false));
114
var
pipe = ML.Transforms.Conversion.MapKeyToVector(
115
new
KeyToVectorMappingEstimator
.ColumnOptions("CatA", "TA", true),
116
new
KeyToVectorMappingEstimator
.ColumnOptions("CatB", "TB", false),
117
new
KeyToVectorMappingEstimator
.ColumnOptions("CatC", "TC", false),
118
new
KeyToVectorMappingEstimator
.ColumnOptions("CatD", "TD", true),
119
new
KeyToVectorMappingEstimator
.ColumnOptions("CatE", "TE", false),
120
new
KeyToVectorMappingEstimator
.ColumnOptions("CatF", "TF", true),
121
new
KeyToVectorMappingEstimator
.ColumnOptions("CatG", "TG", true),
122
new
KeyToVectorMappingEstimator
.ColumnOptions("CatH", "TH", false)
214
var
pipe = ML.Transforms.Conversion.MapKeyToVector(
215
new
KeyToVectorMappingEstimator
.ColumnOptions("CatA", "TermA", false),
216
new
KeyToVectorMappingEstimator
.ColumnOptions("CatB", "TermB", true)
Microsoft.ML.Transforms (2)
OneHotEncoding.cs (1)
311
toVector = new KeyToVectorMappingEstimator(_host, cols.Select(x => new
KeyToVectorMappingEstimator
.ColumnOptions(x.outputColumnName, x.inputColumnName, x.bag)).ToArray());
OneHotHashEncoding.cs (1)
361
toVector = new KeyToVectorMappingEstimator(_host, cols.Select(x => new
KeyToVectorMappingEstimator
.ColumnOptions(x.outputColumnName, x.inputColumnName, x.bag)).ToArray());