gregbellan / Stabl

BSD 3-Clause Clear License
38 stars 10 forks source link

WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. #9

Open dorothyzh opened 2 months ago

dorothyzh commented 2 months ago

Hi, when I load the stabl module, some warning occurs:

from stabl.multi_omic_pipelines import multi_omic_stabl_cv, multi_omic_stabl WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier.

And when running the files in the demo, it occurs many times: 1316 train samples, 253 test samples: 0%| | 0/100 [00:00<?, ?it/s]Fitting of STABL Lasso WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier.[00:00<?, ?it/s] WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier. WARNING: using StaticArrays.setindex in module FiniteDiff conflicts with an existing identifier.

I used the light-weight version using python 10.

dorothyzh commented 2 months ago

another issue comes when running the script on DREAM dataset: ElasticNet finished on Phylotype (1316 samples); 1865 features selected Fitting of STABL Lasso Stabl progress: 100%|██████████████████████████████████████████████████████████| 10/10 [06:46<00:00, 40.65s/it] STABL Lasso finished on Taxonomy (1316 samples); 7 features selected███████████| 10/10 [06:46<00:00, 43.32s/it] Fitting of STABL ALasso 1316 train samples, 253 test samples: 0%| | 0/100 [6:04:12<?, ?it/s] Traceback (most recent call last): File "", line 1, in File "/scratch/st-ljfoster-1/dorothy/miniconda3/envs/stabl2/lib/python3.9/site-packages/sklearn/utils/_testing.py", line 156, in wrapper return fn(*args, **kwargs) File "/scratch/st-ljfoster-1/dorothy/Stabl-main/stabl/multi_omic_pipelines.py", line 250, in multi_omic_stabl_cv stabl_alasso.fit(X_tmp_std, ytmp, groups=groups) File "/scratch/st-ljfoster-1/dorothy/Stabl-main/stabl/stabl.py", line 993, in fit X = self._make_artificial_features( File "/scratch/st-ljfoster-1/dorothy/Stabl-main/stabl/stabl.py", line 1268, in _make_artificial_features X_tmp = X.iloc[:, cols].copy() AttributeError: 'numpy.ndarray' object has no attribute 'iloc'

import numpy numpy.version '1.26.2'

xavdurand commented 2 months ago

Hi @dorothyzh ,

Thank you for the bug reporting. For the first issue about the warning, I cannot help you. It seems to be an issue with Julia, you should dig in this direction.

For the second issue, I cannot reproduce the error locally. As the line 250 of the file multi_omic_pipelines.py is not stabl_alasso.fit(X_tmp_std, y_tmp, groups=groups), is it possible that you added some code in the original function? If so, can you verify that X_tmp_std and y_tmp are DataFrames and not ndarrays? A possible issue would be with the preprocessing pipeline. Sklearn preprocessing pipeline transform function returns ndarray instead of dataframe, even when the input is a dataframe.

xavdurand commented 1 month ago

Hello @dorothyzh , Is the problem solved?