DocumentationClassesKernelCenterer

Class: KernelCenterer

Center an arbitrary kernel matrix \(K\).

Let define a kernel \(K\) such that:

Python Reference

Constructors

new KernelCenterer()

new KernelCenterer(opts?): KernelCenterer

Parameters

ParameterTypeDescription
opts?object-
opts.feature_names_in_?ArrayLikeNames of features seen during fit. Defined only when X has feature names that are all strings.
opts.K_fit_all_?numberAverage of kernel matrix.
opts.K_fit_rows_?ArrayLikeAverage of each column of kernel matrix.
opts.n_features_in_?numberNumber of features seen during fit.

Returns KernelCenterer

Defined in generated/preprocessing/KernelCenterer.ts:23

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/preprocessing/KernelCenterer.ts:21
_isInitializedbooleanfalsegenerated/preprocessing/KernelCenterer.ts:20
_pyPythonBridgeundefinedgenerated/preprocessing/KernelCenterer.ts:19
idstringundefinedgenerated/preprocessing/KernelCenterer.ts:16
optsanyundefinedgenerated/preprocessing/KernelCenterer.ts:17

Accessors

py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/preprocessing/KernelCenterer.ts:48

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Returns Promise<void>

Defined in generated/preprocessing/KernelCenterer.ts:100


fit()

fit(opts): Promise<any>

Fit KernelCenterer.

Parameters

ParameterTypeDescription
optsobject-
opts.K?ArrayLike[]Kernel matrix.
opts.y?anyIgnored.

Returns Promise<any>

Defined in generated/preprocessing/KernelCenterer.ts:117


fit_transform()

fit_transform(opts): Promise<any[]>

Fit to data, then transform it.

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

Parameters

ParameterTypeDescription
optsobject-
opts.fit_params?anyAdditional fit parameters.
opts.X?ArrayLike[]Input samples.
opts.y?ArrayLikeTarget values (undefined for unsupervised transformations).

Returns Promise<any[]>

Defined in generated/preprocessing/KernelCenterer.ts:156


get_feature_names_out()

get_feature_names_out(opts): Promise<any>

Get output feature names for transformation.

The feature names out will prefixed by the lowercased class name. For example, if the transformer outputs 3 features, then the feature names out are: \["class_name0", "class_name1", "class_name2"\].

Parameters

ParameterTypeDescription
optsobject-
opts.input_features?anyOnly used to validate feature names with the names seen in fit.

Returns Promise<any>

Defined in generated/preprocessing/KernelCenterer.ts:200


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns Promise<any>

Defined in generated/preprocessing/KernelCenterer.ts:236


init()

init(py): Promise<void>

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/preprocessing/KernelCenterer.ts:61


set_fit_request()

set_fit_request(opts): Promise<any>

Request metadata passed to the fit method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

Parameters

ParameterTypeDescription
optsobject-
opts.K?string | booleanMetadata routing for K parameter in fit.

Returns Promise<any>

Defined in generated/preprocessing/KernelCenterer.ts:274


set_output()

set_output(opts): Promise<any>

Set output container.

See Introducing the set_output API for an example on how to use the API.

Parameters

ParameterTypeDescription
optsobject-
opts.transform?"default" | "pandas" | "polars"Configure output of transform and fit_transform.

Returns Promise<any>

Defined in generated/preprocessing/KernelCenterer.ts:310


set_transform_request()

set_transform_request(opts): Promise<any>

Request metadata passed to the transform method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

Parameters

ParameterTypeDescription
optsobject-
opts.copy?string | booleanMetadata routing for copy parameter in transform.
opts.K?string | booleanMetadata routing for K parameter in transform.

Returns Promise<any>

Defined in generated/preprocessing/KernelCenterer.ts:346


transform()

transform(opts): Promise<ArrayLike[]>

Center kernel matrix.

Parameters

ParameterTypeDescription
optsobject-
opts.copy?booleanSet to false to perform inplace computation.
opts.K?ArrayLike[]Kernel matrix.

Returns Promise<ArrayLike[]>

Defined in generated/preprocessing/KernelCenterer.ts:385