SkLDA

class SkLDA(lda)[source]

A wrapper for the scikit-learn linear discriminant analysis.

Note

This class requires that scikit-learn is installed.

Parameters:

lda (LinearDiscriminantAnalysis) – The sklearn linear discriminant analysis. This may be a trained or an untrained discriminator.

Raises:

DataProcessorError – If SKlearn could not be imported.

Attributes

discriminator

Return then SKLearn object.

Methods

config()[source]

Return the configuration of the LDA.

Return type:

Dict[str, Any]

fit(data, labels)[source]

Fit the LDA.

Parameters:
  • data (List) – The independent data.

  • labels (List) – The labels corresponding to data.

classmethod from_config(config)[source]

Deserialize from an object.

Return type:

SkLDA

is_trained()[source]

Return True if the discriminator has been trained on data.

Return type:

bool

predict(data)[source]

Wrap the predict method of the LDA.