コード例 #1
0
 PermutationFeatureImportance(
     this BinaryClassificationContext ctx,
     IPredictionTransformer <IPredictor> model,
     IDataView data,
     string label                = DefaultColumnNames.Label,
     string features             = DefaultColumnNames.Features,
     bool useFeatureWeightFilter = false,
     int?topExamples             = null)
 {
     return(PermutationFeatureImportance <BinaryClassifierEvaluator.Result> .GetImportanceMetricsMatrix(
                CatalogUtils.GetEnvironment(ctx),
                model,
                data,
                idv => ctx.Evaluate(idv, label),
                BinaryClassifierDelta,
                features,
                useFeatureWeightFilter,
                topExamples));
 }
コード例 #2
0
 PermutationFeatureImportance(
     this RankingContext ctx,
     IPredictionTransformer <IPredictor> model,
     IDataView data,
     string label                = DefaultColumnNames.Label,
     string groupId              = DefaultColumnNames.GroupId,
     string features             = DefaultColumnNames.Features,
     bool useFeatureWeightFilter = false,
     int?topExamples             = null)
 {
     return(PermutationFeatureImportance <RankerMetrics> .GetImportanceMetricsMatrix(
                CatalogUtils.GetEnvironment(ctx),
                model,
                data,
                idv => ctx.Evaluate(idv, label, groupId),
                RankingDelta,
                features,
                useFeatureWeightFilter,
                topExamples));
 }
 PermutationFeatureImportance <TModel>(
     this RegressionCatalog catalog,
     IPredictionTransformer <TModel> model,
     IDataView data,
     string label                = DefaultColumnNames.Label,
     string features             = DefaultColumnNames.Features,
     bool useFeatureWeightFilter = false,
     int?topExamples             = null,
     int permutationCount        = 1)
 {
     return(PermutationFeatureImportance <TModel, RegressionMetrics, RegressionMetricsStatistics> .GetImportanceMetricsMatrix(
                catalog.GetEnvironment(),
                model,
                data,
                idv => catalog.Evaluate(idv, label),
                RegressionDelta,
                features,
                permutationCount,
                useFeatureWeightFilter,
                topExamples));
 }
コード例 #4
0
 PermutationFeatureImportance(
     this MulticlassClassificationContext ctx,
     IPredictionTransformer <IPredictor> model,
     IDataView data,
     string label                = DefaultColumnNames.Label,
     string features             = DefaultColumnNames.Features,
     bool useFeatureWeightFilter = false,
     int?topExamples             = null,
     int permutationCount        = 1)
 {
     return(PermutationFeatureImportance <MultiClassClassifierMetrics, MultiClassClassifierMetricsStatistics> .GetImportanceMetricsMatrix(
                CatalogUtils.GetEnvironment(ctx),
                model,
                data,
                idv => ctx.Evaluate(idv, label),
                MulticlassClassificationDelta,
                features,
                permutationCount,
                useFeatureWeightFilter,
                topExamples));
 }
コード例 #5
0
 PermutationFeatureImportance <TModel>(
     this RegressionCatalog catalog,
     ISingleFeaturePredictionTransformer <TModel> predictionTransformer,
     IDataView data,
     string labelColumnName      = DefaultColumnNames.Label,
     bool useFeatureWeightFilter = false,
     int?numberOfExamplesToUse   = null,
     int permutationCount        = 1) where TModel : class
 {
     return(PermutationFeatureImportance <TModel, RegressionMetrics, RegressionMetricsStatistics> .GetImportanceMetricsMatrix(
                catalog.GetEnvironment(),
                predictionTransformer,
                data,
                () => new RegressionMetricsStatistics(),
                idv => catalog.Evaluate(idv, labelColumnName),
                RegressionDelta,
                predictionTransformer.FeatureColumnName,
                permutationCount,
                useFeatureWeightFilter,
                numberOfExamplesToUse));
 }