3 instantiations of HashingEstimator
Microsoft.ML.Data (3)
DataLoadSave\DataOperationsCatalog.cs (1)
574data = new HashingEstimator(env, columnOptions).Fit(data).Transform(data);
Transforms\ConversionsExtensionsCatalog.cs (2)
47=> new HashingEstimator(CatalogUtils.GetEnvironment(catalog), outputColumnName, inputColumnName, numberOfBits, maximumNumberOfInverts); 66=> new HashingEstimator(CatalogUtils.GetEnvironment(catalog), columns);
106 references to HashingEstimator
Microsoft.ML.Data (43)
DataLoadSave\DataOperationsCatalog.cs (2)
572new HashingEstimator.ColumnOptions(splitColumnName, hashInputColumnName, 30, (uint)seedToUse.Value, combine: true) : 573new HashingEstimator.ColumnOptions(splitColumnName, hashInputColumnName, 30, combine: true);
Transforms\ConversionsExtensionsCatalog.cs (6)
13using static Microsoft.ML.Transforms.HashingEstimator; 15using HashDefaults = HashingEstimator.Defaults; 23/// Create a <see cref="HashingEstimator"/>, which hashes the data from the column specified in <paramref name="inputColumnName"/> 45public static HashingEstimator Hash(this TransformsCatalog.ConversionTransforms catalog, string outputColumnName, string inputColumnName = null, 50/// Create a <see cref="HashingEstimator"/>, which hashes the input column's data type <see cref="ColumnOptions.InputColumnName" /> 65public static HashingEstimator Hash(this TransformsCatalog.ConversionTransforms catalog, params ColumnOptions[] columns)
Transforms\Hashing.cs (35)
33/// <see cref="ITransformer"/> resulting from fitting a <see cref="HashingEstimator"/>. 45public int NumberOfBits = HashingEstimator.Defaults.NumberOfBits; 48public uint Seed = HashingEstimator.Defaults.Seed; 52public bool Ordered = HashingEstimator.Defaults.UseOrderedHashing; 56public int MaximumNumberOfInverts = HashingEstimator.Defaults.MaximumNumberOfInverts; 59public bool Combine = HashingEstimator.Defaults.Combine; 141private readonly HashingEstimator.ColumnOptions[] _columns; 143internal IReadOnlyCollection<HashingEstimator.ColumnOptions> Columns => _columns; 151if (!HashingEstimator.IsColumnTypeValid(type)) 152throw Host.ExceptParam(nameof(inputSchema), HashingEstimator.ExpectedColumnType); 155private static (string outputColumnName, string inputColumnName)[] GetColumnPairs(HashingEstimator.ColumnOptions[] columns) 161private DataViewType GetOutputType(DataViewSchema inputSchema, HashingEstimator.ColumnOptions column) 178internal HashingTransformer(IHostEnvironment env, params HashingEstimator.ColumnOptions[] columns) : 185throw Host.ExceptParam(nameof(columns), $"Found column with {nameof(column.MaximumNumberOfInverts)} set to non zero value, please use {nameof(HashingEstimator)} instead"); 188throw Host.ExceptParam(nameof(HashingEstimator.ColumnOptions.Combine), "When the 'Combine' option is specified, ordered hashing is not supported."); 192internal HashingTransformer(IHostEnvironment env, IDataView input, params HashingEstimator.ColumnOptions[] columns) : 292_columns = new HashingEstimator.ColumnOptions[columnsLength]; 295_columns[i] = new HashingEstimator.ColumnOptions(ColumnPairs[i].outputColumnName, ColumnPairs[i].inputColumnName, ctx); 334var cols = new HashingEstimator.ColumnOptions[options.Columns.Length]; 338cols[i] = new HashingEstimator.ColumnOptions( 352Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 404Host.Assert(HashingEstimator.IsColumnTypeValid(srcType.ItemType)); 466Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 1483private readonly HashingEstimator.ColumnOptions _ex; 1487private InvertHashHelper(DataViewRow row, HashingEstimator.ColumnOptions ex) 1508public static InvertHashHelper Create(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter) 1519var consTypes = new Type[] { typeof(DataViewRow), typeof(HashingEstimator.ColumnOptions), typeof(int), typeof(Delegate) }; 1596protected Impl(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount) 1629public ImplOne(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter) 1663public ImplVec(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter) 1697public ImplVecOrdered(DataViewRow row, HashingEstimator.ColumnOptions ex, int invertHashMaxCount, Delegate dstGetter) 1763/// <seealso cref="ConversionsExtensionsCatalog.Hash(TransformsCatalog.ConversionTransforms, HashingEstimator.ColumnOptions[])"/> 1901/// Initializes a new instance of <see cref="HashingEstimator"/>. 1923/// Initializes a new instance of <see cref="HashingEstimator"/>. 1931_host = env.Register(nameof(HashingEstimator));
Microsoft.ML.IntegrationTests (1)
DataTransformation.cs (1)
12using static Microsoft.ML.Transforms.HashingEstimator;
Microsoft.ML.PerformanceTests (1)
HashBench.cs (1)
86var info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: numberOfBits);
Microsoft.ML.Samples (3)
Dynamic\Transforms\Conversion\HashWithOptions.cs (3)
45var pipeline = mlContext.Transforms.Conversion.Hash( 48new HashingEstimator.ColumnOptions( 55new HashingEstimator.ColumnOptions(
Microsoft.ML.TestFramework (2)
DataPipe\TestDataPipe.cs (2)
1116var hashTransform = new HashingTransformer(Env, new HashingEstimator.ColumnOptions("F1", "F1", 5, 42)).Transform(srcView); 1147var hashTransform = new HashingTransformer(Env, new HashingEstimator.ColumnOptions("F1V", "F1V", 5, 42)).Transform(srcView);
Microsoft.ML.Tests (29)
OnnxConversionTest.cs (3)
1042var pipeline = ML.Transforms.Conversion.Hash("ValueHashed", "Value"); 1078var pipeline = new HashingEstimator(Env, "Value", useOrderedHashing: useOrderedHashing, numberOfBits: numberOfBits); 1129var pipeline = new HashingEstimator(Env, "Value", useOrderedHashing: false, numberOfBits: numberOfBits);
Transformers\HashTests.cs (26)
51var pipe = ML.Transforms.Conversion.Hash(new[]{ 52new HashingEstimator.ColumnOptions("HashA", "A", numberOfBits:4, maximumNumberOfInverts:-1), 53new HashingEstimator.ColumnOptions("HashB", "B", numberOfBits:3, useOrderedHashing:true), 54new HashingEstimator.ColumnOptions("HashC", "C", seed:42), 55new HashingEstimator.ColumnOptions("HashD", "A"), 73var pipe = ML.Transforms.Conversion.Hash(new[] { 74new HashingEstimator.ColumnOptions("HashA", "A", maximumNumberOfInverts:1, numberOfBits:10), 75new HashingEstimator.ColumnOptions("HashAUnlim", "A", maximumNumberOfInverts:-1, numberOfBits:10), 76new HashingEstimator.ColumnOptions("HashAUnlimOrdered", "A", maximumNumberOfInverts:-1, numberOfBits:10, useOrderedHashing:true) 113var pipe = ML.Transforms.Conversion.Hash(new[]{ 114new HashingEstimator.ColumnOptions("HashA", "A", numberOfBits:4, maximumNumberOfInverts:-1), 115new HashingEstimator.ColumnOptions("HashB", "B", numberOfBits:3, useOrderedHashing:true), 116new HashingEstimator.ColumnOptions("HashC", "C", seed:42), 117new HashingEstimator.ColumnOptions("HashD" ,"A"), 138ValueGetter<TType> hashGetter<TType>(HashingEstimator.ColumnOptions colInfo) 149var info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits); 156info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, useOrderedHashing: true); 169info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, useOrderedHashing: false); 179info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, useOrderedHashing: true); 189info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, combine: true); 200info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, useOrderedHashing: false); 209info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, useOrderedHashing: true); 217info = new HashingEstimator.ColumnOptions("Bar", "Foo", numberOfBits: bits, combine: true); 385new HashingEstimator.ColumnOptions("AHashed", "A"), 386new HashingEstimator.ColumnOptions("DHashed", "D"), 387new HashingEstimator.ColumnOptions("DHashedCombined", "D", combine: true)));
Microsoft.ML.Transforms (27)
Dracula\CountTargetEncodingTransformer.cs (21)
86public int NumberOfBits = HashingEstimator.NumBitsLim - 1; 119private readonly HashingEstimator.ColumnOptions[] _hashingColumns; 120private readonly HashingEstimator _hashingEstimator; 124int numberOfBits = HashingEstimator.Defaults.NumberOfBits, 125bool combine = HashingEstimator.Defaults.Combine, uint hashingSeed = HashingEstimator.Defaults.Seed) 133CountTableBuilderBase countTableBuilder, int numberOfBits = HashingEstimator.Defaults.NumberOfBits, 134bool combine = HashingEstimator.Defaults.Combine, uint hashingSeed = HashingEstimator.Defaults.Seed) 250private HashingEstimator.ColumnOptions[] InitializeHashingColumnOptions(CountTableEstimator.ColumnOptionsBase[] columns, int numberOfBits, bool combine, uint hashingSeed) 252var cols = new HashingEstimator.ColumnOptions[columns.Length]; 256cols[i] = new HashingEstimator.ColumnOptions(column.Name, column.InputColumnName, 262private HashingEstimator.ColumnOptions[] InitializeHashingColumnOptions(Options options) 265var cols = new HashingEstimator.ColumnOptions[columns.Length]; 269cols[i] = new HashingEstimator.ColumnOptions(column.Name, column.Source, 437int numberOfBits = HashingEstimator.Defaults.NumberOfBits, 438bool combine = HashingEstimator.Defaults.Combine, 439uint hashingSeed = HashingEstimator.Defaults.Seed) 506int numberOfBits = HashingEstimator.Defaults.NumberOfBits, 507bool combine = HashingEstimator.Defaults.Combine, 508uint hashingSeed = HashingEstimator.Defaults.Seed)
OneHotHashEncoding.cs (4)
169internal OneHotHashEncodingTransformer(HashingEstimator hash, IEstimator<ITransformer> keyToVector, IDataView input) 269public readonly HashingEstimator.ColumnOptions HashingOptions; 292HashingOptions = new HashingEstimator.ColumnOptions(name, inputColumnName ?? name, numberOfBits, seed, useOrderedHashing, maximumNumberOfInverts); 299private readonly HashingEstimator _hash;
Text\WordHashBagProducingTransform.cs (2)
335var hashColumns = new List<HashingEstimator.ColumnOptions>(); 356hashColumns.Add(new HashingEstimator.ColumnOptions(tmpName, column.Source[isrc],