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.
new Nystroem(opts?: object): Nystroem;
Name | 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. Default Value 'rbf' |
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. Default Value 100 |
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. |
Defined in: generated/kernel_approximation/Nystroem.ts:25
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/kernel_approximation/Nystroem.ts:136
Fit estimator to data.
Samples a subset of training points, computes kernel on these and computes normalization matrix.
fit(opts: object): Promise<any>;
Name | 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). |
Promise
<any
>
Defined in: generated/kernel_approximation/Nystroem.ts:155
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit\_params
and returns a transformed version of X
.
fit_transform(opts: object): Promise<any[]>;
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). |
Promise
<any
[]>
Defined in: generated/kernel_approximation/Nystroem.ts:195
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"\]
.
get_feature_names_out(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.input_features? |
any |
Only used to validate feature names with the names seen in fit . |
Promise
<any
>
Defined in: generated/kernel_approximation/Nystroem.ts:244
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
get_metadata_routing(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.routing? |
any |
A MetadataRequest encapsulating routing information. |
Promise
<any
>
Defined in: generated/kernel_approximation/Nystroem.ts:281
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/kernel_approximation/Nystroem.ts:89
Set output container.
See Introducing the set_output API for an example on how to use the API.
set_output(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.transform? |
"default" | "pandas" |
Configure output of transform and fit\_transform . |
Promise
<any
>
Defined in: generated/kernel_approximation/Nystroem.ts:316
Apply feature map to X.
Computes an approximate feature map using the kernel between some training points and X.
transform(opts: object): Promise<ArrayLike[]>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike [] |
Data to transform. |
Promise
<ArrayLike
[]>
Defined in: generated/kernel_approximation/Nystroem.ts:351
boolean
=false
Defined in: generated/kernel_approximation/Nystroem.ts:23
boolean
=false
Defined in: generated/kernel_approximation/Nystroem.ts:22
PythonBridge
Defined in: generated/kernel_approximation/Nystroem.ts:21
string
Defined in: generated/kernel_approximation/Nystroem.ts:18
any
Defined in: generated/kernel_approximation/Nystroem.ts:19
Indices of components\_
in the training set.
component_indices_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/kernel_approximation/Nystroem.ts:407
Subset of training points used to construct the feature map.
components_(): Promise<ArrayLike[]>;
Promise
<ArrayLike
[]>
Defined in: generated/kernel_approximation/Nystroem.ts:384
Names of features seen during fit. Defined only when X
has feature names that are all strings.
feature_names_in_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/kernel_approximation/Nystroem.ts:482
Number of features seen during fit.
n_features_in_(): Promise<number>;
Promise
<number
>
Defined in: generated/kernel_approximation/Nystroem.ts:457
Normalization matrix needed for embedding. Square root of the kernel matrix on components\_
.
normalization_(): Promise<ArrayLike[]>;
Promise
<ArrayLike
[]>
Defined in: generated/kernel_approximation/Nystroem.ts:432
py(): PythonBridge;
PythonBridge
Defined in: generated/kernel_approximation/Nystroem.ts:76
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/kernel_approximation/Nystroem.ts:80