Skip to content

CCA

Defined in: ds/src/mva/estimators/CCA.js:10

Extends

  • Transformer

Constructors

Constructor

new CCA(params?): CCA

Defined in: ds/src/mva/estimators/CCA.js:11

Parameters

params?

Returns

CCA

Overrides

Transformer.constructor

Properties

_state

_state: object

Defined in: ds/src/core/estimators/estimator.js:27

Inherited from

Transformer._state


_warnings

_warnings: any[]

Defined in: ds/src/core/estimators/estimator.js:29

Inherited from

Transformer._warnings


fitted

fitted: boolean

Defined in: ds/src/core/estimators/estimator.js:25

Inherited from

Transformer.fitted


model

model: any

Defined in: ds/src/mva/estimators/CCA.js:13


params

params: any

Defined in: ds/src/core/estimators/estimator.js:24

Inherited from

Transformer.params

Methods

_prepareArgsForFit()

_prepareArgsForFit(args?): { columns?: undefined; columnsX: any[]; prepared: boolean; raw?: undefined; rows: any[]; X: any[][]; y: any[]; } | { columns: any[]; columnsX?: undefined; prepared: boolean; raw?: undefined; rows: any[]; X: any[][]; y?: undefined; } | { columns?: undefined; columnsX?: undefined; prepared?: undefined; raw: any[]; rows?: undefined; X?: undefined; y?: undefined; }

Defined in: ds/src/core/estimators/estimator.js:367

Convenience helper: parse arguments passed to fit/predict/transform.

Supports declarative table-style inputs:

  • fit({ X, y, data, omit_missing })
  • fit({ data, columns, … })

Returns an object { X, y, prepared, rows } where X/y are numeric arrays if preparation was required, otherwise returns the original values.

Note: this helper only prepares numeric matrices/vectors using core table utilities; it does not perform encoding of categorical predictors.

Parameters

args?

any[] = []

Returns

{ columns?: undefined; columnsX: any[]; prepared: boolean; raw?: undefined; rows: any[]; X: any[][]; y: any[]; } | { columns: any[]; columnsX?: undefined; prepared: boolean; raw?: undefined; rows: any[]; X: any[][]; y?: undefined; } | { columns?: undefined; columnsX?: undefined; prepared?: undefined; raw: any[]; rows?: undefined; X?: undefined; y?: undefined; }

Inherited from

Transformer._prepareArgsForFit


_repr_html_()

_repr_html_(): string

Defined in: ds/src/core/estimators/estimator.js:201

Observable/Jupyter HTML representation

Returns

string

HTML representation

Inherited from

Transformer._repr_html_


clearWarnings()

clearWarnings(): void

Defined in: ds/src/core/estimators/estimator.js:139

Clear all warnings

Returns

void

Inherited from

Transformer.clearWarnings


fit()

fit(X, Y?, opts?): CCA

Defined in: ds/src/mva/estimators/CCA.js:26

Fit the CCA model on paired data sets X and Y.

Accepts a positional numeric call (fit(X, Y[, opts])) or a declarative { data, X, Y } object (fit({ data, X, Y, columnsX, columnsY })).

Parameters

X

any

First data matrix (n samples × p features), or a declarative { data, X, Y } object

Y?

number[][] = null

Second data matrix (n samples × q features), for the positional call form

opts?

any = {}

Fitting options (used for the positional call form)

Returns

CCA

The fitted estimator (for chaining)

Overrides

Transformer.fit


fitTransform()

fitTransform(…args): void

Defined in: ds/src/core/estimators/estimator.js:683

Convenience: fit then transform Returns transformed data.

Parameters

args

any[]

Returns

void

Inherited from

Transformer.fitTransform


getMemoryUsage()

getMemoryUsage(): string

Defined in: ds/src/core/estimators/estimator.js:97

Get memory usage in human-readable format

Returns

string

Memory usage string (e.g., “2.3 MB” or “145 KB”)

Inherited from

Transformer.getMemoryUsage


getParams()

getParams(): any

