Skip to contents

Machine-readable properties of each decomposition algorithm available to decomp: whether the map is linear, whether it can be applied to new data, whether it inverts, and what its objective preserves.

Usage

decomposition_traits(algorithm = NULL)

Arguments

algorithm

Optional Character: Name of a decomposition algorithm, matched case-insensitively. NULL returns every algorithm.

Value

data.frame: One row per algorithm, one column per trait.

Details

The columns:

name

The name used by setup_<name>() and decomp(algorithm =).

description

Full name of the algorithm.

linear

The data is modeled as the components times a loadings matrix, which get_loadings returns.

can_apply

A fitted result can be applied to new data with apply_decomp.

invertible

There is an inverse map from component space back to input space, so reconstruction error is defined.

orthogonal

Components are mutually orthogonal.

ordered

Components come in a meaningful order, so "the first j" is well-defined.

deterministic

The same input and configuration give the same result without setting a seed.

preserves

What the objective preserves: "variance", "global", "local", or "reconstruction".

nonneg

Requires non-negative input and produces non-negative factors.

threaded

The fit runs on as many threads as the execution config gives the algorithm (n_workers_algorithm, or the worker count). Like can_apply, it states what rtemis implements.

package

Package supplying the backend implementation.

can_apply states what rtemis implements, not what is mathematically possible. Parametric tSNE exists and Isomap admits a Nystrom-style out-of-sample extension; neither is implemented here, so both are FALSE. The column's contract is that apply_decomp on a fitted result of this algorithm returns components.

Author

EDG

Examples

decomposition_traits()
#>                      name                                   description linear
#> 1             Autoencoder                           Autoencoder (torch)  FALSE
#> 2                     ICA                Independent Component Analysis   TRUE
#> 3                  Isomap                                        Isomap  FALSE
#> 4                     MDS                      Multidimensional Scaling  FALSE
#> 5                     NMF             Non-negative Matrix Factorization   TRUE
#> 6                     PCA                  Principal Component Analysis   TRUE
#> 7                    PCoA                Principal Coordinates Analysis  FALSE
#> 8                    tSNE   t-Distributed Stochastic Neighbor Embedding  FALSE
#> 9                    UMAP Uniform Manifold Approximation and Projection  FALSE
#> 10 VariationalAutoencoder               Variational autoencoder (torch)  FALSE
#>    can_apply invertible orthogonal ordered deterministic      preserves nonneg
#> 1       TRUE       TRUE      FALSE   FALSE         FALSE reconstruction  FALSE
#> 2       TRUE       TRUE      FALSE   FALSE         FALSE       variance  FALSE
#> 3      FALSE      FALSE      FALSE   FALSE          TRUE         global  FALSE
#> 4      FALSE      FALSE       TRUE   FALSE         FALSE         global  FALSE
#> 5       TRUE       TRUE      FALSE   FALSE         FALSE reconstruction   TRUE
#> 6       TRUE       TRUE       TRUE    TRUE          TRUE       variance  FALSE
#> 7       TRUE      FALSE       TRUE    TRUE          TRUE         global  FALSE
#> 8      FALSE      FALSE      FALSE   FALSE         FALSE          local  FALSE
#> 9       TRUE      FALSE      FALSE   FALSE         FALSE          local  FALSE
#> 10      TRUE       TRUE      FALSE   FALSE         FALSE reconstruction  FALSE
#>    threaded package
#> 1      TRUE   torch
#> 2     FALSE fastICA
#> 3     FALSE   vegan
#> 4     FALSE   vegan
#> 5     FALSE     NMF
#> 6     FALSE   stats
#> 7     FALSE   vegan
#> 8      TRUE   Rtsne
#> 9      TRUE    uwot
#> 10     TRUE   torch
decomposition_traits("PCA")
#>   name                  description linear can_apply invertible orthogonal
#> 1  PCA Principal Component Analysis   TRUE      TRUE       TRUE       TRUE
#>   ordered deterministic preserves nonneg threaded package
#> 1    TRUE          TRUE  variance  FALSE    FALSE   stats
# Which algorithms support out-of-sample projection?
decomposition_traits()[["name"]][decomposition_traits()[["can_apply"]]]
#> [1] "Autoencoder"            "ICA"                    "NMF"                   
#> [4] "PCA"                    "PCoA"                   "UMAP"                  
#> [7] "VariationalAutoencoder"