1 write to _host
Microsoft.ML.Transforms (1)
Dracula\CountTableTransformer.cs (1)
121
_host
= env.Register(nameof(CountTableEstimator));
22 references to _host
Microsoft.ML.Transforms (22)
Dracula\CountTableTransformer.cs (22)
122
_host
.CheckParam(columns.All(col => col.PriorCoefficient > 0), nameof(ColumnOptionsBase.PriorCoefficient), "Must be greater than zero");
123
_host
.CheckParam(columns.All(col => col.LaplaceScale >= 0), nameof(ColumnOptionsBase.LaplaceScale), "Must be greater than or equal to zero.");
133
throw
_host
.ExceptUserArg(nameof(_labelColumnName), "Label column '{0}' not found", _labelColumnName);
138
var labelClassNames = InitLabelClassNames(
_host
, labelCol.GetValueOrDefault(), labelCardinality);
147
throw
_host
.Except($"Could not find column {_columns[i].InputColumnName} in input schema");
151
_host
.Assert(_initialCounts != null || _sharedBuilder != null || _builders != null);
154
multiBuilder = _initialCounts.Featurizer.MultiCountTable.ToBuilder(
_host
, inputColumns, labelCardinality);
156
multiBuilder = new ParallelMultiCountTableBuilder(
_host
, inputColumns, _builders, labelCardinality);
158
multiBuilder = new BagMultiCountTableBuilder(
_host
, inputColumns, _sharedBuilder, labelCardinality);
164
_host
.Assert(col.HasValue);
172
var featurizer = new CountTargetEncodingFeaturizer(
_host
, _columns.Select(col => col.PriorCoefficient).ToArray(), _columns.Select(col => col.LaplaceScale).ToArray(), labelCardinality, multiCountTable);
174
return new CountTableTransformer(
_host
, featurizer, labelClassNames,
209
_host
.Check(srcBuffer.Length == cols[i].Type.GetVectorSize(), "value count mismatch");
226
_host
.Assert(type is KeyDataViewType || type is NumberDataViewType || type is BooleanDataViewType);
244
_host
.Assert(type.GetKeyCount() > 0);
298
_host
.Assert(data.Schema.Label.HasValue);
305
_host
.CheckUserArg(labelCardinality > 1, nameof(_labelColumnName), "Label column type must have known cardinality more than 1");
322
_host
.CheckValue(inputSchema, nameof(inputSchema));
326
throw
_host
.ExceptSchemaMismatch(nameof(inputSchema), "label", _labelColumnName);
331
throw
_host
.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName);
333
throw
_host
.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName, "known-size vector or scalar", col.GetTypeString());
336
throw
_host
.ExceptSchemaMismatch(nameof(inputSchema), "input", colInfo.InputColumnName, "vector or scalar of U4 key type", col.GetTypeString());