1 write to Host
Microsoft.ML.Data (1)
Evaluators\MamlEvaluator.cs (1)
99Host = env.Register(registrationName);
105 references to Host
Microsoft.ML.Data (105)
Evaluators\AnomalyDetectionEvaluator.cs (15)
661_evaluator = new AnomalyDetectionEvaluator(Host, evalArgs); 668throw Host.Except("Did not find the top-k results data view"); 674throw Host.ExceptSchemaMismatch(nameof(top.Schema), "instance", AnomalyDetectionEvaluator.TopKResultsColumns.Instance); 679throw Host.ExceptSchemaMismatch(nameof(top.Schema), "anomaly score", AnomalyDetectionEvaluator.TopKResultsColumns.AnomalyScore); 684throw Host.ExceptSchemaMismatch(nameof(top.Schema), "label", AnomalyDetectionEvaluator.TopKResultsColumns.Label); 713throw Host.Except("No overall metrics found"); 718throw Host.ExceptSchemaMismatch(nameof(overall.Schema), "number of anomalies", AnomalyDetectionEvaluator.OverallMetrics.NumAnomalies); 745throw Host.Except("Found multiple non-stratified rows in overall results data view"); 772overall = new ColumnCopyingTransformer(Host, cols).Transform(overall); 773IDataView fold = ColumnSelectingTransformer.CreateKeep(Host, overall, colsToKeep.ToArray()); 776ch.Info(MetricWriter.GetPerFoldResults(Host, fold, out weightedFold)); 781return ColumnSelectingTransformer.CreateDrop(Host, 791Host.CheckValue(schema, nameof(schema)); 792Host.CheckParam(schema.Label.HasValue, nameof(schema), "Data must contain a label column"); 796var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn),
Evaluators\BinaryClassifierEvaluator.cs (18)
1325Host.CheckValue(args, nameof(args)); 1337_evaluator = new BinaryClassifierEvaluator(Host, evalArgs); 1344var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn), 1348var probCol = EvaluateUtils.GetOptAuxScoreColumn(Host, schema.Schema, _probCol, nameof(Arguments.ProbabilityColumn), 1389fold = new ColumnCopyingTransformer(Host, cols).Transform(fold); 1392fold = ColumnSelectingTransformer.CreateKeep(Host, fold, colsToKeep.ToArray()); 1395var unweightedConf = MetricWriter.GetConfusionTableAsFormattedString(Host, conf, out weightedConf); 1397var unweightedFold = MetricWriter.GetPerFoldResults(Host, fold, out weightedFold); 1410return ColumnSelectingTransformer.CreateDrop(Host, overall, BinaryClassifierEvaluator.Entropy); 1426pr = MetricWriter.GetNonStratifiedMetrics(Host, pr); 1427MetricWriter.SavePerInstance(Host, ch, _prFileName, pr); 1451Host.AssertNonEmpty(metrics); 1461idv = EvaluateUtils.AddFoldIndex(Host, idv, i, metrics.Length); 1467pr = AppendRowsDataView.Create(Host, prList[0].Schema, prList.ToArray()); 1474Host.CheckValue(schema, nameof(schema)); 1475Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 1479var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn), 1482var probCol = EvaluateUtils.GetOptAuxScoreColumn(Host, schema.Schema, _probCol, nameof(Arguments.ProbabilityColumn),
Evaluators\ClusteringEvaluator.cs (7)
787Host.CheckValue(args, nameof(args)); 788Host.CheckUserArg(1 <= args.NumTopClustersToOutput, nameof(args.NumTopClustersToOutput)); 798_evaluator = new ClusteringEvaluator(Host, evalArgs); 815throw Host.ExceptUserArg(nameof(Arguments.FeatureColumn), "Features column '{0}' not found", feat); 823Host.CheckValue(schema, nameof(schema)); 842perInst = new SlotsDroppingTransformer(Host, ClusteringPerInstanceEvaluator.SortedClusters, min: _numTopClusters).Transform(perInst); 849perInst = new SlotsDroppingTransformer(Host, ClusteringPerInstanceEvaluator.SortedClusterScores, min: _numTopClusters).Transform(perInst);
Evaluators\MamlEvaluator.cs (14)
116Host.CheckValue(schema, nameof(schema)); 137var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(ArgumentsBase.ScoreColumn), 157Host.CheckValue(ch, nameof(ch)); 158Host.CheckValue(metrics, nameof(metrics)); 177string unweightedMetrics = MetricWriter.GetPerFoldResults(Host, fold, out weightedMetrics); 185Host.CheckNonEmpty(metrics, nameof(metrics)); 193return EvaluateUtils.ConcatenateOverallMetrics(Host, metrics); 204Host.CheckValue(ch, nameof(ch)); 205Host.CheckNonEmpty(metrics, nameof(metrics)); 220Host.AssertValue(scoredData); 252idv = new GenerateNumberTransform(Host, args, idv); 264idv = new ColumnCopyingTransformer(Host, cols.ToArray()).Transform(idv); 265idv = ColumnSelectingTransformer.CreateKeep(Host, idv, colsToKeep.ToArray()); 283Host.CheckValue(perInstance, nameof(perInstance));
Evaluators\MulticlassClassificationEvaluator.cs (22)
900Host.CheckValue(args, nameof(args)); 902Host.CheckUserArg(2 <= args.NumTopClassesToOutput, nameof(args.NumTopClassesToOutput)); 903Host.CheckUserArg(2 <= args.NumClassesConfusionMatrix, nameof(args.NumClassesConfusionMatrix)); 904Host.CheckUserArg(args.OutputTopKAcc == null || args.OutputTopKAcc > 0, nameof(args.OutputTopKAcc)); 905Host.CheckUserArg(2 <= args.NumClassesConfusionMatrix, nameof(args.NumClassesConfusionMatrix)); 916_evaluator = new MulticlassClassificationEvaluator(Host, evalArgs); 921Host.AssertValue(metrics); 940var unweightedConf = MetricWriter.GetConfusionTableAsFormattedString(Host, conf, out string weightedConf, false, _numConfusionTableClasses); 941var unweightedFold = MetricWriter.GetPerFoldResults(Host, fold, out string weightedFold); 976EvaluateUtils.ReconcileSlotNames<double>(Host, views, MulticlassClassificationEvaluator.PerClassLogLoss, NumberDataViewType.Double, 988idv = new ChooseColumnsByIndexTransform(Host, 1001input = new ColumnCopyingTransformer(Host, (string.Format(TopKAccuracyFormat, _outputTopKAcc), MulticlassClassificationEvaluator.TopKAccuracy)).Transform(input); 1002return ColumnSelectingTransformer.CreateDrop(Host, input, MulticlassClassificationEvaluator.TopKAccuracy); 1007input = new ColumnCopyingTransformer(Host, (TopKAccuracyFormat, MulticlassClassificationEvaluator.AllTopKAccuracy)).Transform(input); 1008return ColumnSelectingTransformer.CreateDrop(Host, input, MulticlassClassificationEvaluator.AllTopKAccuracy); 1015input = ColumnSelectingTransformer.CreateDrop(Host, input, columnToDrop); 1038Host.CheckValue(schema, nameof(schema)); 1039Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 1058throw Host.ExceptSchemaMismatch(nameof(schema), "label", labelName); 1063perInst = LambdaColumnMapper.Create(Host, "ConvertToDouble", perInst, labelName, 1074perInst = new SlotsDroppingTransformer(Host, MulticlassPerInstanceEvaluator.SortedClasses, min: _numTopClasses).Transform(perInst); 1082perInst = new SlotsDroppingTransformer(Host, MulticlassPerInstanceEvaluator.SortedScores, min: _numTopClasses).Transform(perInst);
Evaluators\MultiOutputRegressionEvaluator.cs (5)
632Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified"); 637_evaluator = new MultiOutputRegressionEvaluator(Host, evalArgs); 642Host.CheckValue(schema, nameof(schema)); 643Host.CheckParam(schema.Label != null, nameof(schema), "Schema must contain a label column"); 650var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn),
Evaluators\QuantileRegressionEvaluator.cs (8)
481Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified."); 485_evaluator = new QuantileRegressionEvaluator(Host, evalArgs); 500string unweightedMetrics = MetricWriter.GetPerFoldResults(Host, fold, out weightedMetrics); 521output = LambdaColumnMapper.Create(Host, "Quantile Regression", output, name, name, type, NumberDataViewType.Double, 523output = new ChooseColumnsByIndexTransform(Host, 541Host.CheckValue(schema, nameof(schema)); 542Host.CheckParam(schema.Label.HasValue, nameof(schema), "Must contain a label column"); 546var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn),
Evaluators\RankingEvaluator.cs (11)
880Host.CheckValue(args, nameof(args)); 888_evaluator = new RankingEvaluator(Host, evalOpts); 913gs = MetricWriter.GetNonStratifiedMetrics(Host, gs); 914MetricWriter.SavePerInstance(Host, ch, _groupSummaryFilename, gs); 920Host.AssertNonEmpty(metrics); 933idv = EvaluateUtils.AddFoldIndex(Host, idv, i, metrics.Length); 936gs = AppendRowsDataView.Create(Host, gsList[0].Schema, gsList.ToArray()); 942Host.CheckValue(schema, nameof(schema)); 943Host.CheckParam(schema.Label.HasValue, nameof(schema), "Data must contain a label column"); 944Host.CheckParam(schema.Group.HasValue, nameof(schema), "Data must contain a group column"); 949var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn),
Evaluators\RegressionEvaluator.cs (5)
354Host.CheckUserArg(args.LossFunction != null, nameof(args.LossFunction), "Loss function must be specified."); 358_evaluator = new RegressionEvaluator(Host, evalArgs); 363Host.CheckValue(schema, nameof(schema)); 364Host.CheckParam(schema.Label.HasValue, nameof(schema), "Schema must contain a label column"); 368var scoreCol = EvaluateUtils.GetScoreColumn(Host, schema.Schema, ScoreCol, nameof(Arguments.ScoreColumn),