Skip to content
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 “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

Partial dependence plots not working properly #21

Open
Phome95 opened this issue Apr 23, 2024 · 0 comments
Open

Partial dependence plots not working properly #21

Phome95 opened this issue Apr 23, 2024 · 0 comments

Comments

@Phome95
Copy link

Phome95 commented Apr 23, 2024

Firstly thank you for your excellent package, Whenever I attempt to get the response curves i get hit with an error:
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "ranger"

my code:

model.non.spatial <- spatialRF::rf(
  data = LAD1,
  dependent.variable.name = dependent.variable.name,
  predictor.variable.names = predictor.variable.names,
  distance.matrix = distance_matrix1,
  distance.thresholds = distance.thresholds,
  xy = xy, #not needed by rf, but other functions read it from the model
  seed = random.seed,
  verbose = FALSE,
  n.cores = parallel::detectCores() - 1 #is passed via pipe to the other functions,
  
)
spatialRF::plot_response_curves(
  model.non.spatial,
  quantiles = c(0.1, 0.5, 0.9),
  line.color = viridis::viridis(
    3, #same number of colors as quantiles
    option = "F", 
    end = 0.9
  ),
  ncol = 3,
  show.data = TRUE
)

Any help would be greatly appreciated!

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