gregbellan / Stabl

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

failed to find pairwise attribute for stabl object #7

Open dorothyzh opened 6 months ago

dorothyzh commented 6 months ago

plot_stabl_path(stabl_regression, figsize=(4,8))

AttributeError Traceback (most recent call last) Cell In[18], line 1 ----> 1 plot_stabl_path(stabl_regression, figsize=(4,8))

File ~/miniconda3/envs/myenv/lib/python3.12/site-packages/stabl/stabl.py:563, in plot_stabl_path(stabl, new_hard_threshold, show_fig, export_file, path, figsize) 554 ax.plot( 555 x_grid, 556 threshold np.ones(len(x_grid)), (...) 559 label=f"Hard threshold={threshold: .2f}" 560 ) 562 elif stabl.artificial_type is not None: --> 563 if not stabl.pairwise: 564 ax.plot( 565 x_grid, 566 stabl.stabl_scoresartificial[:, o].T, (...) 571 label="Artificial features" 572 ) 574 ax.plot( 575 x_grid, 576 stabl.fdr_minthreshold np.ones(len(x_grid)), (...) 579 label=f"FDP+ threshold={stabl.fdr_minthreshold: .2f}" 580 )

AttributeError: 'Stabl' object has no attribute 'pairwise'

And my environment is:

adjustText==0.8 anyio==4.3.0 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-lru==2.0.4 attrs==23.2.0 Babel==2.14.0 beautifulsoup4==4.12.3 bleach==6.1.0 certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 clarabel==0.7.1 comm==0.2.1 contourpy==1.2.0 cvxpy==1.4.2 cycler==0.12.1 Cython==3.0.9 debugpy==1.8.1 decorator==5.1.1 defusedxml==0.7.1 ecos==2.0.13 et-xmlfile==1.1.0 executing==2.0.1 fastjsonschema==2.19.1 fonttools==4.49.0 fqdn==1.5.1 h11==0.14.0 httpcore==1.0.4 httpx==0.27.0 idna==3.6 ipykernel==6.29.3 ipython==8.22.2 ipywidgets==8.1.2 isoduration==20.11.0 jedi==0.19.1 Jinja2==3.1.3 joblib==1.3.2 json5==0.9.22 jsonpointer==2.4 jsonschema==4.21.1 jsonschema-specifications==2023.12.1 julia==0.6.1 jupyter==1.0.0 jupyter-console==6.6.3 jupyter-events==0.9.0 jupyter-lsp==2.2.4 jupyter_client==8.6.0 jupyter_core==5.7.1 jupyter_server==2.13.0 jupyter_server_terminals==0.5.2 jupyterlab==4.1.4 jupyterlab_pygments==0.3.0 jupyterlab_server==2.25.3 jupyterlab_widgets==3.0.10 kiwisolver==1.4.5 knockpy==1.3.1 MarkupSafe==2.1.5 matplotlib==3.8.2 matplotlib-inline==0.1.6 mistune==3.0.2 nbclient==0.9.0 nbconvert==7.16.2 nbformat==5.9.2 nest-asyncio==1.6.0 networkx==3.2.1 notebook==7.1.1 notebook_shim==0.2.4 numpy==1.26.2 openpyxl==3.1.2 osqp==0.6.2 overrides==7.7.0 packaging==23.2 pandas==2.1.4 pandocfilters==1.5.1 parso==0.8.3 path==16.10.0 path.py==12.5.0 patsy==0.5.6 pexpect==4.9.0 pillow==10.2.0 platformdirs==4.2.0 prometheus_client==0.20.0 prompt-toolkit==3.0.43 psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 pybind11==2.11.1 pycall==2.3.2 pycparser==2.21 Pygments==2.17.2 pyparsing==3.1.2 python-dateutil==2.9.0.post0 python-json-logger==2.0.7 pytz==2024.1 PyYAML==6.0.1 pyzmq==25.1.2 qdldl==0.1.7.post0 qtconsole==5.5.1 QtPy==2.4.1 referencing==0.33.0 requests==2.31.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rpds-py==0.18.0 scikit-learn==1.3.2 scipy==1.11.4 scs==3.2.4.post1 seaborn==0.13.0 Send2Trash==1.8.2 setuptools==69.1.1 six==1.16.0 sniffio==1.3.1 soupsieve==2.5 Stabl @ git+https://github.com/gregbellan/Stabl.git@92cef79e4c3f92d9b717b1c9eaaffbcc321142be stack-data==0.6.3 statsmodels==0.14.0 terminado==0.18.0 threadpoolctl==3.3.0 tinycss2==1.2.1 tornado==6.4 tqdm==4.66.1 traitlets==5.14.1 types-python-dateutil==2.8.19.20240106 tzdata==2024.1 uri-template==1.3.0 urllib3==2.2.1 wcwidth==0.2.13 webcolors==1.13 webencodings==0.5.1 websocket-client==1.7.0 wheel==0.42.0 widgetsnbextension==4.0.10

xavdurand commented 6 months ago

Thank you for your issue. We normally solved the issue.

kelvinmo0513 commented 1 month ago

Hi Xavier,

Hope you're well. I'm running into this issue that says 'Stabl' object has no attribute 'pairwise' again even though you resolved the issue a while ago. I'm also attaching a screenshot here:

Screenshot 2024-08-09 at 10 19 18 AM

and when I try to fit the training set, I constantly run into this import error issue which I think is related to the package versions:

Screenshot 2024-08-09 at 10 21 11 AM

xavdurand commented 1 month ago

Hello @kelvinmo0513,

Thank you for your interest.

For the fist issue, can you tell me the version of the library you are using please? Which release of which branch are you using?

For the second issue, I never encountered this error. It seems to be an error with the scipy library. Can you try to follow this link and tell me if it solves your issue?

Kind regards, Xavier