Skip to content

ValueError: Input X contains NaN. #23

@nebetbastet

Description

@nebetbastet

Hello,

I tried using Ikarus on my dataset.

Unfortunately, I'm getting this error:

Error in py_call_impl(callable, call_args$unnamed, call_args$named) :
ValueError: Input X contains NaN.
LogisticRegression does not accept missing values encoded as NaN natively. For supervised learning, you might want to consider sklearn.ensemble.HistGradientBoostingClassifier and Regressor which accept missing values encoded as NaNs natively. Alternatively, it is possible to preprocess the data, for instance by using an imputer transformer in a pipeline or drop samples with missing values. See https://scikit-learn.org/stable/modules/impute.html You can find a list of all estimators that handle NaN values at the following page: https://scikit-learn.org/stable/modules/impute.html#estimators-that-handle-nan-values

However, my X matrix doesn't seem to contain any missing values. When I run "np.sum(np.isnan(adata.X))" I get 0.

Thank you in advance for your help

Info on my python env:

aiohappyeyeballs 2.4.4 pypi
aiohttp 3.10.11 pypi
aiosignal 1.3.1 pypi
anndata 0.9.2 pypi
arboreto 0.1.6 pypi
async-timeout 5.0.1 pypi
attrs 25.1.0 pypi
bokeh 3.1.1 pypi
boltons 25.0.0 pypi
ca-certificates 2024.12.31 pkgs/main
certifi 2025.1.31 pypi
charset-normalizer 3.4.1 pypi
click 8.1.8 pypi
cloudpickle 3.1.1 pypi
colorama 0.4.6 pypi
contourpy 1.1.1 pypi
ctxcore 0.2.0 pypi
cycler 0.12.1 pypi
cytoolz 1.0.1 pypi
dask 2023.5.0 pypi
dill 0.3.9 pypi
distributed 2023.5.0 pypi
fonttools 4.55.8 pypi
frozendict 2.4.6 pypi
frozenlist 1.5.0 pypi
fsspec 2025.2.0 pypi
get-annotations 0.1.2 pypi
idna 3.10 pypi
ikarus 0.0.3 pypi
importlib-metadata 8.5.0 pypi
importlib-resources 6.4.5 pypi
interlap 0.2.7 pypi
jinja2 3.1.5 pypi
joblib 1.4.2 pypi
kiwisolver 1.4.7 pypi
libffi 3.4.4 pkgs/main
llvmlite 0.41.1 pypi
locket 1.0.0 pypi
loompy 3.0.8 pypi
lz4 4.3.3 pypi
markupsafe 2.1.5 pypi
matplotlib 3.7.5 pypi
msgpack 1.1.0 pypi
multidict 6.1.0 pypi
multiprocessing-on-dill 3.5.0a4 pypi
natsort 8.4.0 pypi
networkx 3.1 pypi
numba 0.58.1 pypi
numpy 1.24.4 pypi
numpy-groupies 0.9.22 pypi
openssl 3.0.15 pkgs/main
pandas 2.0.3 pypi
partd 1.4.1 pypi
patsy 1.0.1 pypi
pillow 10.4.0 pypi
pip 24.2 pkgs/main
propcache 0.2.0 pypi
psutil 6.1.1 pypi
pyarrow 17.0.0 pypi
pynndescent 0.5.13 pypi
pyparsing 3.1.4 pypi
pyscenic 0.12.1 pypi
python 3.8.20 pkgs/main
python-dateutil 2.9.0.post0 pypi
pytz 2025.1 pypi
pyyaml 6.0.2 pypi
requests 2.32.3 pypi
scanpy 1.9.8 pypi
scikit-learn 1.3.2 pypi
scipy 1.10.1 pypi
seaborn 0.13.2 pypi
session-info 1.0.0 pypi
setuptools 75.1.0 pkgs/main
sortedcontainers 2.4.0 pypi
sqlite 3.45.3 pkgs/main
statsmodels 0.14.1 pypi
stdlib-list 0.10.0 pypi
tblib 3.0.0 pypi
threadpoolctl 3.5.0 pypi
toolz 1.0.0 pypi
tornado 6.4.2 pypi
tqdm 4.67.1 pypi
typing-extensions 4.12.2 pypi
tzdata 2025.1 pypi
umap-learn 0.5.7 pypi
urllib3 2.2.3 pypi
vc 14.40 pkgs/main
vs2015_runtime 14.42.34433 pkgs/main
wheel 0.44.0 pkgs/main
xyzservices 2025.1.0 pypi
yarl 1.15.2 pypi
zict 3.0.0 pypi
zipp 3.20.2 pypi

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions