Documentation
Classes
SelectorMixin

SelectorMixin

Transformer mixin that performs feature selection given a support mask

This mixin provides a feature selector implementation with transform and inverse\_transform functionality given an implementation of \_get\_support\_mask.

Methods

Python Reference (opens in a new tab)

Constructors

constructor()

Signature

new SelectorMixin(opts?: object): SelectorMixin;

Parameters

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

Returns

SelectorMixin

Defined in: generated/feature_selection/SelectorMixin.ts:25 (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/feature_selection/SelectorMixin.ts:102 (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/feature_selection/SelectorMixin.ts:121 (opens in a new tab)

get_feature_names_out()

Mask feature names according to selected features.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.input_features?anyInput features.

Returns

Promise<any>

Defined in: generated/feature_selection/SelectorMixin.ts:168 (opens in a new tab)

get_support()

Get a mask, or integer index, of the features selected.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.indices?booleanIf true, the return value will be an array of integers, rather than a boolean mask. Default Value false

Returns

Promise<any>

Defined in: generated/feature_selection/SelectorMixin.ts:204 (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/feature_selection/SelectorMixin.ts:58 (opens in a new tab)

inverse_transform()

Reverse the transformation operation.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.X?anyThe input samples.

Returns

Promise<any>

Defined in: generated/feature_selection/SelectorMixin.ts:239 (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/feature_selection/SelectorMixin.ts:276 (opens in a new tab)

transform()

Reduce X to the selected features.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.X?anyThe input samples.

Returns

Promise<any>

Defined in: generated/feature_selection/SelectorMixin.ts:309 (opens in a new tab)

Properties

_isDisposed

boolean = false

Defined in: generated/feature_selection/SelectorMixin.ts:23 (opens in a new tab)

_isInitialized

boolean = false

Defined in: generated/feature_selection/SelectorMixin.ts:22 (opens in a new tab)

_py

PythonBridge

Defined in: generated/feature_selection/SelectorMixin.ts:21 (opens in a new tab)

id

string

Defined in: generated/feature_selection/SelectorMixin.ts:18 (opens in a new tab)

opts

any

Defined in: generated/feature_selection/SelectorMixin.ts:19 (opens in a new tab)

Accessors

X_new

Transformed array.

Signature

X_new(): Promise<any[]>;

Returns

Promise<any[]>

Defined in: generated/feature_selection/SelectorMixin.ts:342 (opens in a new tab)

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/feature_selection/SelectorMixin.ts:45 (opens in a new tab)

Signature

py(pythonBridge: PythonBridge): void;

Parameters

NameType
pythonBridgePythonBridge

Returns

void

Defined in: generated/feature_selection/SelectorMixin.ts:49 (opens in a new tab)