new TriMap(X, parameters) → {TriMap}
Name | Type | Description | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
X | Matrix | the high-dimensional data. | |||||||||||||||||||||||||||||||||||
parameters | object | Object containing parameterization of the DR method. Properties
|
- Source
- Type:
- TriMap
Extends
Members
projection
- Overrides
- Source
Methods
_generate_triplets(n_inliers, n_outliers, n_random)
Generates n_inliers
x n_outliers
x n_random
triplets.
Name | Type | Description |
---|---|---|
n_inliers | number | |
n_outliers | number | |
n_random | number |
- Source
_grad(Y)
Computes the gradient for updating the embedding.
Name | Type | Description |
---|---|---|
Y | Matrix | The embedding |
- Source
check_init() → {DR}
If the respective DR method has an init
function, call it before transform
.
- Overrides
- Source
- Type:
- DR
(generator) generator(max_iteration) → {Matrix|Array.<Array.<number>>}
Name | Type | Default | Description |
---|---|---|---|
max_iteration | number | 800 |
- Overrides
- Source
- Type:
- Matrix |
Array.<Array.<number>>
- Type:
- Matrix |
Array.<Array.<number>>
init(pcaopt, knnopt)
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pca | Matrix | <optional> | null | Initial Embedding (if null then PCA gets used). |
knn | KNN | <optional> | null | KNN Object (if null then BallTree gets used). |
- Source
parameter(nameopt, valueopt) → {DR|any|object}
Set and get parameters
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
name | string | <optional> | null | Name of the parameter. If not given then returns all parameters as an Object. |
value | any | <optional> | null | Value of the parameter to set. If |
- Overrides
- Source
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
'''
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>>}
Name | Type | Default | Description |
---|---|---|---|
max_iteration | number | 400 |
- Overrides
- Source
- Type:
- Matrix |
Array.<Array.<number>>
(async) transform_async(…args) → {Promise.<(Matrix|Array.<Array.<number>>)>}
Computes the projection.
Name | Type | Attributes | Description |
---|---|---|---|
args | unknown | <repeatable> | Arguments the transform method of the respective DR method takes. |
- Overrides
- Source
the dimensionality reduced dataset.
- Type:
- Promise.<(Matrix|Array.<Array.<number>>)>