置换特征重要性(PFI)和特征贡献计算(FCC)之间有什么区别/关系?

时间:2019-05-26 15:17:32

标签: c# machine-learning ml.net

正如标题所示,我想知道两种“可解释性”工具之间的区别/关系是什么:排列特征重要性(PFI)和特征贡献计算(FCC),当评估机器中特征的影响时学习模式?

我知道ML.Net允许两者都使用,它们都告诉您每种功能对模型生成性能的影响,但是我不了解它们之间的主要区别。为什么两者都需要?

学术图书馆搜索,Google和Google Scholar告诉我有关PFI的更多信息,但我在FCC上找不到任何内容。

//PFI
// Compute the feature importance using PFI
var permutationMetrics = mlContext.Regression.PermutationFeatureImportance(model, data);

// Get the feature names from the training set
var featureNames = data.Schema.GetColumns()
                .Select(tuple => tuple.column.Name) // Get the column names
                .Where(name => name != labelName) // Drop the Label
                .ToArray();

// Write out the feature names and their importance to the model's R-squared value
for (int i = 0; i < featureNames.Length; i++)
  Console.WriteLine($" 
{featureNames[i]}\t{permutationMetrics[i].rSquared:G4}");


/////VERUS/////


//FCC

// Create a Feature Contribution Calculator
// Calculate the feature contributions for all features given trained model parameters

var featureContributionCalculator = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, numPositiveContributions: 11, normalize: false);

// FeatureContributionCalculatingEstimator can be use as an intermediary step in a pipeline. 
// The features retained by FeatureContributionCalculatingEstimator will be in the FeatureContribution column.

var pipeline = mlContext.Model.Explainability.FeatureContributionCalculation(model.Model, model.FeatureColumn, numPositiveContributions: 11)
    .Append(mlContext.Regression.Trainers.OrdinaryLeastSquares(featureColumn: "FeatureContributions"));

出于学术目的,我想清楚地写出它们之间的差异,也许是它们用来计算功能重要性的方法,或者是内部逻辑-差异如何。

0 个答案:

没有答案