1 write to Host
Microsoft.ML.Data (1)
Evaluators\EvaluatorBase.cs (1)
28
Host
= env.Register(registrationName);
177 references to Host
Microsoft.ML.Data (177)
Evaluators\AnomalyDetectionEvaluator.cs (19)
83
Host
.CheckUserArg(args.K > 0, nameof(args.K), "Must be positive");
84
Host
.CheckUserArg(0 <= args.P && args.P <= 1, nameof(args.P), "Must be in [0,1]");
85
Host
.CheckUserArg(args.NumTopResults >= 0, nameof(args.NumTopResults), "Must be non-negative");
86
Host
.CheckUserArg(args.MaxAucExamples >= -1, nameof(args.MaxAucExamples), "Must be at least -1");
100
throw
Host
.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "Single", t.ToString());
101
Host
.Check(schema.Label.HasValue, "Could not find the label column");
104
throw
Host
.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single or a Key with cardinality 2", t.ToString());
109
return new Aggregator(
Host
, _aucCount, _numTopResults, _k, _p, _streaming, schema.Name == null ? -1 : schema.Name.Value.Index, stratName);
114
return NopTransform.CreateIfNeeded(
Host
, data.Data);
179
var overallDvBldr = new ArrayDataViewBuilder(
Host
);
194
var topKdvBldr = new ArrayDataViewBuilder(
Host
);
591
Host
.CheckValue(data, nameof(data));
592
Host
.CheckNonEmpty(label, nameof(label));
593
Host
.CheckNonEmpty(score, nameof(score));
594
Host
.CheckNonEmpty(predictedLabel, nameof(predictedLabel));
602
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
609
Host
.Assert(moved);
610
result = new AnomalyDetectionMetrics(
Host
, cursor);
612
Host
.Assert(!moved);
Evaluators\BinaryClassifierEvaluator.cs (57)
113
var host =
Host
.NotSensitive();
129
var host =
Host
.SchemaSensitive();
142
var host =
Host
.SchemaSensitive();
162
Host
.Assert(prob == null || prob.Count == 1);
169
return new Aggregator(
Host
, classNames, schema.Weight != null, _aucCount, _auPrcCount, _threshold, _useRaw, _prCount, stratName);
199
return new BinaryPerInstanceEvaluator(
Host
, schema.Schema, scoreInfo.Name, probCol, schema.Label.Value.Name, _threshold, _useRaw);
256
Host
.Check(agg.Weighted == hasWeight, "All aggregators must either be weighted or unweighted");
257
Host
.Check((agg.AuPrcAggregator == null) == (aggregator.AuPrcAggregator == null),
283
Host
.AssertValue(agg.Precision);
284
Host
.AssertValue(agg.Recall);
285
Host
.AssertValue(agg.FalsePositiveRate);
320
Host
.AssertValue(agg.WeightedPrecision);
321
Host
.AssertValue(agg.WeightedRecall);
322
Host
.AssertValue(agg.WeightedFalsePositiveRate);
334
var overallDvBldr = new ArrayDataViewBuilder(
Host
);
355
var confDvBldr = new ArrayDataViewBuilder(
Host
);
375
var dvBldr = new ArrayDataViewBuilder(
Host
);
812
Host
.CheckValue(data, nameof(data));
813
Host
.CheckNonEmpty(label, nameof(label));
814
Host
.CheckNonEmpty(score, nameof(score));
815
Host
.CheckNonEmpty(probability, nameof(probability));
816
Host
.CheckNonEmpty(predictedLabel, nameof(predictedLabel));
825
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
833
Host
.Assert(moved);
834
result = new CalibratedBinaryClassificationMetrics(
Host
, cursor, confusionMatrix);
836
Host
.Assert(!moved);
860
Host
.CheckValue(data, nameof(data));
861
Host
.CheckNonEmpty(label, nameof(label));
862
Host
.CheckNonEmpty(score, nameof(score));
863
Host
.CheckNonEmpty(probability, nameof(probability));
864
Host
.CheckNonEmpty(predictedLabel, nameof(predictedLabel));
873
Host
.Assert(resultDict.ContainsKey(MetricKinds.PrCurve));
875
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
899
Host
.Assert(moved);
900
result = new CalibratedBinaryClassificationMetrics(
Host
, cursor, confusionMatrix);
902
Host
.Assert(!moved);
919
Host
.Assert(thresholdColumn != null);
920
Host
.Assert(precisionColumn != null);
921
Host
.Assert(recallColumn != null);
922
Host
.Assert(fprColumn != null);
941
Host
.CheckValue(data, nameof(data));
942
Host
.CheckNonEmpty(label, nameof(label));
943
Host
.CheckNonEmpty(score, nameof(score));
944
Host
.CheckNonEmpty(predictedLabel, nameof(predictedLabel));
952
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
960
Host
.Assert(moved);
961
result = new BinaryClassificationMetrics(
Host
, cursor, confusionMatrix);
963
Host
.Assert(!moved);
987
Host
.CheckValue(data, nameof(data));
988
Host
.CheckNonEmpty(label, nameof(label));
989
Host
.CheckNonEmpty(score, nameof(score));
990
Host
.CheckNonEmpty(predictedLabel, nameof(predictedLabel));
998
Host
.Assert(resultDict.ContainsKey(MetricKinds.PrCurve));
1000
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
1024
Host
.Assert(moved);
1025
result = new BinaryClassificationMetrics(
Host
, cursor, confusionMatrix);
1027
Host
.Assert(!moved);
Evaluators\ClusteringEvaluator.cs (20)
52
Host
.AssertValue(args, "args");
67
Host
.CheckValue(data, nameof(data));
68
Host
.CheckNonEmpty(score, nameof(score));
82
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
89
Host
.Assert(moved);
90
result = new ClusteringMetrics(
Host
, cursor, _calculateDbi);
92
Host
.Assert(!moved);
102
throw
Host
.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name,
109
throw
Host
.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "known-size vector of Single", type.ToString());
116
Host
.Assert(schema.Feature.HasValue);
120
throw
Host
.ExceptSchemaMismatch(nameof(schema), "features", schema.Feature.Value.Name,
130
Host
.Assert(!_calculateDbi || schema.Feature != null);
136
Host
.AssertValue(schema);
137
Host
.Assert(!_calculateDbi || schema.Feature?.Type.IsKnownSizeVector() == true);
140
Host
.Assert(scoreType != null && scoreType.Size > 0);
142
return new Aggregator(
Host
, schema.Feature, numClusters, _calculateDbi, schema.Weight != null, stratName);
149
return new ClusteringPerInstanceEvaluator(
Host
, schema.Schema, scoreInfo.Name, numClusters);
175
Host
.Check(agg.Weighted == hasWeight, "All aggregators must either be weighted or unweighted");
176
Host
.Check(agg.UnweightedCounters.CalculateDbi == aggregator.UnweightedCounters.CalculateDbi,
201
var overallDvBldr = new ArrayDataViewBuilder(
Host
);
Evaluators\EvaluatorBase.cs (3)
39
agg.GetWarnings(dict,
Host
);
52
EvaluateUtils.CheckWeightType(
Host
, schema.Weight.Value.Type);
460
return new RowToRowMapperTransform(
Host
, data.Data, mapper, null);
Evaluators\MulticlassClassificationEvaluator.cs (23)
69
Host
.AssertValue(args, "args");
70
Host
.CheckUserArg(args.OutputTopKAcc == null || args.OutputTopKAcc > 0, nameof(args.OutputTopKAcc));
80
throw
Host
.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "vector of two or more items of type Single", score.Type.ToString());
81
Host
.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column");
84
throw
Host
.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single or Key", labelType.ToString());
91
Host
.Assert(numClasses > 0);
93
return new Aggregator(
Host
, classNames, numClasses, schema.Weight != null, _outputTopKAcc, stratName);
112
Host
.Assert(Utils.Size(score) == 1);
114
Host
.Assert(numClasses > 0);
122
Host
.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column");
125
return new MulticlassPerInstanceEvaluator(
Host
, schema.Schema, scoreInfo, schema.Label.Value.Name);
164
Host
.Check(agg.Weighted == hasWeight, "All aggregators must either be weighted or unweighted");
165
Host
.Check((agg.UnweightedCounters.OutputTopKAcc > 0) == (aggregator.UnweightedCounters.OutputTopKAcc > 0),
208
var overallDvBldr = new ArrayDataViewBuilder(
Host
);
232
var confDvBldr = new ArrayDataViewBuilder(
Host
);
552
Host
.CheckValue(data, nameof(data));
553
Host
.CheckNonEmpty(label, nameof(label));
554
Host
.CheckNonEmpty(score, nameof(score));
555
Host
.CheckNonEmpty(predictedLabel, nameof(predictedLabel));
563
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
571
Host
.Assert(moved);
572
result = new MulticlassClassificationMetrics(
Host
, cursor, _outputTopKAcc ?? 0, confusionMatrix);
574
Host
.Assert(!moved);
Evaluators\MultiOutputRegressionEvaluator.cs (9)
52
Host
.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column");
55
return new MultiOutputRegressionPerInstanceEvaluator(
Host
, schema.Schema, scoreCol.Name, schema.Label.Value.Name);
63
throw
Host
.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "known-size vector of Single", score.Type.ToString());
64
Host
.Check(schema.Label.HasValue, "Could not find the label column");
67
throw
Host
.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "known-size vector of Single or Double", schema.Label.Value.Type.ToString());
74
Host
.Assert(vectorSize > 0);
75
return new Aggregator(
Host
, LossFunction, vectorSize, schema.Weight != null, stratName);
115
Host
.Check(agg.Weighted == hasWeight, "All aggregators must either be weighted or unweighted");
145
var overallDvBldr = new ArrayDataViewBuilder(
Host
);
Evaluators\QuantileRegressionEvaluator.cs (9)
44
Host
.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column");
48
Host
.Check(type != null && type.IsKnownSize && type.ItemType is TextDataViewType, "Quantile regression score column must have slot names");
51
Host
.Assert(quantiles.IsDense && quantiles.Length == scoreSize);
53
return new QuantileRegressionPerInstanceEvaluator(
Host
, schema.Schema, scoreInfo.Name, schema.Label.Value.Name, scoreSize, quantiles);
61
throw
Host
.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "Vector of Single or Double", score.Type.ToString());
62
Host
.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column");
65
throw
Host
.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single", t.ToString());
72
Host
.Assert(scoreType != null && scoreType.Size > 0 && (scoreType.ItemType == NumberDataViewType.Single || scoreType.ItemType == NumberDataViewType.Double));
77
return new Aggregator(
Host
, LossFunction, schema.Weight != null, scoreType.Size, in slotNames, stratName);
Evaluators\RankingEvaluator.cs (22)
78
throw
Host
.ExceptUserArg(nameof(options.DcgTruncationLevel), "DCG Truncation Level must be greater than 0");
79
Host
.CheckUserArg(options.LabelGains != null, nameof(options.LabelGains), "Label gains cannot be null");
90
throw
Host
.ExceptUserArg(nameof(options.LabelGains), "Label Gains must be of floating or integral type");
101
throw
Host
.ExceptSchemaMismatch(nameof(RankingMamlEvaluator.Arguments.LabelColumn),
107
throw
Host
.ExceptSchemaMismatch(nameof(RankingMamlEvaluator.Arguments.ScoreColumn),
117
throw
Host
.ExceptSchemaMismatch(nameof(RankingMamlEvaluator.Arguments.GroupIdColumn),
131
return new Aggregator(
Host
, _labelGains, _truncationLevel, _groupSummary, schema.Weight != null, stratName);
136
Host
.CheckValue(data, nameof(data));
137
Host
.CheckParam(data.Schema.Label.HasValue, nameof(data), "Schema must contain a label column");
139
Host
.CheckParam(data.Schema.Group.HasValue, nameof(data), "Schema must contain a group column");
141
return new RankingPerInstanceTransform(
Host
, data.Data,
181
Host
.Check(agg.Weighted == hasWeight, "All aggregators must either be weighted or unweighted");
182
Host
.Check(agg.UnweightedCounters.GroupSummary == aggregator.UnweightedCounters.GroupSummary,
213
var overallDvBldr = new ArrayDataViewBuilder(
Host
);
224
var groupDvBldr = new ArrayDataViewBuilder(
Host
);
256
Host
.CheckValue(data, nameof(data));
257
Host
.CheckNonEmpty(label, nameof(label));
258
Host
.CheckNonEmpty(score, nameof(score));
265
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
272
Host
.Assert(moved);
273
result = new RankingMetrics(
Host
, cursor);
275
Host
.Assert(!moved);
Evaluators\RegressionEvaluator.cs (12)
60
throw
Host
.ExceptSchemaMismatch(nameof(schema), "score", score.Name, "Single", t.ToString());
61
Host
.CheckParam(schema.Label.HasValue, nameof(schema), "Could not find the label column");
64
throw
Host
.ExceptSchemaMismatch(nameof(schema), "label", schema.Label.Value.Name, "Single", t.ToString());
69
return new Aggregator(
Host
, LossFunction, schema.Weight != null, stratName);
77
return new RegressionPerInstanceEvaluator(
Host
, schema.Schema, scoreInfo.Name, schema.Label.Value.Name);
176
Host
.CheckValue(data, nameof(data));
177
Host
.CheckNonEmpty(label, nameof(label));
178
Host
.CheckNonEmpty(score, nameof(score));
184
Host
.Assert(resultDict.ContainsKey(MetricKinds.OverallMetrics));
191
Host
.Assert(moved);
192
result = new RegressionMetrics(
Host
, cursor);
194
Host
.Assert(!moved);
Evaluators\RegressionEvaluatorBase.cs (3)
35
Host
.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified.");
68
Host
.Check(agg.Weighted == hasWeight, "All aggregators must either be weighted or unweighted");
94
var overallDvBldr = new ArrayDataViewBuilder(
Host
);