hypertools
hypertools copied to clipboard
sequences of analysis operations
we may want a way to support sequences of operations. for example, could we come up with an elegant way of supporting something like:
- reduce data to n1 dimensions using algorithm 1
- align data using hyperalignment
- reduce the aligned data to n2 dimensions using algorithm 2
- align the result using SRM
- project the (twice-)aligned data onto 3d using algorithm 3
if we add a preprocess function, we may want to apply multiple preprocessing steps in sequence (e.g. normalize, than binarize, etc.).
another thought is to support a convenient syntax for something like:
hyp.plot(hyp.tools.reduce(x, model='TSNE', ndims=10), model='SpectralEmbedding')
Instead, we could support the following syntax:
hyp.plot(x, model=['TSNE', 'SpectralEmbedding'], ndims=[10, 3])
Also noting (per discussion with @andrewheusser), we could consider supporting something like
hyp.plot(x, xform=[{'reduce': 'TSNE', 'params': {...}}, {'normalize': 'across'}, {'reduce': 'IncrementalPCA'}, {'normalize': 'within'}, {'align': 'hyperalignment'}, {'reduce': 'SpectralEmbedding'}])
In other words, allow an xform keyword argument that takes a list of dictionaries, each specifying a transformation to apply to the data (in sequence).
We'd also have to modify the DataGeometry.transform function to support this.
Upside: it's more flexible and allows the user to do whatever crazy stuff they want (argues for a democratic approach?) Downside: it's more flexible and allows the user to do crazy stuff, even if it makes no sense (argues for a fascist approach?)