RandomBagRegressor.Rd
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")
)
library(datasets)
n <- 20 ; p <- 5
X <- matrix(rnorm(n * p), n, p) # no intercept!
y <- rnorm(n)
obj <- sklearn$tree$DecisionTreeRegressor()
obj2 <- RandomBagRegressor(obj)
obj2$fit(X[1:12,], y[1:12])
#> RandomBagRegressor(col_sample=1.0, dropout=0.0, obj=DecisionTreeRegressor(),
#> row_sample=1.0)
print(obj2$score(X[13:20, ], y[13:20]))
#> [1] -1.770562