Skip to content

Commit

Permalink
set fill value to max of full dataset + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanburns committed Mar 22, 2020
1 parent b76a902 commit 907279a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoPyTorch/pipeline/nodes/imputation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def fit(self, hyperparameter_config, X, train_indices, dataset_info):
dataset_info.categorical_features = [dataset_info.categorical_features[i] for i, is_nan in enumerate(all_nan) if not is_nan]

strategy = hyperparameter_config['strategy']
fill_value = int(np.nanmax(X[train_indices])) + 1 if not dataset_info.is_sparse else 0
fill_value = int(np.nanmax(X)) + 1 if not dataset_info.is_sparse else 0
numerical_imputer = SimpleImputer(strategy=strategy, copy=False)
categorical_imputer = SimpleImputer(strategy='constant', copy=False, fill_value=fill_value)
transformer = ColumnTransformer(
Expand Down Expand Up @@ -63,4 +63,4 @@ def get_pipeline_config_options(self):
ConfigOption(name='imputation_strategies', default=Imputation.strategies, type=str, list=True, choices=Imputation.strategies)
]
return options


0 comments on commit 907279a

Please sign in to comment.