dimensionality_reduction DR

new DR(X, parameters) → {DR}

Takes the default parameters and seals them, remembers the type of input X, and initializes the random number generator.

Parameters:
NameTypeDescription
XMatrix | Array.<Array.<Number>>

the high-dimensional data.

parametersObject

Object containing parameterization of the DR method.

Properties
NameTypeAttributesDefaultDescription
dNumber<optional>
2

the dimensionality of the projection.

metricfunction<optional>
euclidean

the metric which defines the distance between two points.

seedNumber<optional>
1212

the seed value for the random number generator.

Returns:
Type: 
DR

Members

projection

Methods

(generator, static) generator(…args) → {Generator}

Computes the projection.

Parameters:
NameTypeAttributesDescription
argsunknown<repeatable>

Takes the same arguments of the constructor of the respective DR method.

Returns:

a generator yielding the intermediate steps of the dimensionality reduction method.

Type: 
Generator

(static) transform(…args) → {Matrix|Array}

Computes the projection.

Parameters:
NameTypeAttributesDescription
argsunknown<repeatable>

Takes the same arguments of the constructor of the respective DR method.

Returns:

the dimensionality reduced dataset.

Type: 
Matrix | Array

(async, static) transform_async(…args) → {Promise}

Computes the projection.

Parameters:
NameTypeAttributesDescription
argsunknown<repeatable>

Takes the same arguments of the constructor of the respective DR method.

Returns:

a promise yielding the dimensionality reduced dataset.

Type: 
Promise

check_init() → {DR}

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

Returns:
Type: 
DR

(generator) generator()

Computes the projection.

p(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.

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>.
'''

p(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.

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>.
'''

para(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.

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>.
'''

para(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.

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>.
'''

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.

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() → {Matrix}

Computes the projection.

Returns:

the projection.

Type: 
Matrix

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