ContextLab / hypertools

A Python toolbox for gaining geometric insights into high-dimensional data
http://hypertools.readthedocs.io/en/latest/
MIT License
1.81k stars 161 forks source link

sequences of analysis operations #153

Open jeremymanning opened 6 years ago

jeremymanning commented 6 years ago

we may want a way to support sequences of operations. for example, could we come up with an elegant way of supporting something like:

jeremymanning commented 6 years ago

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])

jeremymanning commented 6 years ago

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?)