Skip to contents

Explained variance ratio (Geron Ch 8, morie.fn grevr)

Usage

morie_geron_explained_variance_ratio(singular_values, threshold = 0.95)

Arguments

singular_values

Non-negative singular values.

threshold

Cumulative target in (0, 1].

Value

List with explained_variance_ratio, cumulative, n_components_for_threshold, total_variance.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_explained_variance_ratio(V)
#> $explained_variance_ratio
#> [1] 0.004901961 0.019607843 0.044117647 0.078431373 0.122549020 0.176470588
#> [7] 0.240196078 0.313725490
#> 
#> $cumulative
#> [1] 0.004901961 0.024509804 0.068627451 0.147058824 0.269607843 0.446078431
#> [7] 0.686274510 1.000000000
#> 
#> $n_components_for_threshold
#> [1] 8
#> 
#> $total_variance
#> [1] 204
#> 
#> $threshold
#> [1] 0.95
#> 
#> $estimate
#> [1] 0.004901961 0.019607843 0.044117647 0.078431373 0.122549020 0.176470588
#> [7] 0.240196078 0.313725490
#> 
#> $n
#> [1] 8
#>