Tensor pluginο
Introductionο
The spectrochempy-tensor plugin provides tensor decomposition classes backed
by TensorLy. Keeping these algorithms in a plugin lets the core package remain
independent from tensor-specific dependencies while preserving integrated access
when the plugin is installed.
Installationο
pip install spectrochempy[tensor]
or directly:
pip install spectrochempy-tensor
Recommended APIο
import spectrochempy as scp
model = scp.tensor.CP(n_components=2)
model.fit(dataset)
factors = model.result.factors
weights = model.result.weights
Compatibility aliasesο
The historical scp.CP alias is kept as a deprecated compatibility path, but
new documentation and examples should use scp.tensor.CP.
Direct accessors such as model.A, model.B, model.C, and
model.weights remain available.
API Referenceο
The generated public API page for the Tensor plugin is listed in
Plugin public API reference. See spectrochempy.tensor.CP.
Examplesο
Use the package-level scp.tensor.CP(...) estimator shown above for
TensorLy-backed CP/PARAFAC workflows on existing datasets.
Limitationsο
Tensor decomposition implementations live under
spectrochempy_tensor.decompositions. This page currently focuses on the
main CP/PARAFAC workflow exposed through scp.tensor.CP(...).