hypertools.tools.reduce¶
- hypertools.tools.reduce(x, reduce='IncrementalPCA', ndims=None, normalize=None, align=None, model=None, model_params=None, internal=False, format_data=True)[source]¶
Reduces dimensionality of an array, or list of arrays
- Parameters:
- xNumpy array or list of arrays
Dimensionality reduction using PCA is performed on this array.
- reducestr or dict
Decomposition/manifold learning model to use. Models supported: PCA, IncrementalPCA, SparsePCA, MiniBatchSparsePCA, KernelPCA, FastICA, FactorAnalysis, TruncatedSVD, DictionaryLearning, MiniBatchDictionaryLearning, TSNE, Isomap, SpectralEmbedding, LocallyLinearEmbedding, MDS and UMAP. Can be passed as a string, but for finer control of the model parameters, pass as a dictionary, e.g. reduce={‘model’ : ‘PCA’, ‘params’ : {‘whiten’ : True}}. See scikit-learn specific model docs for details on parameters supported for each model.
- ndimsint
Number of dimensions to reduce
- format_databool
Whether or not to first call the format_data function (default: True).
- modelNone
Deprecated argument. Please use reduce.
- model_paramsNone
Deprecated argument. Please use reduce.
- alignNone
Deprecated argument. Please use new analyze function to perform combinations of transformations
- normalizeNone
Deprecated argument. Please use new analyze function to perform combinations of transformations
- Returns:
- x_reducedNumpy array or list of arrays
The reduced data with ndims dimensionality is returned. If the input is a list, a list is returned.