FluidPCA:
Filter:
Classes (extension) | Libraries > FluidCorpusManipulation

FluidPCA : FluidModelObject : FluidDataObject : FluidServerObject : Object
ExtensionExtension

Principal Component Analysis
Source: FluidPCA.sc

Description

Principal Components Analysis (PCA) of a FluidDataSet.

PCA fits to a DataSet to determine its principal components, each of which is a new axis through the data that maximises the variance, or “differences”, within the Data. PCA can then transform the original DataSet or individual points to position them in relation to the principal components (i.e., “new axes”) for better comparing how they differ from other points in the DataSet. PCA is often used for dimensionality reduction and is also useful for removing redundancy (i.e., correlation) and/or noise (i.e., dimensions that are uniformly distributed) from a DataSet.

Read more about FluidPCA on the learn platform.

Class Methods

FluidPCA.new(server, numDimensions: 2, whiten: 0)

Arguments:

server

The Server on which to construct this object

numDimensions

The number of dimensions (principal components) to keep after a transform, using PCA for dimensionality reduction.

Constraints

  • Minimum: 1
whiten

A flag (0 or 1) indicating whether or not to perform "whitening" on the output of PCA. For more information on whitening, visit https://learn.flucoma.org/reference/pca

Inherited class methods

Instance Methods

.numDimensions

.numDimensions = value

Property for numDimensions. See new

.whiten

.whiten = value

Property for whiten. See new

.fit(dataSet, action)

Train this model on a FluidDataSet to determine the principal components, but don't transform any data.

Arguments:

dataSet

A FluidDataSet to analyse

action

A function to execute when the server has completed running fit

.transform(sourceDataSet, destDataSet, action)

Given a trained model, transform a source FluidDataSet into the PCA-space and write to a destination DataSet. The DataSets can be the same for both input and output (performs the operation in-place). This process returns the fraction (between 0 and 1) of explained variance.

Arguments:

sourceDataSet

source DataSet

destDataSet

destination DataSet

action

A function to execute when the server has completed running transform

.fitTransform(sourceDataSet, destDataSet, action)

fit and transform in a single pass. Returns the fraction (between 0 and 1) of explained variance.

Arguments:

sourceDataSet

source DataSet

destDataSet

destination DataSet

action

A function to execute when the server has completed running fitTransform

.inverseTransform(sourceDataSet, destDataSet, action)

Given a trained model, invert a source FluidDataSet containing numDimensions dimensions that are in PCA-space to a destination FluidDataSet with the dimensionality of the data that was used to fit. FluidDataSet can be the same for both input and output (the operation will be performed in-place).

Arguments:

sourceDataSet

source DataSet

destDataSet

destination DataSet

action

A function to execute when the server has completed running inverseTransform

.transformPoint(sourceBuffer, destBuffer, action)

Given a trained model, transform the data point in sourceBuffer from the original dimensional space to numDimensions in PCA-space and write the result into destBuffer.

Arguments:

sourceBuffer

Input data

destBuffer

Output data

action

A function to execute when the server has completed running transformPoint

.inverseTransformPoint(sourceBuffer, destBuffer, action)

Given a trained model, transform the data point in sourceBuffer from being numDimensions in PCA-space into the original dimensional space and write into destBuffer.

Arguments:

sourceBuffer

Input data

destBuffer

Output data

action

A function to execute when the server has completed running inverseTransformPoint

.cols(action)

From superclass: FluidDataObject

The number of columns (dimensions) in this model or dataset / labeset

Arguments:

action

A function to execute when the server has completed running cols

.size(action)

From superclass: FluidDataObject

The number of data points (entries / observations) in this model or dataset / labeset

Arguments:

action

A function to execute when the server has completed running size

.clear

From superclass: Object

Resets the internal state of the model

Arguments:

(action)

A function to execute when the server has completed running clear

.load(dict, action)

From superclass: FluidDataObject

Replace the internal state of the object from a Dictionary.

Arguments:

dict
action

A function to execute when the server has completed running load

.dump(action)

From superclass: FluidDataObject

Dump the state of this object as a Dictionary, which will be passed to the action function provided. This object must first be fit``ted before ``dump can be called.

Arguments:

action

A function to execute when the server has completed running dump

.read(filename, action)

From superclass: FluidDataObject

Replace the internal state of the object from a JSON file on disk.

Arguments:

filename

Path of the file to load from

action

A function to execute when the server has completed running read

.write(filename, action)

From superclass: FluidDataObject

Save the internal state of the object to a JSON file on disk. This object must first be fit before write can be called.

Arguments:

filename

Path of the file to load from

action

A function to execute when the server has completed running write

Inherited instance methods

Undocumented instance methods

.fitMsg(dataSet)

.fitTransformMsg(sourceDataSet, destDataSet)

.inverseTransformMsg(sourceDataSet, destDataSet)

.inverseTransformPointMsg(sourceBuffer, destBuffer)

.kr(trig, inputBuffer, outputBuffer, numDimensions)

.prGetParams

.transformMsg(sourceDataSet, destDataSet)

.transformPointMsg(sourceBuffer, destBuffer)

Examples

Dimensionality Reduction

Server-side queries

Whitening