public abstract class ContributionsPredictor<E> extends java.lang.Object implements PredictContributions
Constructor and Description |
---|
ContributionsPredictor(int ncontribs,
java.lang.String[] featureContributionNames,
TreeSHAPPredictor<E> treeSHAPPredictor) |
Modifier and Type | Method and Description |
---|---|
float[] |
calculateContributions(double[] input)
Calculate contributions (SHAP values) for a given input row.
|
FeatureContribution[] |
calculateContributions(double[] input,
int topN,
int bottomN,
boolean compareAbs) |
float[] |
getContribs(float[] contribs) |
java.lang.String[] |
getContributionNames() |
protected abstract E |
toInputRow(double[] input) |
public ContributionsPredictor(int ncontribs, java.lang.String[] featureContributionNames, TreeSHAPPredictor<E> treeSHAPPredictor)
public final java.lang.String[] getContributionNames()
getContributionNames
in interface PredictContributions
public final float[] calculateContributions(double[] input)
PredictContributions
calculateContributions
in interface PredictContributions
input
- input dataprotected abstract E toInputRow(double[] input)
public float[] getContribs(float[] contribs)
public FeatureContribution[] calculateContributions(double[] input, int topN, int bottomN, boolean compareAbs)
calculateContributions
in interface PredictContributions