dimensionality_reduction TriMap

new TriMap(X, parameters) → {TriMap}

Parameters:
NameTypeDescription
XMatrix

the high-dimensional data.

parametersobject

Object containing parameterization of the DR method.

Properties
NameTypeAttributesDefaultDescription
weight_adjnumber<optional>
500

scaling factor.

cnumber<optional>
5

number of triplets multiplier.

dnumber<optional>
2

the dimensionality of the projection.

tolnumber<optional>
1e-8
metricfunction<optional>
euclidean

the metric which defines the distance between two points.

seednumber<optional>
1212

the seed for the random number generator.

Returns:
Type: 
TriMap

Extends

Members

projection

Overrides

Methods

_generate_triplets(n_inliers, n_outliers, n_random)

Generates n_inliers x n_outliers x n_random triplets.

Parameters:
NameTypeDescription
n_inliersnumber
n_outliersnumber
n_randomnumber

_grad(Y)

Computes the gradient for updating the embedding.

Parameters:
NameTypeDescription
YMatrix

The embedding

check_init() → {DR}

If the respective DR method has an init function, call it before transform.

Overrides
Returns:
Type: 
DR

(generator) generator(max_iteration) → {Matrix|Array.<Array.<number>>}

Parameters:
NameTypeDefaultDescription
max_iterationnumber800
Overrides
Returns:
Type: 
Matrix | Array.<Array.<number>>
Yields:
Type: 
Matrix | Array.<Array.<number>>

init(pcaopt, knnopt)

Parameters:
NameTypeAttributesDefaultDescription
pcaMatrix<optional>
null

Initial Embedding (if null then PCA gets used).

knnKNN<optional>
null

KNN Object (if null then BallTree gets used).

parameter(nameopt, valueopt) → {DR|any|object}

Set and get parameters

Parameters:
NameTypeAttributesDefaultDescription
namestring<optional>
null

Name of the parameter. If not given then returns all parameters as an Object.

valueany<optional>
null

Value of the parameter to set. If name is set and value is not given, returns the value of the respective parameter.

Overrides
Returns:

On setting a parameter, this function returns the DR object. If name is set and value == null then return actual parameter value. If name is not given, then returns all parameters as an Object.

Type: 
DR | any | object
Example
'''
const DR = new druid.TSNE(X, {d: 3}); // creates a new DR object, with parameter for <code>d</code> = 3.
DR.parameter("d"); // returns 3,
DR.parameter("d", 2); // sets parameter <code>d</code> to 2 and returns <code>DR</code>.
'''

transform(max_iteration) → {Matrix|Array.<Array.<number>>}

Parameters:
NameTypeDefaultDescription
max_iterationnumber400
Overrides
Returns:
Type: 
Matrix | Array.<Array.<number>>

(async) transform_async(…args) → {Promise.<(Matrix|Array.<Array.<number>>)>}

Computes the projection.

Parameters:
NameTypeAttributesDescription
argsunknown<repeatable>

Arguments the transform method of the respective DR method takes.

Returns:

the dimensionality reduced dataset.

Type: 
Promise.<(Matrix|Array.<Array.<number>>)>