PermutationFeatureImportanceNonCalibrated( this BinaryClassificationCatalog catalog, ITransformer model, IDataView data, string labelColumnName = DefaultColumnNames.Label, bool useFeatureWeightFilter = false, int?numberOfExamplesToUse = null, int permutationCount = 1) { Contracts.CheckValue(catalog, nameof(catalog)); var env = catalog.GetEnvironment(); Contracts.CheckValue(env, nameof(env)); env.CheckValue(data, nameof(data)); env.CheckValue(model, nameof(model)); BinaryClassificationMetricsStatistics resultInitializer() => new(); BinaryClassificationMetrics evaluationFunc(IDataView idv) => catalog.EvaluateNonCalibrated(idv, labelColumnName); return(PermutationFeatureImportance( env, model, data, resultInitializer, evaluationFunc, BinaryClassifierDelta, permutationCount, useFeatureWeightFilter, numberOfExamplesToUse )); }
PermutationFeatureImportance <TModel>( this BinaryClassificationCatalog 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, BinaryClassificationMetrics, BinaryClassificationMetricsStatistics> .GetImportanceMetricsMatrix( catalog.GetEnvironment(), model, data, idv => catalog.Evaluate(idv, label), BinaryClassifierDelta, features, permutationCount, useFeatureWeightFilter, topExamples)); }
PermutationFeatureImportance <TModel>( this BinaryClassificationCatalog 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, BinaryClassificationMetrics, BinaryClassificationMetricsStatistics> .GetImportanceMetricsMatrix( catalog.GetEnvironment(), predictionTransformer, data, () => new BinaryClassificationMetricsStatistics(), idv => catalog.Evaluate(idv, labelColumnName), BinaryClassifierDelta, predictionTransformer.FeatureColumnName, permutationCount, useFeatureWeightFilter, numberOfExamplesToUse)); }