See also https://techtonique.github.io/nnetsauce/

LazyDeepRegressor(
  verbose = 0,
  ignore_warnings = TRUE,
  custom_metric = NULL,
  predictions = FALSE,
  random_state = 42L,
  estimators = "all",
  preprocess = FALSE,
  n_layers = 3L,
  ...
)

Arguments

verbose

monitor progress (0, default, is false and 1 is true)

ignore_warnings

print trace when model fitting failed

custom_metric

defining a custom metric (default is NULL)

predictions

obtain predictions (default is FALSE)

random_state

reproducibility seed

estimators

specify regressors to be adjusted (default is 'all')

preprocess

preprocessing input covariates (default is FALSE FALSE)

n_layers

number of layers for the deep model

...

additional parameters to be passed to nnetsauce::CustomRegressor

Value

a list that you can $fit

Examples


X <- MASS::Boston[,-14] # dataset has an ethical problem
y <- MASS::Boston$medv

set.seed(13)
(index_train <- base::sample.int(n = nrow(X),
                                 size = floor(0.8*nrow(X)),
                                 replace = FALSE))
#>   [1] 472 259 448 357  74 205 262 432 406 132 320 221 248 337 384 362 399  55
#>  [19] 279   5 396 305  54 184  32 482 125  47  81 444 485 267  68 376  87 334
#>  [37]  61 373 131 223 387 197 446 324  66 385  62 307 127 371 374  60 476 332
#>  [55] 440 222 298 182 318 119  15 157 113  14 441 377 160 287 402 381 435 465
#>  [73] 210  78 455 333 129 232 361  97 415 304 490 190 124 303 136 398 139 105
#>  [91] 340 273 153 224 147 309   7 329  91  90  46   9 164 468 101 487 313 246
#> [109]  67 326  49 264 423 116 170   1 302 442 414 103 437  57 314 355 237 451
#> [127] 154  86  53 123  31 460 452 311 383 226 322 277 130 405 109 295 212 421
#> [145] 317 200  20  99  16 386 498 165 489  84 495 478 291 134 436 348 316  58
#> [163] 126 328  12 217 420 203 339  64 471  73 494 458 502 434 135 100 177 204
#> [181] 285 209  82 143 215 159 183 196 216 315 346  22  25 172 233 352 412 231
#> [199] 359 416 380 354 236 500 319 240 251  13   2 464  35 417 456 121 390 201
#> [217] 418 401  77  18 475 486 146 241 299 244 114 447 503 149 424 228 275 477
#> [235]  33 330 111 207 301  92 335  50 454 388 137 505 150 404 351 438 202 430
#> [253]  96 484 327 162 431 155 282 499 496 270 235 479 158 419  56 457 189 397
#> [271] 239 108  79 166 363  40 245 409 283 450 341 462 156  44 280 422 501 342
#> [289] 191 370 144 269 194 185 429 392 306 358 199  85  94 181 186 349  80 145
#> [307]  43 161 375 331 229 175 426 408 238 344 379 110  72 343  93 413 174 308
#> [325] 480  59 234 128 151 169 104 167 242 470 473 297 179 278 107  83 102  51
#> [343] 133 247  19 353 118 289  98   4 284 443 214 288 336 117 300  17  30 378
#> [361] 463 293 365 491 497 400 323  26 266 428  29  28 389 198 372  70 286 411
#> [379] 321 410 350 265 173 176 459 488 369 220 192 211 115  37 338 481 493 445
#> [397] 206  48 347  27 258   6 274 142
X_train <- X[index_train, ]
y_train <- y[index_train]
X_test <- X[-index_train, ]
y_test <- y[-index_train]

obj <- LazyDeepRegressor()
res <- obj$fit(X_train, X_test, y_train, y_test)
print(res[[1]])
#> [1] 0.8526364 0.8514566