1 write to Host
Microsoft.ML.Data (1)
Transforms\RowToRowTransformerBase.cs (1)
22Host = host;
105 references to Host
Microsoft.ML.Data (105)
Prediction\CalibratorCatalog.cs (2)
250base(parent.Host, inputSchema, parent) 258parent.Host.Check(_scoreColIndex >= 0, "The data to calibrate contains no \'" + scoreColumnName + "\' column.");
Transforms\ColumnConcatenatingTransformer.cs (2)
265Host.CheckValue(ctx, nameof(ctx)); 286Host.CheckValue(ctx, nameof(ctx));
Transforms\ColumnCopying.cs (1)
207: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\FeatureContributionCalculationTransformer.cs (8)
92Host.CheckValue(modelParameters, nameof(modelParameters)); 93Host.CheckNonEmpty(featureColumnName, nameof(featureColumnName)); 95throw Host.Except($"Number of top contribution must be non negative"); 97throw Host.Except($"Number of bottom contribution must be non negative"); 102Host.AssertValue(_predictor); 112Host.AssertValue(ctx); 131Host.CheckValue(ctx, nameof(ctx)); 176: base(parent.Host, parent, schema)
Transforms\Hashing.cs (26)
152throw Host.ExceptParam(nameof(inputSchema), HashingEstimator.ExpectedColumnType); 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."); 204throw Host.ExceptSchemaMismatch(nameof(input), "input", ColumnPairs[i].inputColumnName); 229using (var ch = Host.Start("Invert hash building")) 236Host.Assert(types[iinfo].GetItemType().GetKeyCount() > 0); 238Host.Assert(disposer == null); 253Host.Assert(_keyValues[invertIinfos[i]].Length == types[invertIinfos[i]].GetItemType().GetKeyCountAsInt32(Host)); 263Host.AssertValue(input); 264Host.Assert(0 <= iinfo && iinfo < _columns.Length); 296TextModelHelper.LoadAll(Host, ctx, columnsLength, out _keyValues, out _kvTypes); 301Host.CheckValue(ctx, nameof(ctx)); 311Host.Assert(_columns.Length == ColumnPairs.Length); 315TextModelHelper.SaveAll(Host, ctx, _columns.Length, _keyValues); 352Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 369Host.Assert(srcType.RawType == typeof(byte)); 398Host.Assert(srcType.RawType == typeof(bool)); 404Host.Assert(HashingEstimator.IsColumnTypeValid(srcType.ItemType)); 416Host.Assert(rawType == typeof(ulong)); 445Host.Assert(srcType.ItemType == TextDataViewType.Instance); 452Host.Assert(srcType.ItemType.RawType == typeof(T)); 466Host.Assert(HashingEstimator.IsColumnTypeValid(srcType)); 481Host.Assert(rawType == typeof(byte)); 510Host.Assert(rawType == typeof(bool)); 1317: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\KeyToValue.cs (2)
144Host.CheckValue(ctx, nameof(ctx)); 163: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\KeyToVector.cs (4)
119throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, reason, type.ToString()); 146Host.CheckValue(ctx, nameof(ctx)); 155Host.Assert(_columns.Length == ColumnPairs.Length); 244: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\Normalizer.cs (8)
627ctx.LoadModel<IColumnFunction, SignatureLoadColumnFunction>(Host, out var function, dir, Host, typeSrc); 648ctx.LoadModel<IColumnFunction, SignatureLoadColumnFunction>(Host, out var function, dir, Host, typeSrc); 681Host.CheckValue(ctx, nameof(ctx)); 708throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, expectedType, "variable-size vector"); 711throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName, expectedType, colType.ToString()); 728: base(parent.Host.Register(nameof(Mapper)), parent, schema)
Transforms\OneToOneTransformerBase.cs (2)
58Host.CheckValue(ctx, nameof(ctx)); 80throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[col].inputColumnName);
Transforms\RowToRowTransformerBase.cs (6)
33Host.CheckValue(inputSchema, nameof(inputSchema)); 34return new RowToRowMapperTransform(Host, new EmptyDataView(Host, inputSchema), MakeRowMapper(inputSchema), MakeRowMapper); 42Host.CheckValue(inputSchema, nameof(inputSchema)); 52Host.CheckValue(input, nameof(input)); 53return new RowToRowMapperTransform(Host, input, MakeRowMapper(input.Schema), MakeRowMapper);
Transforms\SlotsDroppingTransformer.cs (11)
277Host.AssertNonEmpty(ColumnPairs); 279Host.CheckUserArg(AreRangesValid(SlotsMin, SlotsMax), nameof(columns), "The range min and max must be non-negative and min must be less than or equal to max."); 285Host.AssertValue(ctx); 292Host.AssertNonEmpty(ColumnPairs); 299Host.CheckDecode(Utils.Size(SlotsMin[i]) > 0); 302Host.Assert(AreRangesValid(SlotsMin, SlotsMax)); 330Host.CheckValue(ctx, nameof(ctx)); 342Host.Assert(AreRangesValid(SlotsMin, SlotsMax)); 345Host.Assert(SlotsMin[i].Length == SlotsMax[i].Length); 358Host.CheckUserArg(range.IsValid(), nameof(col.Slots), "The range min and max must be non-negative and min must be less than or equal to max."); 470: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\TypeConverting.cs (7)
208Host.CheckValue(ctx, nameof(ctx)); 222Host.Assert((InternalDataKind)(byte)_columns[i].OutputKind.ToInternalDataKind() == _columns[i].OutputKind.ToInternalDataKind()); 266Host.CheckDecode(Enum.IsDefined(typeof(InternalDataKind), kind)); 276Host.CheckDecode(min == 0); 281Host.CheckDecode(contiguous); 286Host.CheckDecode(0 < count); 393: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)
Transforms\ValueMapping.cs (13)
438_dataView = GetBytesFromDataView(Host, lookupMap, lookupKeyColumn.Name, lookupValueColumn.Name); 447Host.Check(column.HasValue, "The selected column " + nameof(keyColumn) + " is not included in the targeted IDataView " + nameof(dataView)); 449Host.Check(retrievedKeyColumn.Index == keyColumn.Index, nameof(keyColumn) + "'s column index doesn't match that of the associated column in " + nameof(dataView)); 450Host.Check(retrievedKeyColumn.Type == keyColumn.Type, nameof(keyColumn) + "'s column type doesn't match that of the associated column in " + nameof(dataView)); 451Host.Check(retrievedKeyColumn.Annotations == keyColumn.Annotations, nameof(keyColumn) + "'s column annotations don't match those of the associated column in " + nameof(dataView)); 455Host.Check(column.HasValue, "The selected column " + nameof(valueColumn) + " is not included in the targeted IDataView " + nameof(dataView)); 457Host.Check(retrievedValueColumn.Index == valueColumn.Index, nameof(valueColumn) + "'s column index doesn't match that of the associated column in " + nameof(dataView)); 458Host.Check(retrievedValueColumn.Type == valueColumn.Type, nameof(valueColumn) + "'s column type doesn't match that of the associated column in " + nameof(dataView)); 459Host.Check(retrievedValueColumn.Annotations == valueColumn.Annotations, nameof(valueColumn) + "'s column annotations don't match those of the associated column in " + nameof(dataView)); 464valueMap.Train(Host, cursor); 785Host.CheckValue(ctx, nameof(ctx)); 1040: base(transform.Host.Register(nameof(Mapper)), transform, inputSchema) 1284throw _parent.Host.ExceptNotSupp("Column '{0}' cannot be mapped to values when the column and the map values are both vector type.", _columns[i].inputColumnName);
Transforms\ValueToKeyMappingTransformer.cs (13)
190Interlocked.CompareExchange(ref _codecFactory, new CodecFactory(Host, _codecFactoryPool), null); 192Host.Assert(_codecFactory != null); 230Host.AssertValue(inputSchema); 235throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[i].inputColumnName); 239throw Host.ExceptSchemaMismatch(nameof(inputSchema), "input", ColumnPairs[i].inputColumnName, reason, type.ToString()); 254using (var ch = Host.Start("Training")) 257_unboundMaps = Train(Host, ch, infos, keyData, columns, input, autoConvert); 654Host.CheckValue(ctx, nameof(ctx)); 661Host.Assert(_unboundMaps.Length == _textMetadata.Length); 662Host.Assert(_textMetadata.Length == ColumnPairs.Length); 676Host.CheckValue(c, nameof(ctx)); 681term.Save(c, Host, CodecFactory); 717: base(parent.Host.Register(nameof(Mapper)), parent, inputSchema)