fit_regression_random_forest: Fit regression random forest to 'klassets_xy' object

View source: R/xy.R

fit_regression_random_forestR Documentation

Fit regression random forest to klassets_xy object

Description

Fit regression random forest to klassets_xy object

Usage

fit_regression_random_forest(
  df,
  ntree = 500L,
  maxdepth = Inf,
  trace = FALSE,
  ...
)

Arguments

df

A object from sim_xy.

ntree

Number of trees to grow for the forest.

maxdepth

Max depth of each trees.

trace

A logical indicating if a progress bar shall be printed while the forest grows.

...

Options for ranger::ranger.

Examples


df <- sim_xy()

df

dfrrf <- fit_regression_random_forest(df)

dfrrf

plot(dfrrf)

df <- sim_xy(n = 1000, x_dist = runif)
df <- dplyr::mutate(df, y = y + 2*sin(5 * x))
plot(df)

plot(fit_regression_random_forest(df))
plot(fit_regression_random_forest(df, ntree = 100, maxdepth = 3))


jbkunst/klassets documentation built on Dec. 7, 2022, 9:18 p.m.