Spyral.Analysis()

The Analysis class in Spyral. Used as an alternative to Spyral.Corpus#analysis for sending vectors directly to the dimension reduction algorithms.

Methods

static ca(vectors, dimensionsopt) → {Promise.<Array>}

Performs Correspondence Analysis on the provided vectors.

Parameters:
Name Type Attributes Default Description
vectors Array

A 2 dimensional array of numbers.

dimensions Number <optional>
2

The number of dimensions to reduce to. Default is 2.

Returns:
Promise.<Array>
Example
Spyral.Analysis.ca([[2,3,5],[1,3,4],[3,2,1],[6,5,6],[2,4,1]]);

static pca(vectors, dimensionsopt) → {Promise.<Array>}

Performs Principal Components Analysis on the provided vectors.

Parameters:
Name Type Attributes Default Description
vectors Array

A 2 dimensional array of numbers.

dimensions Number <optional>
2

The number of dimensions to reduce to. Default is 2.

Returns:
Promise.<Array>
Example
Spyral.Analysis.pca([[2,3,5],[1,3,4],[3,2,1],[6,5,6],[2,4,1]]);

static tsne(vectors, dimensionsopt, perplexityopt, iterationsopt) → {Promise.<Array>}

Perform TSNE Analysis on the provided vectors.

Parameters:
Name Type Attributes Default Description
vectors Array

A 2 dimensional array of numbers.

dimensions Number <optional>
2

The number of dimensions to reduce to. Default is 2.

perplexity Number <optional>
15

The perplexity measure. Default is 15.

iterations Number <optional>
1500

The number of times to iterate. Default is 1500.

Returns:
Promise.<Array>
Example
Spyral.Analysis.tsne([[2,3,5],[1,3,4],[3,2,1],[6,5,6],[2,4,1]]);