gbm.plot add param 'centered' to omit response data centering
Hi Robert,
By default gbm.plot centres (L77) the response data that it gets from plot.gbm (L71).
It would be nice if that could be turned off, so that one can easily plot the data the same way that plot.gbm exports it to csv. I was going to clone the function in my package and add this but I was wondering if you'd mind implementing the change upstream so others could avail of it? I've seen others run into this issue at various times.
The easiest way I see for this to happen would be change L77 from:
responses[[j]] <- response.matrix[,2] - mean(response.matrix[,2])
to:
if (centered) { responses[[j]] <- response.matrix[,2] - mean(response.matrix[,2]) } else { responses[[j]] <- response.matrix[,2] }
Then add to the function call: centered = TRUE, # center the response data (y axis) over zero
Thanks in advance! Plus points if it allows UK English spelling (centre/centred) as well :)
Cheers,
Simon