EpistasisLab / EpistasisLab/tpot
XGBoost supports NaN but tpot enforces imputation
- Dominant language
- Jupyter Notebook
- Stars
- 10.1k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Description
As a general rule tpot enforces imputation to match sklearn requirements for all real values in the input and output data. XGboost as a special case allows for the input of NaN values.
## Context of the issue
I am trying to optimise XGboost specifically using a data set with quite a lot of holes in it. I do not want to perform imputation as it affects the results. I looked in base.py and quickly modified the `_check_data` function to ignore NaN values and to not perform imputation but was wondering if tpot can be modified to accommodate this scenario with XGboost?
A 'no_imputation' keyword might be added to `TPOTBase .__init__` for example to prevent imputation.
**Example Edits:**
```
else:
if not self._imputed and np.any(np.isnan(features)):
self._imputed = True
features = self._impute_values(features)
try:
if target is not None:
X, y = check_X_y(features, target, accept_sparse=True, dtype=np.float64,
force_all_finite='allow-nan')
return X, y
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.