/
You are viewing the documentation for metbit 1.4.5. Change release context

metbit.opls

Orthogonal Projection on Latent Structure (O-PLS)

import metbit.opls

Classes

OPLS

Methods

__init__(self)

TODO: 1. add arg for specifying the method for performing PLS

fit(self, x, y, n_comp=None, dot=np.dot)

Fit PLS model.

Parameters

xnp.ndarray

Variable matrix with size n samples by p variables.

ynp.ndarray

Dependent matrix with size n samples by 1, or a vector

n_compint

Number of components, default is None, which indicates that largest dimension which is smaller value between n and p will be used.

Returns

OPLS object

Reference

[1] Trygg J, Wold S. Projection on Latent Structure (OPLS). J Chemometrics. 2002, 16, 119-128. [2] Trygg J, Wold S. O2-PLS, a two-block (X-Y) latent variable regression (LVR) method with a integral OSC filter. J Chemometrics. 2003, 17, 53-64.

predict(self, X, n_component=None, return_scores=False)

Predict the new coming data matrx.

correct(self, x, n_component=None, return_scores=False, dot=np.dot)

Correction of X

Parameters

xnp.ndarray

Data matrix with size n by c, where n is number of samples, and c is number of variables

n_componentint | None

Number of components. If is None, the number of components used in fitting the model is used. Default is None.

return_scoresbool

Return orthogonal scores. Default is False.

Returns

xcnp.ndarray

Corrected data, with same matrix size with input X.

tnp.ndarray

Orthogonal score, n by n_component.

predictive_score(self, n_component=None)

Parameters

n_componentint

The component number.

Returns

np.ndarray The first predictive score.

ortho_score(self, n_component=None)

Parameters

n_componentint

The component number.

Returns

np.ndarray The first orthogonal score.

predictive_scores(self)

Orthogonal loadings.

predictive_loadings(self)

Predictive loadings.

weights_y(self)

y scores.

orthogonal_loadings(self)

Orthogonal loadings.

orthogonal_scores(self)

Orthogonal scores.

Source

metbit/opls.py at v1.4.5
Downloads for metbit 1.4.5PyPI and GitHub measure different distribution channels. Statistics refresh daily.

Counts are distribution activity, not unique users. GitHub source archives and Git clones are not included. Sources: PyPI Stats, Pepy, ClickPy, and GitHub Releases.

metbit 1.4.5 documentation