Defined in: ds/src/core/estimators/estimator.js:294

Get a shallow copy of parameters.

Returns

any

Inherited from

Transformer.getParams


getState()

getState(): any

Defined in: ds/src/core/estimators/estimator.js:65

Get comprehensive model state

Returns

any

State information including fitted status, memory estimate, warnings

Inherited from

Transformer.getState


getWarnings()

getWarnings(): any[]

Defined in: ds/src/core/estimators/estimator.js:124

Get all warnings

Returns

any[]

Array of warning objects

Inherited from

Transformer.getWarnings


getWarningsByType()

getWarningsByType(type): any[]

Defined in: ds/src/core/estimators/estimator.js:148

Get warnings of a specific type

Parameters

type

string

Warning type

Returns

any[]

Filtered warnings

Inherited from

Transformer.getWarningsByType


hasWarnings()

hasWarnings(): boolean

Defined in: ds/src/core/estimators/estimator.js:132

Check if model has warnings

Returns

boolean

Inherited from

Transformer.hasWarnings


isFitted()

isFitted(): boolean

Defined in: ds/src/core/estimators/estimator.js:36

Check if model is fitted

Returns

boolean

Inherited from

Transformer.isFitted


predict()

predict(): void

Defined in: ds/src/core/estimators/estimator.js:424

Predict should be implemented by supervised estimators.

Returns

void

Inherited from

Transformer.predict


save()

save(): string

Defined in: ds/src/core/estimators/estimator.js:329

Save model to JSON string

Returns

string

JSON representation of the model

Inherited from

Transformer.save


setParams()

setParams(params?): CCA

Defined in: ds/src/core/estimators/estimator.js:285

Set parameters (mutates instance).

Parameters

params?

any = {}

Returns

CCA

Inherited from

Transformer.setParams


summary()

summary(): object

Defined in: ds/src/mva/estimators/CCA.js:87

Returns

object

correlations

correlations: any

nComponents

nComponents: any

nSamples

nSamples: any


toJSON()

toJSON(): object

Defined in: ds/src/mva/estimators/CCA.js:98

Serialize minimal model metadata. Subclasses may override to include learned parameters.

Returns

object

__class__

__class__: string = 'CCA'

fitted

fitted: boolean

model

model: any

params

params: any

Overrides

Transformer.toJSON


transform()

transform(X, Y, opts?): any

Defined in: ds/src/mva/estimators/CCA.js:80

Project new X and Y data onto their fitted canonical variates.

Parameters

X

any

X data matrix (n samples × p features), or a declarative { data, columns } object

Y

any

Y data matrix (n samples × q features), or a declarative { data, columns } object

opts?

any = {}

Transform options

Returns

any

Object with xScores and yScores arrays of canonical score objects

Overrides

Transformer.transform


transformX()

transformX(X, opts?): any[]

Defined in: ds/src/mva/estimators/CCA.js:53

Project new X data onto the fitted X canonical variates.

Parameters

X

any

X data matrix (n samples × p features), or a declarative { data, columns } object

opts?

any = {}

Transform options

Returns

any[]

Canonical score objects, one per row (keyed cca1, cca2, …)


transformY()

transformY(Y, opts?): any[]

Defined in: ds/src/mva/estimators/CCA.js:66

Project new Y data onto the fitted Y canonical variates.

Parameters

Y

any

Y data matrix (n samples × q features), or a declarative { data, columns } object

opts?

any = {}

Transform options

Returns

any[]

Canonical score objects, one per row (keyed cca1, cca2, …)


fromJSON()

static fromJSON(obj?): CCA

Defined in: ds/src/mva/estimators/CCA.js:107

Basic deserialization. Subclasses should override if they need to restore learned arrays / matrices.

Parameters

obj?

Returns

CCA

Overrides

Transformer.fromJSON


load()

static load(jsonString): Estimator

Defined in: ds/src/core/estimators/estimator.js:346

Load model from JSON string

Parameters

jsonString

string

JSON representation

Returns

Estimator

Reconstructed estimator instance

Inherited from

Transformer.load