package sklearn

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type tag = [
  1. | `PLSSVD
]
type t = [ `BaseEstimator | `Object | `PLSSVD | `TransformerMixin ] Obj.t
val of_pyobject : Py.Object.t -> t
val to_pyobject : [> tag ] Obj.t -> Py.Object.t
val as_transformer : t -> [ `TransformerMixin ] Obj.t
val as_estimator : t -> [ `BaseEstimator ] Obj.t
val create : ?n_components:int -> ?scale:bool -> ?copy:bool -> unit -> t

Partial Least Square SVD

Simply perform a svd on the crosscovariance matrix: X'Y There are no iterative deflation here.

Read more in the :ref:`User Guide <cross_decomposition>`.

.. versionadded:: 0.8

Parameters ---------- n_components : int, default 2 Number of components to keep.

scale : boolean, default True Whether to scale X and Y.

copy : boolean, default True Whether to copy X and Y, or perform in-place computations.

Attributes ---------- x_weights_ : array, p, n_components X block weights vectors.

y_weights_ : array, q, n_components Y block weights vectors.

x_scores_ : array, n_samples, n_components X scores.

y_scores_ : array, n_samples, n_components Y scores.

Examples -------- >>> import numpy as np >>> from sklearn.cross_decomposition import PLSSVD >>> X = np.array([0., 0., 1.], ... [1.,0.,0.], ... [2.,2.,2.], ... [2.,5.,4.]) >>> Y = np.array([0.1, -0.2], ... [0.9, 1.1], ... [6.2, 5.9], ... [11.9, 12.3]) >>> plsca = PLSSVD(n_components=2) >>> plsca.fit(X, Y) PLSSVD() >>> X_c, Y_c = plsca.transform(X, Y) >>> X_c.shape, Y_c.shape ((4, 2), (4, 2))

See also -------- PLSCanonical CCA

val fit : x:[> `ArrayLike ] Np.Obj.t -> y:[> `ArrayLike ] Np.Obj.t -> [> tag ] Obj.t -> t

Fit model to data.

Parameters ---------- X : array-like of shape (n_samples, n_features) Training vectors, where n_samples is the number of samples and n_features is the number of predictors.

Y : array-like of shape (n_samples, n_targets) Target vectors, where n_samples is the number of samples and n_targets is the number of response variables.

val fit_transform : ?y:[> `ArrayLike ] Np.Obj.t -> x:[> `ArrayLike ] Np.Obj.t -> [> tag ] Obj.t -> [> `ArrayLike ] Np.Obj.t

Learn and apply the dimension reduction on the train data.

Parameters ---------- X : array-like of shape (n_samples, n_features) Training vectors, where n_samples is the number of samples and n_features is the number of predictors.

y : array-like of shape (n_samples, n_targets) Target vectors, where n_samples is the number of samples and n_targets is the number of response variables.

Returns ------- x_scores if Y is not given, (x_scores, y_scores) otherwise.

val get_params : ?deep:bool -> [> tag ] Obj.t -> Dict.t

Get parameters for this estimator.

Parameters ---------- deep : bool, default=True If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns ------- params : mapping of string to any Parameter names mapped to their values.

val set_params : ?params:(string * Py.Object.t) list -> [> tag ] Obj.t -> t

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form ``<component>__<parameter>`` so that it's possible to update each component of a nested object.

Parameters ---------- **params : dict Estimator parameters.

Returns ------- self : object Estimator instance.

val transform : ?y:[> `ArrayLike ] Np.Obj.t -> x:[> `ArrayLike ] Np.Obj.t -> [> tag ] Obj.t -> [> `ArrayLike ] Np.Obj.t

Apply the dimension reduction learned on the train data.

Parameters ---------- X : array-like of shape (n_samples, n_features) Training vectors, where n_samples is the number of samples and n_features is the number of predictors.

Y : array-like of shape (n_samples, n_targets) Target vectors, where n_samples is the number of samples and n_targets is the number of response variables.

val x_weights_ : t -> Py.Object.t

Attribute x_weights_: get value or raise Not_found if None.

val x_weights_opt : t -> Py.Object.t option

Attribute x_weights_: get value as an option.

val y_weights_ : t -> Py.Object.t

Attribute y_weights_: get value or raise Not_found if None.

val y_weights_opt : t -> Py.Object.t option

Attribute y_weights_: get value as an option.

val x_scores_ : t -> [> `ArrayLike ] Np.Obj.t

Attribute x_scores_: get value or raise Not_found if None.

val x_scores_opt : t -> [> `ArrayLike ] Np.Obj.t option

Attribute x_scores_: get value as an option.

val y_scores_ : t -> [> `ArrayLike ] Np.Obj.t

Attribute y_scores_: get value or raise Not_found if None.

val y_scores_opt : t -> [> `ArrayLike ] Np.Obj.t option

Attribute y_scores_: get value as an option.

val to_string : t -> string

Print the object to a human-readable representation.

val show : t -> string

Print the object to a human-readable representation.

val pp : Format.formatter -> t -> unit

Pretty-print the object to a formatter.

OCaml

Innovation. Community. Security.