Documentation
Classes
SkewedChi2Sampler

SkewedChi2Sampler

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

Read more in the User Guide.

Python Reference (opens in a new tab)

Constructors

constructor()

Signature

new SkewedChi2Sampler(opts?: object): SkewedChi2Sampler;

Parameters

NameTypeDescription
opts?object-
opts.n_components?numberNumber of Monte Carlo samples per original feature. Equals the dimensionality of the computed feature space. Default Value 100
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. Default Value 1

Returns

SkewedChi2Sampler

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:23 (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/kernel_approximation/SkewedChi2Sampler.ts:104 (opens in a new tab)

fit()

Fit the model with X.

Samples random projection according to n_features.

Signature

fit(opts: object): Promise<any>;

Parameters

NameTypeDescription
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:123 (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

NameTypeDescription
optsobject-
opts.X?ArrayLike[]Input samples.
opts.fit_params?anyAdditional fit parameters.
opts.y?ArrayLikeTarget values (undefined for unsupervised transformations).

Returns

Promise<any[]>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:165 (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

NameTypeDescription
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:218 (opens in a new tab)

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Signature

get_metadata_routing(opts: object): Promise<any>;

Parameters

NameTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns

Promise<any>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:258 (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

NameType
pyPythonBridge

Returns

Promise<void>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:60 (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

NameTypeDescription
optsobject-
opts.transform?"default" | "pandas"Configure output of transform and fit\_transform.

Returns

Promise<any>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:298 (opens in a new tab)

transform()

Apply the approximate feature map to X.

Signature

transform(opts: object): Promise<ArrayLike>;

Parameters

NameTypeDescription
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:333 (opens in a new tab)

Properties

_isDisposed

boolean = false

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:21 (opens in a new tab)

_isInitialized

boolean = false

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:20 (opens in a new tab)

_py

PythonBridge

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:19 (opens in a new tab)

id

string

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:16 (opens in a new tab)

opts

any

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:17 (opens in a new tab)

Accessors

feature_names_in_

Names of features seen during fit. Defined only when X has feature names that are all strings.

Signature

feature_names_in_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:449 (opens in a new tab)

n_features_in_

Number of features seen during fit.

Signature

n_features_in_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:422 (opens in a new tab)

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:47 (opens in a new tab)

Signature

py(pythonBridge: PythonBridge): void;

Parameters

NameType
pythonBridgePythonBridge

Returns

void

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:51 (opens in a new tab)

random_offset_

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

Signature

random_offset_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:395 (opens in a new tab)

random_weights_

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

Signature

random_weights_(): Promise<ArrayLike[]>;

Returns

Promise<ArrayLike[]>

Defined in: generated/kernel_approximation/SkewedChi2Sampler.ts:368 (opens in a new tab)