Parameters description can be found at https://techtonique.github.io/nnetsauce/

RandomBagRegressor(
  obj,
  n_estimators = 10L,
  n_hidden_features = 1L,
  activation_name = "relu",
  a = 0.01,
  nodes_sim = "sobol",
  bias = TRUE,
  dropout = 0,
  direct_link = FALSE,
  n_clusters = 2L,
  cluster_encode = TRUE,
  type_clust = "kmeans",
  col_sample = 1,
  row_sample = 1,
  n_jobs = NULL,
  seed = 123L,
  verbose = 1L,
  backend = c("cpu", "gpu", "tpu"),
  venv_path = "./venv",
  ...
)

Examples


library(datasets)

n <- 20 ; p <- 5
X <- matrix(rnorm(n * p), n, p) # no intercept!
y <- rnorm(n)

obj <- sklearn$tree$DecisionTreeRegressor()
#> Error: object 'sklearn' not found
obj2 <- RandomBagRegressor(obj)
#> Error in reticulate::use_virtualenv(venv_path, required = TRUE): Directory ./venv is not a Python virtualenv
obj2$fit(X[1:12,], y[1:12])
#> Error: object 'obj2' not found
print(obj2$score(X[13:20, ], y[13:20]))
#> Error: object 'obj2' not found