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.

Python Reference

Constructors

new Nystroem()

new Nystroem(opts?): Nystroem

Parameters

ParameterTypeDescription
opts?object-
opts.coef0?numberZero coefficient for polynomial and sigmoid kernels. Ignored by other kernels.
opts.degree?numberDegree of the polynomial kernel. Ignored by other kernels.
opts.gamma?numberGamma 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?stringKernel 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?anyAdditional parameters (keyword arguments) for kernel function passed as callable object.
opts.n_components?numberNumber of features to construct. How many data points will be used to construct the mapping.
opts.n_jobs?numberThe 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?numberPseudo-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

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/kernel_approximation/Nystroem.ts:23
_isInitializedbooleanfalsegenerated/kernel_approximation/Nystroem.ts:22
_pyPythonBridgeundefinedgenerated/kernel_approximation/Nystroem.ts:21
idstringundefinedgenerated/kernel_approximation/Nystroem.ts:18
optsanyundefinedgenerated/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

ParameterType
pythonBridgePythonBridge

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

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeTraining data, where n_samples is the number of samples and n_features is the number of features.
opts.y?ArrayLikeTarget 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

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/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

ParameterTypeDescription
optsobject-
opts.input_features?anyOnly 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

ParameterTypeDescription
optsobject-
opts.routing?anyA 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

ParameterType
pyPythonBridge

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

ParameterTypeDescription
optsobject-
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

ParameterTypeDescription
optsobject-
opts.X?ArrayLike[]Data to transform.

Returns Promise<ArrayLike[]>

Defined in generated/kernel_approximation/Nystroem.ts:333