Interpretation of feature contribution in random forest

In the featureContribution function (in the R package rfFC), what should we interpret if all the scores for all the features are negative? For example, if there were 7 features and after running the featureContribution function we got feature values as:

fc = c(-0.031544542, -0.064272583, -0.02307187, -0.000213402, -0.040743263,
-0.042137713, -0.080828973)


Then what is the final interpretation? Is it something like all the features are not contributing to the prediction for this data point?

The github code for the package can be found here.

Please find a reproducible example to work with below

# # randomForest - For random forest model
library(randomForest)
# # rfFc - For feature contribution
library(rfFC)

set.seed(294056)

# # Remove this column
df = df[-8]
# # Remove status column
df\$Status = NULL

# # Master data 1-7 columns and Anomaly column
mydf = cbind(df[,1:7], df["Anomaly"])
rm(df)
# # Make Anomaly column as factor
mydf[,8] = as.factor(mydf[,8])
# # Change the name of Anomaly column to Status (not necessary)
colnames(mydf)[8] = "Status"
# # X: predictors
X <- mydf[, 1:(ncol(mydf) - 1)]
# # target: class
target <- mydf[,"Status"]

# # Build the model
rF_Model <- randomForest(x=X, y=as.factor(as.character(target)), ntree=500, importance=TRUE, keep.inbag=TRUE, replace=FALSE)

li <- getLocalIncrements(rF_Model,X)
fc<-featureContributions(rF_Model, li, X)
fc = as.data.frame(fc)

# # Data where the fc score is all negative
output = cbind(fc[apply(fc, 1, function(x) all(x < 0)),], mydf[apply(fc, 1, function(x) all(x < 0)),])
print(fc[apply(fc, 1, function(x) all(x < 0)),])
print(output)

• It would help if you could add some more context here, such as a reproducible example for people to work with. – gung Jun 8 '16 at 19:09
• (To whom it may concern, note that how to interpret statistical output is generally on topic here.) – gung Jun 8 '16 at 19:10
• Thanks @gung. I have added an example in the question (edited). – Kartheek Palepu Jun 9 '16 at 5:47
• Please paste the reproducible example into your question. We want this thread to remain valuable even if the link goes dead. – gung Jun 9 '16 at 12:26