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

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]  0.86289651 -0.18087736  0.89639877  0.72313231  0.22074017 -0.90530224
#>  [7] -0.29694997  0.44143177 -0.02157773  1.77312785  0.41835982 -0.70696423
#> [13] -0.64027223 -0.28586197  0.09730718 -0.26132782  0.21731189 -0.36047455
#> [19]  0.26005932 -1.21767151  0.40906909  0.03154461  0.17353591  0.38436546
#> [25]  0.04235030  0.27507214  0.31173760 -0.49463419 -0.89550837  0.04250941
#> [31] -0.31420178 -0.21001059 -0.35710091 -0.28001423  0.67177348  0.57410003
#> [37]  0.63320071  0.27704488  0.59818555  0.18747110  0.84924353  0.49163373
#> [43] -0.18170751 -0.66802486 -1.00529801 -0.98920821 -1.31225764  0.38668733
#> [49]  0.45186330  0.07964082
#> 
#> $train_loss
#>   [1] 0.7894313 0.7628687 0.7374605 0.7181203 0.6981256 0.6721483 0.6558396
#>   [8] 0.6354018 0.6180987 0.6021664 0.5857415 0.5721859 0.5598118 0.5494457
#>  [15] 0.5376369 0.5275836 0.5175228 0.5072916 0.5001532 0.4926442 0.4813566
#>  [22] 0.4685166 0.4608259 0.4521223 0.4423903 0.4350228 0.4293897 0.4220147
#>  [29] 0.4140500 0.4071444 0.4009809 0.3944230 0.3882619 0.3825244 0.3786116
#>  [36] 0.3729842 0.3676808 0.3628717 0.3588943 0.3543743 0.3493086 0.3458399
#>  [43] 0.3403830 0.3361524 0.3327553 0.3300705 0.3263713 0.3234159 0.3198687
#>  [50] 0.3171225 0.3124473 0.3084432 0.3045072 0.2963967 0.2934732 0.2901514
#>  [57] 0.2868690 0.2846752 0.2819527 0.2792812 0.2767862 0.2743601 0.2719800
#>  [64] 0.2696785 0.2674866 0.2620137 0.2599101 0.2579328 0.2560462 0.2528406
#>  [71] 0.2507443 0.2490441 0.2446091 0.2427152 0.2411386 0.2341348 0.2302419
#>  [78] 0.2285262 0.2270745 0.2234771 0.2210475 0.2176761 0.2159056 0.2100769
#>  [85] 0.2072517 0.2024615 0.2009410 0.1970295 0.1958884 0.1943061 0.1932379
#>  [92] 0.1898765 0.1869546 0.1855785 0.1845298 0.1821172 0.1791902 0.1765685
#>  [99] 0.1741031 0.1717982
#> 
#> $se
#> [1] 0.4144855
#> 
#> $n
#> [1] 50
#> 
#> $method
#> [1] "gbm::gbm"
#>