KernelCenterer

class ibex.sklearn.preprocessing.KernelCenterer

Bases: sklearn.preprocessing.data.KernelCenterer, ibex._base.FrameMixin

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Center a kernel matrix

Let K(x, z) be a kernel defined by phi(x)^T phi(z), where phi is a function mapping x to a Hilbert space. KernelCenterer centers (i.e., normalize to have zero mean) the data without explicitly computing phi(x). It is equivalent to centering phi(x) with sklearn.preprocessing.StandardScaler(with_std=False).

Read more in the User Guide.

fit(K, y=None)[source]

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Fit KernelCenterer

K : numpy array of shape [n_samples, n_samples]
Kernel matrix.

self : returns an instance of self.

fit_transform(X, y=None, **fit_params)

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

X : numpy array of shape [n_samples, n_features]
Training set.
y : numpy array of shape [n_samples]
Target values.
X_new : numpy array of shape [n_samples, n_features_new]
Transformed array.
transform(K, y='deprecated', copy=True)[source]

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Center kernel matrix.

K : numpy array of shape [n_samples1, n_samples2]
Kernel matrix.
y : (ignored)

Deprecated since version 0.19: This parameter will be removed in 0.21.

copy : boolean, optional, default True
Set to False to perform inplace computation.

K_new : numpy array of shape [n_samples1, n_samples2]