8000 gbm.plot add param 'centered' to omit response data centering · Issue #22 · rspatial/dismo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gbm.plot add param 'centered' to omit response data centering #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking &l 8000 dquo;Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SimonDedman opened this issue Dec 7, 2021 · 0 comments
Open

Comments

@SimonDedman
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0