Skip to content

Retina matrix functions

Tobias Paczian edited this page Apr 11, 2018 · 3 revisions

Using the Retina matrix functions requires loading of the numeric.min.js module in the Retina/js directory via Retina.require('numeric.min.js').

pca

Retina.pca(matrix)

Given a distance matrix matrix as is returned from Retina.distanceMatrix returns an object with the properties coordinates containing the pca matrix and weights containing a list of dimension weights.


transpose

Retina.transpose(matrix)

Returns the matrix transposed along the x-y-diagonal.


logMatrix

Retina.logMatrix(matrix)

Returns the matrix with log10 called on every element.


standardizeMatrix

Retina.standardizeMatrix(matrix)

Returns a standardized version of matrix, see standardization.


normalizeMatrix

Retina.normalizeMatrix(matrix)

Returns a normalized version of matrix where each cell is divided by the sum of its column.


scaleMatrix

Retina.scaleMatrix(matrix)

Returns a scaled version of matrix where each cell is divided by the maximum of its column.


heatMatrix

Retina.heatMatrix(matrix)

Returns a heatmap matrix of matrix.


average

Retina.average(vector)

Returns the average value of the elements in vector.


distanceMatrix

Retina.distanceMatrix(matrix, measure)

Returns the distance matrix of matrix. The measure defaults to euclidean distance and can be one of

  • euclidean
  • maximum
  • manhattan
  • minkowski
  • braycurtis

copyMatrix

Retina.copyMatrix(matrix)

Returns a copy of matrix which does not maintain a reference to the original.


roundMatrix

Retina.roundMatrix(matrix, precision)

Returns matrix with every entry rounded to precision.

Clone this wiki locally