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.
Constructors
new MissingIndicator()
new MissingIndicator(
opts
?):MissingIndicator
Parameters
Parameter | Type | Description |
---|---|---|
opts ? | object | - |
opts.error_on_new ? | boolean | If 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 | number | The 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
Property | Type | Default value | Defined in |
---|---|---|---|
_isDisposed | boolean | false | generated/impute/MissingIndicator.ts:23 |
_isInitialized | boolean | false | generated/impute/MissingIndicator.ts:22 |
_py | PythonBridge | undefined | generated/impute/MissingIndicator.ts:21 |
id | string | undefined | generated/impute/MissingIndicator.ts:18 |
opts | any | undefined | generated/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
Parameter | Type |
---|---|
pythonBridge | PythonBridge |
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike | Input data, where n_samples is the number of samples and n_features is the number of features. |
opts.y ? | any | Not 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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike | The input data to complete. |
opts.y ? | any | Not 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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.input_features ? | any | Input 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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.routing ? | any | A 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
Parameter | Type |
---|---|
py | PythonBridge |
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
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
Parameter | Type | Description |
---|---|---|
opts | object | - |
opts.X ? | ArrayLike | The input data to complete. |
Returns Promise
<ArrayLike
>
Defined in generated/impute/MissingIndicator.ts:317