KernelCenterer
Center an arbitrary kernel matrix \(K\).
Let define a kernel \(K\) such that:
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new KernelCenterer(opts?: object): KernelCenterer;
Parameters
Name | Type | Description |
---|---|---|
opts? | object | - |
opts.K_fit_all_? | number | Average of kernel matrix. |
opts.K_fit_rows_? | ArrayLike | Average of each column of kernel matrix. |
opts.feature_names_in_? | ArrayLike | Names of features seen during fit. Defined only when X has feature names that are all strings. |
opts.n_features_in_? | number | Number of features seen during fit. |
Returns
Defined in: generated/preprocessing/KernelCenterer.ts:23 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/preprocessing/KernelCenterer.ts:21 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/preprocessing/KernelCenterer.ts:20 (opens in a new tab)
_py
PythonBridge
Defined in: generated/preprocessing/KernelCenterer.ts:19 (opens in a new tab)
id
string
Defined in: generated/preprocessing/KernelCenterer.ts:16 (opens in a new tab)
opts
any
Defined in: generated/preprocessing/KernelCenterer.ts:17 (opens in a new tab)
Accessors
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/preprocessing/KernelCenterer.ts:48 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/preprocessing/KernelCenterer.ts:52 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;
Returns
Promise
<void
>
Defined in: generated/preprocessing/KernelCenterer.ts:107 (opens in a new tab)
fit()
Fit KernelCenterer.
Signature
fit(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.K? | ArrayLike [] | Kernel matrix. |
opts.y? | any | Ignored. |
Returns
Promise
<any
>
Defined in: generated/preprocessing/KernelCenterer.ts:124 (opens in a new tab)
fit_transform()
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit\_params
and returns a transformed version of X
.
Signature
fit_transform(opts: object): Promise<any[]>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.X? | ArrayLike [] | Input samples. |
opts.fit_params? | any | Additional fit parameters. |
opts.y? | ArrayLike | Target values (undefined for unsupervised transformations). |
Returns
Promise
<any
[]>
Defined in: generated/preprocessing/KernelCenterer.ts:164 (opens in a new tab)
get_feature_names_out()
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"\]
.
Signature
get_feature_names_out(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.input_features? | any | Only used to validate feature names with the names seen in fit . |
Returns
Promise
<any
>
Defined in: generated/preprocessing/KernelCenterer.ts:213 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Signature
init(py: PythonBridge): Promise<void>;
Parameters
Name | Type |
---|---|
py | PythonBridge |
Returns
Promise
<void
>
Defined in: generated/preprocessing/KernelCenterer.ts:61 (opens in a new tab)
set_output()
Set output container.
See Introducing the set_output API for an example on how to use the API.
Signature
set_output(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.transform? | "default" | "pandas" | Configure output of transform and fit\_transform . |
Returns
Promise
<any
>
Defined in: generated/preprocessing/KernelCenterer.ts:251 (opens in a new tab)
transform()
Center kernel matrix.
Signature
transform(opts: object): Promise<ArrayLike[]>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.K? | ArrayLike [] | Kernel matrix. |
opts.copy? | boolean | Set to false to perform inplace computation. Default Value true |
Returns
Promise
<ArrayLike
[]>
Defined in: generated/preprocessing/KernelCenterer.ts:284 (opens in a new tab)