missingness
AugmentMissingnessStrategy
Bases: GenericMissingnessStrategy
Source code in src/nhssynth/modules/dataloader/missingness.py
remove(data, column_metadata)
Impute missingness with the model. To do this we create a new column for continuous features and a new category for categorical features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
The dataset. |
required |
column_metadata |
ColumnMetaData
|
The column metadata enabling the correct set up of the missingness strategy. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
The dataset, potentially with a new column representing the missingness for the column added. |
Source code in src/nhssynth/modules/dataloader/missingness.py
DropMissingnessStrategy
Bases: GenericMissingnessStrategy
Drop missingness strategy.
Source code in src/nhssynth/modules/dataloader/missingness.py
remove(data, column_metadata)
Drop rows containing missing values in the appropriate column.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
The dataset. |
required |
column_metadata |
ColumnMetaData
|
The column metadata. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
The dataset with rows containing missing values in the appropriate column dropped. |
Source code in src/nhssynth/modules/dataloader/missingness.py
GenericMissingnessStrategy
Bases: ABC
Generic missingness strategy.
Source code in src/nhssynth/modules/dataloader/missingness.py
ImputeMissingnessStrategy
Bases: GenericMissingnessStrategy
Impute missingness with mean strategy.
Source code in src/nhssynth/modules/dataloader/missingness.py
remove(data, column_metadata)
Impute missingness in the data via the impute
strategy. 'Special' values trigger specific behaviour.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data |
DataFrame
|
The dataset. |
required |
column_metadata |
ColumnMetaData
|
The column metadata. |
required |
Returns:
Type | Description |
---|---|
DataFrame
|
The dataset with missing values in the appropriate column replaced with imputed ones. |
Source code in src/nhssynth/modules/dataloader/missingness.py
NullMissingnessStrategy
Bases: GenericMissingnessStrategy
Null missingness strategy.