DocumentationClassesSkewedChi2Sampler

Class: SkewedChi2Sampler

Approximate feature map for “skewed chi-squared” kernel.

Read more in the User Guide.

Python Reference

Constructors

new SkewedChi2Sampler()

new SkewedChi2Sampler(opts?): SkewedChi2Sampler

Parameters

ParameterTypeDescription
opts?object-
opts.n_components?numberNumber of Monte Carlo samples per original feature. Equals the dimensionality of the computed feature space.
opts.random_state?numberPseudo-random number generator to control the generation of the random weights and random offset when fitting the training data. Pass an int for reproducible output across multiple function calls. See Glossary.
opts.skewedness?number“skewedness” parameter of the kernel. Needs to be cross-validated.

Returns SkewedChi2Sampler

Defined in generated/kernel_approximation/SkewedChi2Sampler.ts:23

Properties

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

Accessors

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/SkewedChi2Sampler.ts:434


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/SkewedChi2Sampler.ts:407


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/kernel_approximation/SkewedChi2Sampler.ts:47


random_offset_

Get Signature

get random_offset_(): Promise<ArrayLike[]>

Bias term, which will be added to the data. It is uniformly distributed between 0 and 2*pi.

Returns Promise<ArrayLike[]>

Defined in generated/kernel_approximation/SkewedChi2Sampler.ts:380


random_weights_

Get Signature

get random_weights_(): Promise<ArrayLike[]>

Weight array, sampled from a secant hyperbolic distribution, which will be used to linearly transform the log of the data.

Returns Promise<ArrayLike[]>

Defined in generated/kernel_approximation/SkewedChi2Sampler.ts:353

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/SkewedChi2Sampler.ts:101


fit()

fit(opts): Promise<any>

Fit the model with X.

Samples random projection according to n_features.

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/SkewedChi2Sampler.ts:120


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/SkewedChi2Sampler.ts:161


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/SkewedChi2Sampler.ts:209


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/SkewedChi2Sampler.ts:247


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/SkewedChi2Sampler.ts:60


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/SkewedChi2Sampler.ts:285


transform()

transform(opts): Promise<ArrayLike>

Apply the approximate feature map to X.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeNew data, where n_samples is the number of samples and n_features is the number of features. All values of X must be strictly greater than “-skewedness”.

Returns Promise<ArrayLike>

Defined in generated/kernel_approximation/SkewedChi2Sampler.ts:319