Class: Nystroem
Approximate a kernel map using a subset of the training data.
Constructs an approximate feature map for an arbitrary kernel using a subset of the data as basis.
Read more in the User Guide.
Constructors
new Nystroem()
new Nystroem(
opts
?):Nystroem
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.coef0 ? | number | Zero coefficient for polynomial and sigmoid kernels. Ignored by other kernels. |
opts.degree ? | number | Degree of the polynomial kernel. Ignored by other kernels. |
opts.gamma ? | number | Gamma parameter for the RBF, laplacian, polynomial, exponential chi2 and sigmoid kernels. Interpretation of the default value is left to the kernel; see the documentation for sklearn.metrics.pairwise. Ignored by other kernels. |
opts.kernel ? | string | Kernel map to be approximated. A callable should accept two arguments and the keyword arguments passed to this object as kernel_params , and should return a floating point number. |
opts.kernel_params ? | any | Additional parameters (keyword arguments) for kernel function passed as callable object. |
opts.n_components ? | number | Number of features to construct. How many data points will be used to construct the mapping. |
opts.n_jobs ? | number | The number of jobs to use for the computation. This works by breaking down the kernel matrix into n_jobs even slices and computing them in parallel. undefined means 1 unless in a joblib.parallel_backend context. \-1 means using all processors. See Glossary for more details. |
opts.random_state ? | number | Pseudo-random number generator to control the uniform sampling without replacement of n_components of the training data to construct the basis kernel. Pass an int for reproducible output across multiple function calls. See Glossary. |
Returns Nystroem
Defined in generated/kernel_approximation/Nystroem.ts:25
Properties
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/kernel_approximation/Nystroem.ts:23 |
_isInitialized | boolean | false | generated/kernel_approximation/Nystroem.ts:22 |
_py | PythonBridge | undefined | generated/kernel_approximation/Nystroem.ts:21 |
id | string | undefined | generated/kernel_approximation/Nystroem.ts:18 |
opts | any | undefined | generated/kernel_approximation/Nystroem.ts:19 |
Accessors
component_indices_
Get Signature
get component_indices_():
Promise
<ArrayLike
>
Indices of components_
in the training set.
Returns Promise
<ArrayLike
>
Defined in generated/kernel_approximation/Nystroem.ts:388
components_
Get Signature
get components_():
Promise
<ArrayLike
[]>
Subset of training points used to construct the feature map.
Returns Promise
<ArrayLike
[]>
Defined in generated/kernel_approximation/Nystroem.ts:365
feature_names_in_
Get Signature
get feature_names_in_():
Promise
<ArrayLike
>
Names of features seen during fit. Defined only when X
has feature names that are all strings.
Returns Promise
<ArrayLike
>
Defined in generated/kernel_approximation/Nystroem.ts:463
n_features_in_
Get Signature
get n_features_in_():
Promise
<number
>
Number of features seen during fit.
Returns Promise
<number
>
Defined in generated/kernel_approximation/Nystroem.ts:438
normalization_
Get Signature
get normalization_():
Promise
<ArrayLike
[]>
Normalization matrix needed for embedding. Square root of the kernel matrix on components_
.
Returns Promise
<ArrayLike
[]>
Defined in generated/kernel_approximation/Nystroem.ts:413
py
Get Signature
get py():
PythonBridge
Returns PythonBridge
Set Signature
set py(
pythonBridge
):void
Parameters
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
Returns void
Defined in generated/kernel_approximation/Nystroem.ts:76
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/kernel_approximation/Nystroem.ts:127
fit()
fit(
opts
):Promise
<any
>
Fit estimator to data.
Samples a subset of training points, computes kernel on these and computes normalization matrix.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike | Training data, where n_samples is the number of samples and n_features is the number of features. |
opts.y ? | ArrayLike | Target values (undefined for unsupervised transformations). |
Returns Promise
<any
>
Defined in generated/kernel_approximation/Nystroem.ts:146
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.fit_params ? | any | Additional fit parameters. |
opts.X ? | ArrayLike [] | Input samples. |
opts.y ? | ArrayLike | Target values (undefined for unsupervised transformations). |
Returns Promise
<any
[]>
Defined in generated/kernel_approximation/Nystroem.ts:185
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
Parameter | 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/kernel_approximation/Nystroem.ts:229
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.routing ? | any | A MetadataRequest encapsulating routing information. |
Returns Promise
<any
>
Defined in generated/kernel_approximation/Nystroem.ts:265
init()
init(
py
):Promise
<void
>
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Parameters
Parameter | Type |
---|---|
py | PythonBridge |
Returns Promise
<void
>
Defined in generated/kernel_approximation/Nystroem.ts:89
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.transform ? | "default" | "pandas" | "polars" | Configure output of transform and fit_transform . |
Returns Promise
<any
>
Defined in generated/kernel_approximation/Nystroem.ts:299
transform()
transform(
opts
):Promise
<ArrayLike
[]>
Apply feature map to X.
Computes an approximate feature map using the kernel between some training points and X.
Parameters
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike [] | Data to transform. |
Returns Promise
<ArrayLike
[]>