DocumentationClassesMissingIndicator

Class: 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

Constructors

new MissingIndicator()

new MissingIndicator(opts?): MissingIndicator

Parameters

ParameterTypeDescription
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'.
opts.features?"all" | "missing-only"Whether the imputer mask should represent all or a subset of features.
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.

Returns MissingIndicator

Defined in generated/impute/MissingIndicator.ts:25

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/impute/MissingIndicator.ts:23
_isInitializedbooleanfalsegenerated/impute/MissingIndicator.ts:22
_pyPythonBridgeundefinedgenerated/impute/MissingIndicator.ts:21
idstringundefinedgenerated/impute/MissingIndicator.ts:18
optsanyundefinedgenerated/impute/MissingIndicator.ts:19

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/impute/MissingIndicator.ts:405


features_

Get Signature

get features_(): Promise<ArrayLike>

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).

Returns Promise<ArrayLike>

Defined in generated/impute/MissingIndicator.ts:351


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/impute/MissingIndicator.ts:378


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/impute/MissingIndicator.ts:56

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/impute/MissingIndicator.ts:110


fit()

fit(opts): Promise<any>

Fit the transformer on X.

Parameters

ParameterTypeDescription
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:127


fit_transform()

fit_transform(opts): Promise<ArrayLike>

Generate missing values indicator for X.

Parameters

ParameterTypeDescription
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:166


get_feature_names_out()

get_feature_names_out(opts): Promise<any>

Get output feature names for transformation.

Parameters

ParameterTypeDescription
optsobject-
opts.input_features?anyInput features.

Returns Promise<any>

Defined in generated/impute/MissingIndicator.ts:207


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/impute/MissingIndicator.ts:245


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/impute/MissingIndicator.ts:69


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/impute/MissingIndicator.ts:283


transform()

transform(opts): Promise<ArrayLike>

Generate missing values indicator for X.

Parameters

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

Returns Promise<ArrayLike>

Defined in generated/impute/MissingIndicator.ts:317