direpack.sprm.snipls.snipls

class snipls(eta=0.5, n_components=1, verbose=True, columns=False, centre='mean', scale='None', copy=True)[source]

SNIPLS Sparse Nipals Algorithm

Algorithm first outlined in:

Sparse and robust PLS for binary classification, I. Hoffmann, P. Filzmoser, S. Serneels, K. Varmuza, Journal of Chemometrics, 30 (2016), 153-162.

Parameters
  • eta (float.) – Sparsity parameter in [0,1)

  • n_components (int,) – min 1. Note that if applied on data, n_components shall take a value <= min(x_data.shape)

  • verbose (Boolean (def true)) – to print intermediate set of columns retained

  • columns (Either boolean, list, numpy array or pandas Index (def false)) – if False, no column names supplied; if True, if X data are supplied as a pandas data frame, will extract column names from the frame throws an error for other data input types if a list, array or Index (will only take length x_data.shape[1]), the column names of the x_data supplied in this list, will be printed in verbose mode.

  • centre (str,) – type of centring (‘mean’ [recommended], ‘median’ or ‘l1median’),

  • scale (str,) – type of scaling (‘std’,’mad’ or ‘None’)

  • copy ((def True): boolean,) – whether to copy data. Note : copy not yet aligned with sklearn def - we always copy

Attributes always provided
  • x_weights_: X block PLS weighting vectors (usually denoted W)

  • x_loadings_: X block PLS loading vectors (usually denoted P)

  • C_: vector of inner relationship between response and latent variablesblock re

  • x_scores_: X block PLS score vectors (usually denoted T)

  • coef_: vector of regression coefficients

  • intercept_: intercept

  • coef_scaled_: vector of scaled regression coeeficients (when scaling option used)

  • intercept_scaled_: scaled intercept

  • residuals_: vector of regression residuals

  • x_ev_: X block explained variance per component

  • y_ev_: y block explained variance

  • fitted_: fitted response

  • x_Rweights_: X block SIMPLS style weighting vectors (usually denoted R)

  • colret_: names of variables retained in the sparse model

  • x_loc_: X block location estimate

  • y_loc_: y location estimate

  • x_sca_: X block scale estimate

  • y_sca_: y scale estimate

  • centring_: scaling object used internally (from VersatileScaler)

__init__(eta=0.5, n_components=1, verbose=True, columns=False, centre='mean', scale='None', copy=True)[source]

Methods

__init__([eta, n_components, verbose, ...])

fit(X, y)

Fit a SNIPLS model.

fit_transform(X[, y])

Fit to data, then transform it.

get_params([deep])

Get parameters for this estimator.

predict(Xn)

Predict using a SNIPLS model.

score(X, y[, sample_weight])

Return the coefficient of determination of the prediction.

set_params(**params)

Set the parameters of this estimator.

transform(Xn)

Transform input data.

Attributes