
Incremental PCA via streaming co-moment updates (Geron Ch 7, morie.fn hmipca)
Source:R/geron_w4b_native.R
morie_geron_incremental_pca.RdIncremental PCA via streaming co-moment updates (Geron Ch 7, morie.fn hmipca)
Value
List with components, explained_variance, explained_variance_ratio, mean, n_samples_seen, n_batches, estimate, n, method.
Examples
X <- matrix(c(1, 2, 3, 4), ncol = 1)
morie_geron_incremental_pca(X, n_components = 1, batch_size = 2)
#> $components
#> [,1]
#> [1,] 1
#>
#> $explained_variance
#> [1] 1.666667
#>
#> $explained_variance_ratio
#> [1] 1
#>
#> $mean
#> [1] 2.5
#>
#> $covariance
#> [,1]
#> [1,] 1.666667
#>
#> $n_samples_seen
#> [1] 4
#>
#> $n_batches
#> [1] 2
#>
#> $estimate
#> [1] 1
#>
#> $n
#> [1] 4
#>
#> $method
#> [1] "Incremental PCA (streaming co-moment accumulation)"
#>