plot_tuning {spatialRF} | R Documentation |
Plots a tuning object produced by rf_tuning()
Description
Plots the tuning of the hyperparameters num.trees
, mtry
, and min.node.size
performed by rf_tuning()
.
Usage
plot_tuning(
model,
point.color = viridis::viridis(
100,
option = "F"
),
verbose = TRUE
)
Arguments
model |
A model fitted with |
point.color |
Colors of the plotted points. Can be a single color name (e.g. "red4"), a character vector with hexadecimal codes (e.g. "#440154FF" "#21908CFF" "#FDE725FF"), or function generating a palette (e.g. |
verbose |
Logical, if |
Value
A ggplot.
See Also
Examples
if(interactive()){
#load example data
data(plant_richness_df)
#fit random forest model
rf.model <- rf(
data = plant_richness_df,
dependent.variable.name = "richness_species_vascular",
predictor.variable.names = colnames(plant_richness_df)[5:21],
distance.matrix = distance_matrix,
distance.thresholds = 0,
n.cores = 1,
verbose = FALSE
)
#tune random forest model
rf.model <- rf_tuning(
model = rf.model,
xy = plant_richness_df[, c("x", "y")],
n.cores = 1,
verbose = FALSE
)
#generate tuning plot
plot_tuning(model = rf.model)
}
[Package spatialRF version 1.1.4 Index]