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