Skip to contents

Native random forest (ESL Algorithm 15.1) over combined covariate and marker fallback (regression CART approximation).

Usage

morie_random_forest_genomic(
  x,
  y,
  markers,
  n_trees = 100,
  max_depth = 10,
  min_samples = 2,
  mtry = NULL,
  seed = 0
)

Arguments

x

Optional fixed features.

y

Numeric response.

markers

Genotype matrix (n x m).

n_trees

Number of trees.

max_depth

Max depth (fallback only).

min_samples

Min samples per node.

mtry

Features sampled per split (default sqrt(p)).

seed

Seed.

Value

list(estimate, y_hat, oob_score, feature_importance, se, n, method).

References

Breiman (2001); Montesinos Lopez Ch 8.

Examples

set.seed(1)
morie_random_forest_genomic(
  x = rnorm(50), y = rnorm(50),
  markers = matrix(sample(0:2, 200, TRUE), 50, 4)
)
#> $estimate
#> [1] 0.005300609
#> 
#> $y_hat
#>  [1]  0.601021073  0.073892922  0.358332513  0.635914141  0.072803690
#>  [6] -0.899057402 -0.133313539  0.191114079 -0.028310612  0.655208427
#> [11]  0.160660710 -0.530672137 -0.546260452 -0.468853160  0.089182862
#> [16] -0.088451233  0.174883859 -0.247361500  0.213669675 -0.438418786
#> [21]  0.345815845  0.079480339 -0.063872677  0.340564506  0.001411853
#> [26]  0.220615924  0.112383613 -0.380426352 -0.530173655  0.039979203
#> [31] -0.108819709 -0.072618898  0.023218086 -0.097667000  0.494791773
#> [36]  0.187264141  0.295024912  0.178525584  0.571906142 -0.186361756
#> [41]  0.656649222  0.290303335  0.019158440 -0.388294823 -0.816228185
#> [46] -0.836425073 -0.523170759  0.355480390  0.321025428 -0.110494542
#> 
#> $oob_score
#> [1] -0.3040376
#> 
#> $feature_importance
#> [1] 0.45320959 0.16583864 0.16114589 0.13988955 0.07991634
#> 
#> $se
#> [1] 0.5980891
#> 
#> $n
#> [1] 50
#> 
#> $method
#> [1] "Random Forest (native, regression)"
#>