2 writes to Host
Microsoft.ML.Data (2)
Transforms\TransformBase.cs (2)
33
Host
= env.Register(name);
42
Host
= host;
435 references to Host
Microsoft.ML.Data (255)
DataView\LambdaColumnMapper.cs (11)
111
Host
.Assert(typeDst.RawType == typeof(T3));
112
Host
.AssertValue(map1);
113
Host
.Assert(map2 != null || typeof(T2) == typeof(T3));
127
bldr.AddGetter(AnnotationUtils.Kinds.KeyValues, new VectorDataViewType(TextDataViewType.Instance, _typeDst.GetItemType().GetKeyCountAsInt32(
Host
)), mdGetter);
132
Host
.Assert(vectorSize > 0);
144
Host
.Assert(false, "Shouldn't serialize this!");
145
throw
Host
.ExceptNotSupp("Shouldn't serialize this");
150
Host
.Assert(iinfo == 0);
156
Host
.AssertValueOrNull(ch);
157
Host
.AssertValue(input);
158
Host
.Assert(iinfo == 0);
DataView\LambdaFilter.cs (11)
89
Host
.AssertValue(pred);
90
Host
.Assert(conv != null || typeof(T1) == typeof(T2));
91
Host
.Assert(0 <= colSrc && colSrc < Source.Schema.Count);
100
Host
.Assert(false, "Shouldn't serialize this!");
101
throw
Host
.ExceptNotSupp("Shouldn't serialize this");
106
Host
.AssertValue(predicate);
113
Host
.AssertValueOrNull(rand);
127
Host
.CheckValueOrNull(rand);
134
Host
.AssertNonEmpty(inputs);
145
Host
.AssertValue(predicate);
162
: base(parent.
Host
, input, parent.OutputSchema, active)
DataView\RowToRowMapperTransform.cs (17)
133
Host
.CheckValue(ctx, nameof(ctx));
183
Host
.AssertValue(predicate, "predicate");
194
return new Cursor(
Host
, Source.GetRowCursor(inputCols, rand), this, active);
199
Host
.CheckValueOrNull(rand);
205
Host
.AssertNonEmpty(inputs);
208
inputs = DataViewUtils.CreateSplitCursors(
Host
, inputs[0], n);
209
Host
.AssertNonEmpty(inputs);
213
cursors[i] = new Cursor(
Host
, inputs[i], this, active);
219
Host
.CheckValue(ctx, nameof(ctx));
222
Host
.Check(onnx.CanSaveOnnx(ctx), "Cannot be saved as ONNX.");
229
Host
.CheckValue(ctx, nameof(ctx));
232
Host
.Check(pfa.CanSavePfa, "Cannot be saved as PFA.");
251
Host
.CheckValue(input, nameof(input));
252
Host
.CheckValue(activeColumns, nameof(activeColumns));
253
Host
.Check(input.Schema == Source.Schema, "Schema of input row must be the same as the schema the mapper is bound to");
255
using (var ch =
Host
.Start("GetEntireRow"))
260
Host
.Assert(column.Index < activeArr.Length, $"The columns {activeColumns.Select(c => c.Name)} are not suitable for the OutputSchema.");
Dirty\ChooseColumnsByIndexTransform.cs (9)
200
Host
.CheckValue(options, nameof(options));
208
Host
.AssertValue(ctx);
227
Host
.CheckValue(ctx, nameof(ctx));
240
Host
.AssertValue(predicate);
247
Host
.AssertValueOrNull(rand);
255
return new Cursor(
Host
, _bindings, input, active);
260
Host
.CheckValueOrNull(rand);
269
Host
.AssertNonEmpty(inputs);
274
cursors[i] = new Cursor(
Host
, _bindings, inputs[i], active);
Scorers\BinaryClassifierScorer.cs (8)
186
Host
.CheckValue(ctx, nameof(ctx));
187
Host
.Assert(Bindable is IBindableCanSaveOnnx);
188
Host
.Assert(Bindings.InfoCount >= 2);
193
Host
.Assert(delta == 1);
220
Host
.Assert(predictedLabelCol.HasValue);
234
Host
.AssertValue(output);
235
Host
.Assert(output.Schema == Bindings.RowMapper.OutputSchema);
236
Host
.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
Scorers\ClusteringScorer.cs (1)
103
int keyCount = Bindings.PredColType is KeyDataViewType key ? key.GetCountAsInt32(
Host
) : 0;
Scorers\GenericScorer.cs (17)
157
Host
.CheckValue(args, nameof(args));
158
Host
.AssertValue(data, "data");
159
Host
.AssertValue(mapper, "mapper");
162
Host
.CheckParam(rowMapper != null, nameof(mapper), "mapper should implement ISchemaBoundRowMapper");
212
Host
.CheckValue(ctx, nameof(ctx));
213
Host
.Assert(Bindable is IBindableCanSavePfa);
217
Host
.Assert(_bindings.DerivedColumnCount == 0);
227
Host
.CheckValue(ctx, nameof(ctx));
228
Host
.Assert(Bindable is IBindableCanSaveOnnx);
232
Host
.Assert(_bindings.DerivedColumnCount == 0);
251
Host
.AssertValue(predicate, "predicate");
259
Host
.CheckValue(env, nameof(env));
260
Host
.CheckValue(newSource, nameof(newSource));
267
Host
.Assert(_bindings.DerivedColumnCount == 0);
268
Host
.AssertValue(output);
269
Host
.AssertValue(predicate);
270
Host
.Assert(output.Schema == _bindings.RowMapper.OutputSchema);
Scorers\MulticlassClassificationScorer.cs (6)
564
Host
.AssertValue(output);
565
Host
.Assert(output.Schema == Bindings.RowMapper.OutputSchema);
566
Host
.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
572
int scoreLength = Bindings.PredColType.GetKeyCountAsInt32(
Host
);
578
Host
.Check(score.Length == scoreLength);
589
Host
.Check(score.Length == scoreLength);
Scorers\PredictedLabelScorerBase.cs (26)
287
Host
.CheckValue(args, nameof(args));
288
Host
.CheckNonEmpty(scoreColKind, nameof(scoreColKind));
289
Host
.CheckNonEmpty(scoreColName, nameof(scoreColName));
290
Host
.CheckValue(outputTypeMatches, nameof(outputTypeMatches));
291
Host
.CheckValue(getPredColType, nameof(getPredColType));
294
Host
.CheckParam(rowMapper != null, nameof(mapper), "mapper should implement " + nameof(ISchemaBoundRowMapper));
298
throw
Host
.ExceptParam(nameof(scoreColName), "mapper does not contain a column '{0}'", scoreColName);
301
Host
.Check(outputTypeMatches(scoreType), "Unexpected predictor output type");
321
Host
.AssertValue(ctx);
322
Host
.AssertValue(host);
323
Host
.AssertValue(outputTypeMatches);
324
Host
.AssertValue(getPredColType);
332
Host
.AssertValue(ctx);
338
Host
.CheckValue(ctx, nameof(ctx));
339
Host
.Assert(Bindable is IBindableCanSavePfa);
344
Host
.Assert(delta == 1);
371
Host
.CheckValue(ctx, nameof(ctx));
372
Host
.Assert(Bindable is IBindableCanSaveOnnx);
378
Host
.Assert(delta == 1);
398
Host
.AssertValue(predicate);
406
Host
.Assert(Bindings.DerivedColumnCount == 1);
407
Host
.AssertValue(output);
408
Host
.AssertValue(predicate);
409
Host
.Assert(output.Schema == Bindings.RowMapper.OutputSchema);
410
Host
.Assert(Bindings.InfoCount == output.Schema.Count + 1);
419
Host
.Assert(output.IsColumnActive(output.Schema[Bindings.ScoreColumnIndex]));
Scorers\RowToRowScorerBase.cs (5)
117
Host
.AssertValue(predicate);
139
return new Cursor(
Host
, this, input, active, activeMapperColumns);
144
Host
.CheckValueOrNull(rand);
156
inputs = DataViewUtils.CreateSplitCursors(
Host
, inputs[0], n);
161
cursors[i] = new Cursor(
Host
, this, inputs[i], active, activeMapperColumns);
Transforms\BootstrapSamplingTransformer.cs (8)
81
Host
.CheckValue(options, nameof(options));
82
Host
.CheckUserArg(options.PoolSize >= 0, nameof(options.PoolSize), "Cannot be negative");
85
_state = new TauswortheHybrid.State(options.Seed ?? (uint)
Host
.Rand.Next());
128
Host
.CheckDecode(_poolSize >= 0);
133
Host
.CheckValue(ctx, nameof(ctx));
149
Host
.Assert(_poolSize >= 0);
175
cursor = RowShufflingTransformer.GetShuffledCursor(
Host
, _poolSize, cursor, new TauswortheHybrid(rgen));
196
: base(parent.
Host
, input)
Transforms\GenerateNumberTransform.cs (12)
281
Host
.CheckValue(options, nameof(options));
282
Host
.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns));
290
Host
.AssertValue(ctx);
296
Host
.CheckDecode(cbFloat == sizeof(float));
312
Host
.CheckValue(ctx, nameof(ctx));
329
Host
.AssertValue(predicate, "predicate");
339
Host
.AssertValueOrNull(rand);
347
return new Cursor(
Host
, _bindings, input, active);
352
Host
.CheckValueOrNull(rand);
364
Host
.AssertNonEmpty(inputs);
370
cursors[i] = new Cursor(
Host
, _bindings, inputs[i], active);
378
return new DataViewRowCursor[] { new Cursor(
Host
, _bindings, input, active) };
Transforms\LabelConvertTransform.cs (6)
125
Host
.CheckValue(ctx, nameof(ctx));
132
Host
.AssertNonEmpty(Infos);
185
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
198
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
199
Host
.AssertValue(Infos[iinfo].SlotTypeSrc);
202
return new SlotCursorImpl(
Host
, cursor, GetSlotTypeCore(iinfo));
Transforms\LabelIndicatorTransform.cs (9)
102
Host
.CheckValue(ctx, nameof(ctx));
137
Host
.AssertNonEmpty(Infos);
138
Host
.Assert(Infos.Length == Utils.Size(options.Columns));
150
Host
.AssertValue(ctx);
151
Host
.AssertNonEmpty(Infos);
163
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
170
Host
.AssertValue(ch);
181
Host
.AssertValue(ch);
226
throw
Host
.ExceptNotSupp($"Label column type is not supported for binary remapping: {info.TypeSrc}. Supported types: key, float, double.");
Transforms\NAFilter.cs (21)
96
Host
.CheckValue(args, nameof(args));
97
Host
.CheckValue(input, nameof(input));
98
Host
.CheckUserArg(Utils.Size(args.Columns) > 0, nameof(args.Columns));
99
Host
.CheckValue(env, nameof(env));
110
throw
Host
.ExceptUserArg(nameof(args.Columns), "Source column '{0}' not found", src);
112
throw
Host
.ExceptUserArg(nameof(args.Columns), "Source column '{0}' specified multiple times", src);
116
throw
Host
.ExceptUserArg(nameof(args.Columns), $"Column '{src}' has type {type} which does not support missing values, so we cannot filter on them", src);
126
Host
.CheckValue(ctx, nameof(ctx));
134
Host
.CheckDecode(cbFloat == sizeof(Single) || cbFloat == sizeof(Double));
136
Host
.CheckDecode(cinfo > 0);
146
throw
Host
.ExceptSchemaMismatch(nameof(schema), "source", src);
148
throw
Host
.Except("Source column '{0}' specified multiple times", src);
152
throw
Host
.ExceptSchemaMismatch(nameof(schema), "source", src, "scalar or vector of float, double or KeyType", type.ToString());
171
Host
.CheckValue(ctx, nameof(ctx));
180
Host
.Assert(_infos.Length > 0);
202
Host
.AssertValue(predicate);
209
Host
.AssertValueOrNull(rand);
221
Host
.CheckValueOrNull(rand);
228
Host
.AssertNonEmpty(inputs);
239
Host
.AssertValue(predicate);
387
: base(parent.
Host
, input, parent.OutputSchema, active)
Transforms\RangeFilter.cs (17)
98
Host
.CheckValue(options, nameof(options));
102
throw
Host
.ExceptUserArg(nameof(options.Column), "Source column '{0}' not found", options.Column);
104
using (var ch =
Host
.Start("Checking parameters"))
137
Host
.CheckValue(ctx, nameof(ctx));
147
Host
.CheckDecode(cbFloat == sizeof(float));
152
throw
Host
.ExceptSchemaMismatch(nameof(schema), "source", column);
156
throw
Host
.ExceptSchemaMismatch(nameof(schema), "source", column, "Single, Double or Key", _type.ToString());
161
throw
Host
.Except("min", "min must be less than or equal to max");
179
Host
.CheckValue(ctx, nameof(ctx));
193
Host
.Assert(_min < _max);
203
Host
.AssertValue(predicate);
210
Host
.AssertValueOrNull(rand);
223
Host
.CheckValueOrNull(rand);
230
Host
.AssertNonEmpty(inputs);
245
Host
.Assert(_type is KeyDataViewType);
251
Host
.AssertValue(predicate);
275
: base(parent.
Host
, input, parent.OutputSchema, active)
Transforms\RowShufflingTransformer.cs (12)
113
Host
.CheckValue(options, nameof(options));
115
Host
.CheckUserArg(options.PoolRows > 0, nameof(options.PoolRows), "pool size must be positive");
120
Host
.CheckUserArg(!(_poolOnly && _forceShuffleSource),
124
_forceShuffleSeed = options.ForceShuffleSeed ??
Host
.Rand.NextSigned();
132
Host
.AssertValue(ctx);
142
Host
.CheckDecode(_poolRows > 0);
146
Host
.CheckDecode(!(_poolOnly && _forceShuffleSource));
164
Host
.CheckValue(ctx, nameof(ctx));
247
Host
.AssertValue(predicate, "predicate");
253
Host
.AssertValueOrNull(rand);
287
return new Cursor(
Host
, _poolRows, input, rand);
292
Host
.CheckValueOrNull(rand);
Transforms\SkipTakeFilter.cs (9)
91
Host
.Assert(skip >= 0);
92
Host
.Assert(take >= 0);
171
Host
.CheckValue(ctx, nameof(ctx));
178
Host
.Assert(_skip >= 0);
180
Host
.Assert(_take >= 0);
207
Host
.AssertValue(predicate, "predicate");
213
Host
.AssertValueOrNull(rand);
217
return new Cursor(
Host
, input, OutputSchema, activeColumns, _skip, _take);
222
Host
.CheckValueOrNull(rand);
Transforms\TransformBase.cs (50)
67
Host
.CheckValueOrNull(rand);
80
DataViewUtils.TryCreateConsolidatingCursor(out curs, this, columnsNeeded,
Host
, rng))
149
Host
.CheckValue(ctx, nameof(ctx));
178
Host
.CheckValue(input, nameof(input));
179
Host
.CheckValue(activeColumns, nameof(activeColumns));
180
Host
.Check(input.Schema == Source.Schema, "Schema of input row must be the same as the schema the mapper is bound to");
182
using (var ch =
Host
.Start("GetEntireRow"))
320
Contracts.AssertValue(parent.
Host
);
331
var host = parent.
Host
;
368
var host = parent.
Host
;
469
_parent.Metadata.GetMetadata<TValue>(_parent.
Host
, kind, iinfo, ref value);
502
Host
.CheckUserArg(Utils.Size(column) > 0, nameof(column));
503
Host
.CheckValueOrNull(testType);
516
Host
.CheckUserArg(Utils.Size(column) > 0, nameof(column));
517
Host
.CheckValueOrNull(testType);
530
Host
.CheckValue(ctx, nameof(ctx));
531
Host
.CheckValueOrNull(testType);
547
Host
.CheckValueOrNull(checkType);
569
Host
.CheckValue(ctx, nameof(ctx));
575
Host
.CheckValue(ctx, nameof(ctx));
576
Host
.Assert(((ICanSavePfa)this).CanSavePfa);
605
Host
.CheckValue(ctx, nameof(ctx));
606
Host
.Assert(((ICanSaveOnnx)this).CanSaveOnnx(ctx));
641
Host
.AssertValue(ctx);
642
Host
.Assert(0 <= iinfo && iinfo < _bindings.InfoCount);
643
Host
.Assert(Infos[iinfo] == info);
644
Host
.AssertValue(srcToken);
645
Host
.Assert(((ICanSavePfa)this).CanSavePfa);
662
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
670
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
682
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
696
Host
.AssertValue(input);
697
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
699
Host
.Assert(input.IsColumnActive(input.Schema[src]));
705
Host
.CheckValue(typeDst, nameof(typeDst));
706
Host
.CheckValue(row, nameof(row));
718
Host
.AssertValue(predicate, "predicate");
736
Host
.AssertValueOrNull(rand);
743
return new Cursor(
Host
, this, input, active);
748
Host
.CheckValueOrNull(rand);
754
Host
.AssertNonEmpty(inputs);
757
inputs = DataViewUtils.CreateSplitCursors(
Host
, inputs[0], n);
758
Host
.AssertNonEmpty(inputs);
763
cursors[i] = new Cursor(
Host
, this, inputs[i], active);
773
Host
.Assert(0 <= col && col < _bindings.ColumnCount);
774
return
Host
.ExceptParam(nameof(col), "Bad call to GetSlotCursor on untransposable column '{0}'",
780
Host
.CheckParam(0 <= col && col < _bindings.ColumnCount, nameof(col));
806
Host
.Assert(false);
807
throw
Host
.ExceptNotImpl("Data view indicated it could transpose a column, but apparently it could not");
830
using (var ch =
Host
.Start("CreateGetters"))
Microsoft.ML.TimeSeries (77)
ExponentialAverageTransform.cs (6)
63
Host
.CheckUserArg(0 <= args.Decay && args.Decay <= 1, nameof(args.Decay), "Should be in [0, 1].");
76
Host
.CheckDecode(0 <= _decay && _decay <= 1);
77
Host
.CheckDecode(WindowSize == 1);
82
Host
.CheckValue(ctx, nameof(ctx));
83
Host
.Assert(WindowSize >= 1);
84
Host
.Assert(0 <= _decay && _decay <= 1);
MovingAverageTransform.cs (10)
71
Host
.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "Should be at least 1.");
72
Host
.CheckUserArg(args.Lag >= 0, nameof(args.Lag), "Should be positive.");
73
Host
.CheckUserArg(args.Lag != 0 || args.WindowSize > 1, nameof(args.Lag),
77
throw
Host
.ExceptUserArg(nameof(args.Weights), string.Format("{0} weights are provided, but {1} are expected (or none)'", Utils.Size(_weights), args.WindowSize));
92
Host
.CheckDecode(WindowSize >= 1);
93
Host
.CheckDecode(_weights == null || Utils.Size(_weights) == WindowSize + 1 - _lag);
98
Host
.CheckValue(ctx, nameof(ctx));
99
Host
.Assert(WindowSize >= 1);
100
Host
.Assert(_lag >= 0);
111
Host
.Assert(_weights == null || Utils.Size(_weights) == WindowSize + 1 - _lag);
PercentileThresholdTransform.cs (7)
70
Host
.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "The size of the sliding window should be at least 1.");
71
Host
.CheckUserArg(MinPercentile <= args.Percentile && args.Percentile <= MaxPercentile, nameof(args.Percentile), "The percentile value should be in [0, 100].");
83
Host
.CheckDecode(WindowSize >= 1);
84
Host
.CheckDecode(MinPercentile <= _percentile && _percentile <= MaxPercentile);
89
Host
.CheckValue(ctx, nameof(ctx));
90
Host
.Assert(MinPercentile <= _percentile && _percentile <= MaxPercentile);
91
Host
.Assert(WindowSize >= 1);
PValueTransform.cs (4)
75
Host
.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "The size of the sliding window should be at least 1.");
89
Host
.CheckDecode(WindowSize >= 1);
94
Host
.CheckValue(ctx, nameof(ctx));
95
Host
.Assert(WindowSize >= 1);
SequentialTransformBase.cs (19)
278
Contracts.AssertValue(
Host
);
279
Host
.CheckParam(initialWindowSize >= 0, nameof(initialWindowSize), "Must be non-negative.");
280
Host
.CheckParam(windowSize >= 0, nameof(windowSize), "Must be non-negative.");
283
Host
.CheckNonEmpty(inputColumnName, nameof(PercentileThresholdTransform.Arguments.Source));
284
Host
.CheckNonEmpty(outputColumnName, nameof(PercentileThresholdTransform.Arguments.Source));
291
_transform = CreateLambdaTransform(
Host
, input, OutputColumnName, InputColumnName, InitFunction, WindowSize > 0, outputColTypeOverride);
297
Host
.CheckValue(ctx, nameof(ctx));
307
Host
.CheckDecode(windowSize >= 0);
310
Host
.CheckDecode(initialWindowSize >= 0);
320
BinarySaver bs = new BinarySaver(
Host
, new BinarySaver.Arguments());
323
_transform = CreateLambdaTransform(
Host
, input, OutputColumnName, InputColumnName, InitFunction, WindowSize > 0, ct);
328
Host
.CheckValue(ctx, nameof(ctx));
329
Host
.Assert(InitialWindowSize >= 0);
330
Host
.Assert(WindowSize >= 0);
345
BinarySaver bs = new BinarySaver(
Host
, new BinarySaver.Arguments());
349
throw
Host
.ExceptSchemaMismatch(nameof(_transform.Schema), "output", OutputColumnName);
366
state.InitState(WindowSize, InitialWindowSize, this,
Host
);
373
Host
.AssertValue(predicate);
401
: base(parent.
Host
, input)
SequentialTransformerBase.cs (18)
570
return new Cursor(
Host
, clone, srcCursor);
575
Host
.AssertValue(predicate);
795
Host
.CheckValue(ctx, nameof(ctx));
860
Host
.AssertValue(predicate, "predicate");
872
return new Cursor(
Host
, Source.GetRowCursor(inputCols, rand), this, active);
877
Host
.CheckValueOrNull(rand);
885
Host
.AssertNonEmpty(inputs);
888
inputs = DataViewUtils.CreateSplitCursors(
Host
, inputs[0], n);
889
Host
.AssertNonEmpty(inputs);
893
cursors[i] = new Cursor(
Host
, inputs[i], this, active);
899
Host
.CheckValue(ctx, nameof(ctx));
902
Host
.Check(onnx.CanSaveOnnx(ctx), "Cannot be saved as ONNX.");
909
Host
.CheckValue(ctx, nameof(ctx));
912
Host
.Check(pfa.CanSavePfa, "Cannot be saved as PFA.");
930
Host
.CheckValue(input, nameof(input));
931
Host
.CheckValue(activeColumns, nameof(activeColumns));
932
Host
.Check(input.Schema == Source.Schema, "Schema of input row must be the same as the schema the mapper is bound to");
934
using (var ch =
Host
.Start("GetEntireRow"))
SlidingWindowTransform.cs (1)
53
Host
.CheckValue(ctx, nameof(ctx));
SlidingWindowTransformBase.cs (12)
66
Host
.CheckUserArg(args.WindowSize >= 1, nameof(args.WindowSize), "Must be at least 1.");
67
Host
.CheckUserArg(args.Lag >= 0, nameof(args.Lag), "Must be positive.");
70
Host
.Assert(args.WindowSize == 1);
71
throw
Host
.ExceptUserArg(nameof(args.Lag),
74
Host
.CheckUserArg(Enum.IsDefined(typeof(BeginOptions), args.Begin), nameof(args.Begin), "Undefined value.");
88
Host
.CheckDecode(WindowSize >= 1);
90
Host
.CheckDecode(_lag >= 0);
92
Host
.CheckDecode(Enum.IsDefined(typeof(BeginOptions), r));
111
Host
.CheckValue(ctx, nameof(ctx));
112
Host
.Assert(WindowSize >= 1);
113
Host
.Assert(_lag >= 0);
114
Host
.Assert(Enum.IsDefined(typeof(BeginOptions), _begin));
Microsoft.ML.Transforms (103)
GroupTransform.cs (9)
113
Host
.CheckValue(options, nameof(options));
114
Host
.CheckUserArg(Utils.Size(options.GroupKeys) > 0, nameof(options.GroupKeys), "There must be at least one group key");
116
_groupBinding = new GroupBinding(
Host
, Source.Schema, options.GroupKeys, options.Columns ?? new string[0]);
132
Host
.AssertValue(ctx);
141
Host
.CheckValue(ctx, nameof(ctx));
160
Host
.CheckValueOrNull(rand);
168
Host
.AssertValue(predicate);
176
Host
.CheckValueOrNull(rand);
516
: base(parent.
Host
)
HashJoiningTransform.cs (34)
201
Host
.AssertNonEmpty(Infos);
202
Host
.Assert(Infos.Length == Utils.Size(args.Columns));
205
throw
Host
.ExceptUserArg(nameof(args.NumberOfBits), "numberOfBits should be between {0} and {1} inclusive", NumBitsMin, NumBitsLim - 1);
211
Host
.CheckUserArg(NumBitsMin <= numberOfBits && numberOfBits < NumBitsLim, nameof(args.NumberOfBits));
227
Host
.AssertValue(ctx);
239
Host
.AssertNonEmpty(Infos);
245
Host
.CheckDecode(NumBitsMin <= numberOfBits && numberOfBits < NumBitsLim);
251
Host
.CheckDecode(slotMapCount >= 0);
256
Host
.CheckDecode(Infos[i].TypeSrc is VectorDataViewType);
262
Host
.CheckDecode(Utils.Size(slotMap[j]) > 0); // null array could be returned by the call above
265
Host
.CheckDecode(slotMap[j].Distinct().Count() == slotMap[j].Length);
266
Host
.CheckDecode(
291
Host
.CheckValue(ctx, nameof(ctx));
311
Host
.Assert(NumBitsMin <= ex.NumberOfBits && ex.NumberOfBits < NumBitsLim);
323
Host
.Assert(ex.SlotMap[i].Distinct().Count() == ex.SlotMap[i].Length);
324
Host
.Assert(ex.SlotMap[i].All(slot => 0 <= slot && slot < Infos[iColumn].TypeSrc.GetValueCount()));
340
Host
.Assert(Utils.Size(slotMap) >= 1);
359
throw
Host
.Except("Unexpected slot index '{1}' in group {0}. Expected 0 to {2}", i, slotIndices[j], srcSlotCount - 1);
364
throw
Host
.Except("Group '{0}' has duplicate slot indices", parts[i]);
411
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
413
Host
.AssertValue(_exes[iinfo].SlotMap);
468
Host
.AssertValueOrNull(ch);
469
Host
.AssertValue(input);
470
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
504
Host
.AssertValue(input);
505
Host
.Assert(!(Infos[iinfo].TypeSrc is VectorDataViewType));
528
Host
.AssertValue(input);
530
Host
.Assert(srcType != null);
547
Host
.Check(src.Length == expectedSrcLength);
576
Host
.AssertValue(input);
578
Host
.Assert(srcType != null);
579
Host
.Assert(Utils.Size(_exes[iinfo].SlotMap) == 1);
595
Host
.Check(src.Length == expectedSrcLength);
655
Host
.Assert(iinfo >= 0 && iinfo < _exes.Length);
MissingValueIndicatorTransform.cs (20)
79
Host
.AssertNonEmpty(Infos);
80
Host
.Assert(Infos.Length == Utils.Size(args.Columns));
88
Host
.AssertValue(ctx);
93
Host
.AssertNonEmpty(Infos);
119
Host
.CheckValue(ctx, nameof(ctx));
139
Host
.Check(type.GetValueCount() < int.MaxValue / 2);
171
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
177
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
188
Host
.Assert(_types[iinfo].Size == 2);
195
Host
.Assert(srcVectorType.IsKnownSize);
196
Host
.Assert(size == 2 * srcVectorType.Size);
209
Host
.Check(names.Length == srcVectorType.Size, "Unexpected slot name vector size");
215
Host
.Assert(0 <= slot && slot < size);
216
Host
.Assert(slot % 2 == 0);
231
Host
.Assert(slot == size);
239
Host
.AssertValueOrNull(ch);
240
Host
.AssertValue(input);
241
Host
.Assert(0 <= iinfo && iinfo < Infos.Length);
252
FillValues(
Host
, ref dst);
264
Host
.Assert(dst.Length == 2);
OptionalColumnTransform.cs (16)
198
_metadata.GetMetadata(_parent.
Host
, kind, iinfo, ref value);
278
Host
.CheckValue(args, nameof(args));
279
Host
.CheckUserArg(Utils.Size(args.Columns) > 0, nameof(args.Columns));
287
Host
.AssertValue(ctx);
306
Host
.CheckValue(ctx, nameof(ctx));
312
_bindings.Save(
Host
, ctx);
319
Host
.AssertValue(predicate, "predicate");
325
Host
.AssertValueOrNull(rand);
333
return new Cursor(
Host
, _bindings, input, active);
338
Host
.CheckValueOrNull(rand);
350
Host
.AssertNonEmpty(inputs);
356
cursors[i] = new Cursor(
Host
, _bindings, inputs[i], active);
364
return new DataViewRowCursor[] { new Cursor(
Host
, _bindings, input, active) };
387
using (var ch =
Host
.Start("CreateGetters"))
519
Host
.CheckValue(ctx, nameof(ctx));
520
Host
.Assert(((ICanSaveOnnx)this).CanSaveOnnx(ctx));
ProduceIdTransform.cs (9)
103
Host
.CheckValue(args, nameof(args));
104
Host
.CheckNonWhiteSpace(args.Column, nameof(args.Column));
112
Host
.AssertValue(ctx);
131
Host
.CheckValue(ctx, nameof(ctx));
142
Host
.AssertValueOrNull(rand);
150
return new Cursor(
Host
, _bindings, input, active);
155
Host
.CheckValueOrNull(rand);
163
cursors[c] = new Cursor(
Host
, _bindings, cursors[c], active);
169
Host
.AssertValue(predicate, "predicate");
StatefulCustomMappingTransformer.cs (7)
116
Host
.CheckValue(parent, nameof(parent));
120
var dstRow = new DataViewConstructionUtils.InputRow<TDst>(
Host
, _parent.AddedSchema);
126
_typedSrc = TypedCursorable<TSrc>.Create(
Host
, input, false, null);
141
Host
.AssertNonEmpty(inputs);
163
var dstRow = new DataViewConstructionUtils.InputRow<TDst>(
Host
, _parent.AddedSchema);
273
: base(parent.
Host
, input)
282
var dstRow = new DataViewConstructionUtils.InputRow<TDst>(_parent.
Host
, _parent._parent.AddedSchema);
UngroupTransform.cs (8)
112
Host
.CheckValue(options, nameof(options));
113
Host
.CheckUserArg(Utils.Size(options.Columns) > 0, nameof(options.Columns), "There must be at least one pivot column");
114
Host
.CheckUserArg(options.Columns.Distinct().Count() == options.Columns.Length, nameof(options.Columns),
117
_ungroupBinding = new UngroupBinding(
Host
, Source.Schema, options.Mode, options.Columns);
133
Host
.AssertValue(ctx);
142
Host
.CheckValue(ctx, nameof(ctx));
187
return new Cursor(
Host
, inputCursor, _ungroupBinding, predicate);
199
x => new Cursor(
Host
, inputCursors[x], _ungroupBinding, predicate));