Documentation
Classes
MissingIndicator

MissingIndicator

Binary indicators for missing values.

Note that this component typically should not be used in a vanilla Pipeline consisting of transformers and a classifier, but rather could be added using a FeatureUnion or ColumnTransformer.

Read more in the User Guide.

Python Reference (opens in a new tab)

Constructors

constructor()

Signature

new MissingIndicator(opts?: object): MissingIndicator;

Parameters

NameTypeDescription
opts?object-
opts.error_on_new?booleanIf true, transform will raise an error when there are features with missing values that have no missing values in fit. This is applicable only when features='missing-only'. Default Value true
opts.features?"all" | "missing-only"Whether the imputer mask should represent all or a subset of features. Default Value 'missing-only'
opts.missing_values?string | numberThe placeholder for the missing values. All occurrences of missing\_values will be imputed. For pandas’ dataframes with nullable integer dtypes with missing values, missing\_values should be set to np.nan, since pd.NA will be converted to np.nan.
opts.sparse?boolean | "auto"Whether the imputer mask format should be sparse or dense. Default Value 'auto'

Returns

MissingIndicator

Defined in: generated/impute/MissingIndicator.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/impute/MissingIndicator.ts:113 (opens in a new tab)

fit()

Fit the transformer on X.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLikeInput data, where n\_samples is the number of samples and n\_features is the number of features.
opts.y?anyNot used, present for API consistency by convention.

Returns

Promise<any>

Defined in: generated/impute/MissingIndicator.ts:130 (opens in a new tab)

fit_transform()

Generate missing values indicator for X.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLikeThe input data to complete.
opts.y?anyNot used, present for API consistency by convention.

Returns

Promise<ArrayLike>

Defined in: generated/impute/MissingIndicator.ts:170 (opens in a new tab)

get_feature_names_out()

Get output feature names for transformation.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.input_features?anyInput features.

Returns

Promise<any>

Defined in: generated/impute/MissingIndicator.ts:212 (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/impute/MissingIndicator.ts:252 (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/impute/MissingIndicator.ts:69 (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/impute/MissingIndicator.ts:291 (opens in a new tab)

transform()

Generate missing values indicator for X.

Signature

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

Parameters

NameTypeDescription
optsobject-
opts.X?ArrayLikeThe input data to complete.

Returns

Promise<ArrayLike>

Defined in: generated/impute/MissingIndicator.ts:326 (opens in a new tab)

Properties

_isDisposed

boolean = false

Defined in: generated/impute/MissingIndicator.ts:23 (opens in a new tab)

_isInitialized

boolean = false

Defined in: generated/impute/MissingIndicator.ts:22 (opens in a new tab)

_py

PythonBridge

Defined in: generated/impute/MissingIndicator.ts:21 (opens in a new tab)

id

string

Defined in: generated/impute/MissingIndicator.ts:18 (opens in a new tab)

opts

any

Defined in: generated/impute/MissingIndicator.ts:19 (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/impute/MissingIndicator.ts:415 (opens in a new tab)

features_

The features indices which will be returned when calling transform. They are computed during fit. If features='all', features\_ is equal to range(n\_features).

Signature

features_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/impute/MissingIndicator.ts:361 (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/impute/MissingIndicator.ts:388 (opens in a new tab)

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/impute/MissingIndicator.ts:56 (opens in a new tab)

Signature

py(pythonBridge: PythonBridge): void;

Parameters

NameType
pythonBridgePythonBridge

Returns

void

Defined in: generated/impute/MissingIndicator.ts:60 (opens in a new tab)