API reference

This page lists every public entry point exported from hypertools (see hypertools/__init__.py), organized roughly in the canonical pipeline order (GH #153): load/impute, manip, normalize, reduce, align, cluster, predict, plot/analyze, plus the model-application core, I/O helpers, and the text/reducer model families used by manip=/reduce=.

Load

load(dataset[, reduce, ndims, align, ...])

Load data from a built-in example dataset, a scikit-learn or seaborn named dataset, a local file, a Hugging Face dataset, Google Drive, Dropbox, or any URL

Save

save(obj, fname[, protocol])

Save obj to fname, choosing the output format from the file extension.

Impute

impute(data[, model, return_model])

Fill missing (NaN) values in data, preserving its shape.

Manip

manip(data[, model, return_model, ...])

Apply a manipulation (or chain of manipulations) to data.

Normalize

normalize(x[, normalize, internal, ...])

Z-transform the columns or rows of an array, or list of arrays

Reduce

reduce(x[, reduce, ndims, return_model, ...])

Reduces dimensionality of an array, or list of arrays

Autoencoder reducers (GH #162) – optional torch extra (pip install "hypertools[torch]"); pass by name (e.g. reduce='Autoencoder') or by class to hypertools.reduce:

reduce.autoencoders.Autoencoder([...])

A single-hidden-layer (shallow) autoencoder reducer.

reduce.autoencoders.SparseAutoencoder([...])

A single-hidden-layer autoencoder with an L1 penalty on the hidden activation (sparse coding), encouraging a sparser, more interpretable intermediate representation.

reduce.autoencoders.DeepAutoencoder([...])

A multi-layer autoencoder reducer with configurable depth.

reduce.autoencoders.ConvolutionalAutoencoder([...])

A 1-D convolutional autoencoder reducer: two Conv1d layers slide across the feature axis (treating each row as a length-n_features, 1-channel signal), exploiting local structure among adjacent features rather than treating every feature independently.

reduce.autoencoders.SequenceAutoencoder([...])

A GRU seq2seq autoencoder reducer for genuine timeseries/trajectory data: the ROWS of x are treated as one time-ordered sequence, and a latent vector is produced PER TIMEPOINT (transform(x) still returns (n_rows, n_components), one row per input row).

reduce.autoencoders.VariationalAutoencoder([...])

A variational autoencoder (VAE) reducer: a probabilistic encoder (mean + log-variance heads) trained with a KL-divergence term toward a standard normal prior, via the reparameterization trick.

Align

align(data[, model, return_model, manip, ...])

Aligns a list of datasets into a shared coordinate space.

align.procrustes(source, target[, scaling, ...])

Function to project from one space to another using Procrustean transformation (shift + scaling + rotation + reflection).

Cluster

cluster(x[, cluster, n_clusters, ...])

Performs clustering analysis and returns a list of cluster labels

Predict

predict(data[, model, t, return_model])

Forecast t new rows continuing each input dataset.

Plot

plot(x[, fmt, marker, markers, markersize, ...])

Plots dimensionality reduced data and parses plot arguments

HyperAnimation(figure, animation)

A (figure, animation) tuple with animation export/display helpers.

Set interactive backend

set_interactive_backend(backend)

Set the plotting backend hypertools uses.

Analyze

analyze(data[, manip, normalize, reduce, ...])

Wrapper function for manip -> normalize -> reduce -> align -> cluster transformations (the canonical 1.0 pipeline order, GH #153): each requested stage is applied to the previous stage's output, in that order (e.g. normalize= output feeds reduce=, whose output feeds align=).

Apply model

apply_model(data, model[, mode, ...])

Apply a model (or pipeline of models) to one or more datasets.

supported_models()

Names accepted as string model specifications.

Pipeline

hypertools.Pipeline chains fitted pipeline stages for reuse (GH #227 #161). Standalone dispatchers (hypertools.reduce, hypertools.manip, …) called with return_model=True return a hypertools.Pipeline when more than one stage ran (and the single fitted wrapper when only one stage ran); hypertools.plot’s return_model=True bundle always carries a hypertools.Pipeline under its 'pipeline' key, even for a single stage. A hypertools.Pipeline can be applied to new data via .transform() and passed back in via pipeline= to hypertools.plot/hypertools.analyze.

Pipeline(steps)

Chain hypertools model specs into one fit/transform-able object.

Describe

describe(x[, reduce, max_dims, show, ...])

Describe how well reduced data preserves the raw data's pairwise-distance structure, as a function of the number of dimensions

Text vectorization

tools.text2mat(data[, vectorizer, semantic, ...])

Turns a list of text samples into a matrix using a vectorizer and a text model

Gensim text models (GH #198) – optional gensim extra (pip install "hypertools[gensim]"); pass by name (e.g. vectorizer='Word2Vec') to hypertools.tools.text2mat:

tools.gensim_models.Word2VecVectorizer([...])

Vectorizer-stage model: a document's vector is the mean of its tokens' trained gensim Word2Vec word vectors (out-of-vocabulary tokens at transform time are skipped; a document with no known tokens gets the zero vector).

tools.gensim_models.Doc2VecVectorizer([...])

Vectorizer-stage model: a document's vector is either its trained gensim Doc2Vec tag vector (for documents seen during fit) or an inferred vector (Doc2Vec.infer_vector) for new documents at transform time.

tools.gensim_models.FastTextVectorizer([...])

Vectorizer-stage model: a document's vector is the mean of its tokens' trained gensim FastText word vectors.

tools.gensim_models.LdaVectorizer([...])

Semantic-stage model: gensim's LdaModel (Latent Dirichlet Allocation) trained over a bag-of-words corpus built internally from a dense document-term matrix (e.g. the output of a vectorizer-stage model).

tools.gensim_models.LsiVectorizer([...])

Semantic-stage model: gensim's LsiModel (Latent Semantic Indexing) trained over a bag-of-words corpus built internally from a dense document-term matrix.

tools.gensim_models.HdpVectorizer([...])

Semantic-stage model: gensim's HdpModel (Hierarchical Dirichlet Process), which discovers its own number of topics from the data rather than taking a fixed num_topics (unlike LdaVectorizer/ LsiVectorizer).

I/O

io.lsl_stream([name, type, timeout])

Resolve a live Lab Streaming Layer (LSL) stream and return it as a plain Python iterator of per-sample numeric vectors, compatible with hypertools.io.streaming.is_stream/row_to_vector -- so the result can be passed directly to hyp.plot(..., stream_init=..., stream_chunk= ...).

Exceptions

HyperTools’ I/O, backend, and remote-load/trust errors derive from hypertools.HypertoolsError. Input-validation errors (invalid parameters or data shapes) raise standard ValueError/TypeError with actionable messages.

HypertoolsError

Base class for all hypertools-specific exceptions.

HypertoolsBackendError(message)

Raised when a plotting backend (matplotlib/plotly) cannot satisfy a request.

HypertoolsIOError(message)

Raised for hypertools-specific I/O failures (e.g. loading/streaming data).

Tools

tools.format_data(x[, vectorizer, semantic, ...])

Formats data into a list of numpy arrays

tools.missing_inds(x[, format_data])

Returns indices of missing data

tools.df2mat(data[, return_labels])

Transforms a Pandas DataFrame into a Numpy array with binarized text columns