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