A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://blasbenito.github.io/spatialRF/reference/get_response_curves.html below:

Gets data to allow custom plotting of response curves — get_response_curves • spatialRF

Generates and returns the data required to plot the response curves of a model fitted with rf(), rf_repeat(), or rf_spatial().

get_response_curves(
  model = NULL,
  variables = NULL,
  quantiles = c(0.1, 0.5, 0.9),
  grid.resolution = 200,
  verbose = TRUE
)
Arguments
model

A model fitted with rf(), rf_repeat(), or rf_spatial().

variables

Character vector, names of predictors to plot. If NULL, the most important variables (importance higher than the median) in model are selected. Default: NULL.

quantiles

Numeric vector with values between 0 and 1, argument probs of quantile. Quantiles to set the other variables to. Default: c(0.1, 0.5, 0.9)

grid.resolution

Integer between 20 and 500. Resolution of the plotted curve Default: 100

verbose

Logical, if TRUE the plot is printed. Default: TRUE

Value

A data frame with the following columns:

Details

All variables that are not plotted in a particular response curve are set to the values of their respective quantiles, and the response curve for each one of these quantiles is shown in the plot.

Examples
if(interactive()){

#loading example data
data(plant_richness_df)

#fitting random forest model
out <- rf(
 data = plant_richness_df,
 dependent.variable.name = "richness_species_vascular",
 predictor.variable.names = colnames(plant_richness_df)[5:21],
 n.cores = 1,
 verbose = FALSE
)

#getting data frame with response curves
p <- get_response_curves(out)
head(p)

}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4