Back to API
API Documentation
opls
Category: Statistical Models
Classes
OPLS
Methods
init()
TODO:
- add arg for specifying the method for performing PLS
fit(x, y, n_comp, dot)
Fit PLS model.
Parameters
x
: np.ndarray Variable matrix with size n samples by p variables.y
: np.ndarray Dependent matrix with size n samples by 1, or a vectorn_comp
: int Number of components, default is None, which indicates that largest dimension which is smaller value between n and p will be used.
predict(X, n_component, return_scores)
Predict the new coming data matrx.
correct(x, n_component, return_scores, dot)
Correction of X
Parameters
x
: np.ndarray Data matrix with size n by c, where n is number of samples, and c is number of variablesn_component
: int | None Number of components. If is None, the number of components used in fitting the model is used. Default is None.return_scores
: bool Return orthogonal scores. Default is False.
Returns
xc
: np.ndarray Corrected data, with same matrix size with input X.t
: np.ndarray Orthogonal score, n by n_component.
predictive_score(n_component)
Parameters
n_component
: int The component number.
ortho_score(n_component)
Parameters
n_component
: int The component number.
predictive_scores()
Orthogonal loadings.
predictive_loadings()
Predictive loadings.
weights_y()
y scores.
orthogonal_loadings()
Orthogonal loadings.
orthogonal_scores()
Orthogonal scores.