Understanding "PREDICT" function output in python lightGBM implementation
Suppose that you are doing regression from X ϵ Rn to y ϵ R1. For a given point, x, You can view the model prediction f(x) as a linear function of the feature contributions such as : f(x) = contribution(x1) + contribution (x2) + ... + contribution(xn) + mean(y)
The first n columns of your array correspond to the contribution of your n features respectively and the last column is the prediction without any information, here the mean of your output y. If you sum up those n+1 values, you will obtain the prediction f(x).
For classification, you obtain the "raw prediction". Depending on the objective you selected, you will have to convert it to probability (the "prediction") using softmax or logit function.
PS: Hope its clear despite my poor editing!
When using the Python PREDICT method in lightGBM with predict_contrib = TRUE, I get an array of [n_samples, n_features +1]. What does the n_feature+1 correspond to? I thought first that it could be the log odds of class 1 but the value does not correspond to the right probability.