Skip to contents

Uses gbm if available; otherwise base-R boosted stumps.

Usage

morie_gradient_boosting_genomic(
  x,
  y,
  markers,
  n_estimators = 100,
  learning_rate = 0.1,
  max_depth = 3,
  seed = 0
)

Arguments

x

Optional fixed features.

y

Numeric response.

markers

(n x m) genotype matrix.

n_estimators

Boosting rounds.

learning_rate

Shrinkage.

max_depth

Tree depth (gbm only).

seed

Seed.

Value

list(estimate, y_hat, train_loss, se, n, method).

References

Friedman (2001); Montesinos Lopez Ch 9.

Examples

set.seed(1)
morie_gradient_boosting_genomic(
  x = rnorm(50), y = rnorm(50),
  markers = matrix(sample(0:2, 200, TRUE), 50, 4)
)
#> $estimate
#> [1] 0.02393097
#> 
#> $y_hat
#>  [1]  1.03536730 -0.21299865  0.87385902  0.88234350  0.15468100 -1.06910784
#>  [7] -0.65418883  0.40549623 -0.04553348  2.03655476  0.42864451 -0.75416869
#> [13] -0.67514531 -0.17748843 -0.03472631 -0.30830686  0.20840283 -0.54276002
#> [19]  0.30841358 -1.28841396  0.31416600  0.07711273  0.31507960  0.53990493
#> [25]  0.10601492  0.30830475  0.38744095 -0.63095361 -1.19218222  0.19437628
#> [31] -0.27734959 -0.44537017 -0.29238146 -0.30628223  0.77038659  0.64959395
#> [37]  0.91526454  0.09599991  0.70416473  0.10292787  1.00099874  0.55848407
#> [43] -0.24859950 -0.66873835 -0.95431386 -1.00684911 -1.28028207  0.45336946
#> [49]  0.53673230 -0.10139585
#> 
#> $train_loss
#>   [1] 0.7845954 0.7534960 0.7203575 0.6927776 0.6604459 0.6336335 0.6111653
#>   [8] 0.5835888 0.5555157 0.5397151 0.5161037 0.5023814 0.4825005 0.4706923
#>  [15] 0.4586390 0.4508646 0.4343883 0.4239537 0.4155017 0.4013001 0.3959039
#>  [22] 0.3837262 0.3746129 0.3670316 0.3547401 0.3474491 0.3396020 0.3332839
#>  [29] 0.3162834 0.3095028 0.3040734 0.3001874 0.2867419 0.2837397 0.2794487
#>  [36] 0.2686578 0.2629027 0.2592869 0.2546019 0.2490540 0.2443216 0.2397387
#>  [43] 0.2374610 0.2347401 0.2310717 0.2282147 0.2258692 0.2233563 0.2161141
#>  [50] 0.2140077 0.2117922 0.2099061 0.2079380 0.2062429 0.2003501 0.1986002
#>  [57] 0.1973469 0.1959612 0.1923391 0.1897627 0.1880971 0.1866766 0.1851929
#>  [64] 0.1838906 0.1792353 0.1778574 0.1734429 0.1721937 0.1710424 0.1652776
#>  [71] 0.1612673 0.1602175 0.1593808 0.1534191 0.1485902 0.1478555 0.1468490
#>  [78] 0.1459321 0.1448528 0.1439920 0.1430294 0.1422468 0.1413695 0.1405437
#>  [85] 0.1365981 0.1338323 0.1297306 0.1276517 0.1269370 0.1264498 0.1258314
#>  [92] 0.1250095 0.1221849 0.1197265 0.1191676 0.1184057 0.1162056 0.1141544
#>  [99] 0.1117846 0.1108687
#> 
#> $se
#> [1] 0.3329695
#> 
#> $n
#> [1] 50
#> 
#> $method
#> [1] "Gradient Boosting (native, regression)"
#>