spectrochempy.Pipeline

class Pipeline(steps)[source]

Linear composition of allowlisted SpectroChemPy preprocessing and estimators.

The supplied steps are templates. Calling fit clones those templates, fits the clones, and exposes fitted runtime state through fitted_steps_ and fitted_named_steps_.

Attributes Summary

fitted_named_steps_

Return a read-only mapping of fitted step names to fitted steps.

fitted_steps_

Return ordered fitted (name, step) pairs.

named_steps

Return a read-only mapping of template step names to steps.

steps

Return ordered template (name, step) pairs.

Methods Summary

fit(X[,Β y])

Fit the pipeline on X and optional supervised target y.

fit_transform(X[,Β y])

Fit the pipeline and transform X with the fitted pipeline.

get_params([deep])

Return template configuration parameters.

predict(X)

Predict from X with an estimator-final fitted pipeline.

score(X[,Β y])

Score predictions from X against y with a fitted final estimator.

set_params(**params)

Transactionally update template steps or nested template parameters.

transform(X)

Transform X with a transformer-final fitted pipeline.

Attributes Documentation

fitted_named_steps_

Return a read-only mapping of fitted step names to fitted steps.

fitted_steps_

Return ordered fitted (name, step) pairs.

named_steps

Return a read-only mapping of template step names to steps.

steps

Return ordered template (name, step) pairs.

Methods Documentation

fit(X, y=None)[source]

Fit the pipeline on X and optional supervised target y.

Intermediate preprocessing transformers receive only the current dataset. A supervised final estimator receives the transformed dataset and y.

fit_transform(X, y=None)[source]

Fit the pipeline and transform X with the fitted pipeline.

get_params(deep=True)[source]

Return template configuration parameters.

With deep=True, each template is exposed under its step name and its constructor parameters under step__parameter keys.

predict(X)[source]

Predict from X with an estimator-final fitted pipeline.

score(X, y=None)[source]

Score predictions from X against y with a fitted final estimator.

set_params(**params)[source]

Transactionally update template steps or nested template parameters.

transform(X)[source]

Transform X with a transformer-final fitted pipeline.

Examples using spectrochempy.Pipeline

PLS regression with a Pipeline

PLS regression with a Pipeline