Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: __init__() got an unexpected keyword argument 'iid' #2

Closed
byee4 opened this issue Sep 12, 2022 · 4 comments
Closed

TypeError: __init__() got an unexpected keyword argument 'iid' #2

byee4 opened this issue Sep 12, 2022 · 4 comments

Comments

@byee4
Copy link

byee4 commented Sep 12, 2022

Hello! First off, this is a cool piece of software, so thank you for putting it together! However I'm trying to get the software working on example data, but ran into an issue that others may have seen:

PRIESSTESS -fg /opt/PRIESSTESS/example_data/example_fg.tab.gz -bg /opt/PRIESSTESS/example_data/example_bg.tab.gz 
Folding 5000 fg probes
5000 probes of 5000 have been folded
Folding 5000 bg probes
5000 probes of 5000 have been folded
Identifying motifs with alphabet seq-4
Identifying motifs with alphabet seq-struct-8
Identifying motifs with alphabet seq-struct-16
Identifying motifs with alphabet seq-struct-28
Identifying motifs with alphabet struct-2
Identifying motifs with alphabet struct-4
Identifying motifs with alphabet struct-7
Training PRIESSTESS model
Traceback (most recent call last):
  File "/opt/PRIESSTESS/bin/PRIESSTESS_logistic_regression.py", line 45, in <module>
    opt = BayesSearchCV(
[conda_env.txt](https://github.com/kaitlin309/PRIESSTESS/files/9551613/conda_env.txt)

  File "/opt/conda/envs/PRIESSTESS/lib/python3.8/site-packages/skopt/searchcv.py", line 309, in __init__
    super(BayesSearchCV, self).__init__(
  File "/opt/conda/envs/PRIESSTESS/lib/python3.8/site-packages/sklearn/utils/validation.py", line 63, in inner_f
    return f(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'iid'
Testing PRIESSTESS model on heldout data
Traceback (most recent call last):
  File "/opt/PRIESSTESS/bin/test_PRIESSTESS_model.py", line 30, in <module>
    lr = pickle.load(open(trainmodel, 'rb'))
FileNotFoundError: [Errno 2] No such file or directory: 'PRIESSTESS_model.sav'
--------
PRIESSTESS model complete
cat: test_PRIESSTESS_model_ON_heldout_auroc.tab: No such file or directory
AUROC on heldout: 
Model and results are in ./PRIESSTESS_output

FILES
Model: ./PRIESSTESS_output/PRIESSTESS_model.sav
Model weights: ./PRIESSTESS_output/PRIESSTESS_model_weights.tab
AUROC on heldout: ./PRIESSTESS_output/test_PRIESSTESS_model_ON_heldout_auroc.tab
--------

PRIESSTESS commitid: 4de5ced
RNAfold 2.5.0
STREME 5.3.0
Python 3.8.13
skopt 0.8.1

Dropping the scikit-learn version back down to 0.23 yields another error:

Folding 5000 fg probes
5000 probes of 5000 have been folded
Folding 5000 bg probes
5000 probes of 5000 have been folded
Identifying motifs with alphabet seq-4
Identifying motifs with alphabet seq-struct-8
Identifying motifs with alphabet seq-struct-16
Identifying motifs with alphabet seq-struct-28
Identifying motifs with alphabet struct-2
Identifying motifs with alphabet struct-4
Identifying motifs with alphabet struct-7
Training PRIESSTESS model
Traceback (most recent call last):
  File "/opt/PRIESSTESS/bin/PRIESSTESS_logistic_regression.py", line 8, in <module>
    from skopt import BayesSearchCV
  File "/opt/conda/envs/PRIESSTESS/lib/python3.8/site-packages/skopt/__init__.py", line 55, in <module>
    from .searchcv import BayesSearchCV
  File "/opt/conda/envs/PRIESSTESS/lib/python3.8/site-packages/skopt/searchcv.py", line 16, in <module>
    from sklearn.utils.fixes import MaskedArray
ImportError: cannot import name 'MaskedArray' from 'sklearn.utils.fixes' (/opt/conda/envs/PRIESSTESS/lib/python3.8/site-packages/sklearn/utils/fixes.py)
Testing PRIESSTESS model on heldout data
Traceback (most recent call last):
  File "/opt/PRIESSTESS/bin/test_PRIESSTESS_model.py", line 30, in <module>
    lr = pickle.load(open(trainmodel, 'rb'))
FileNotFoundError: [Errno 2] No such file or directory: 'PRIESSTESS_model.sav'
--------
PRIESSTESS model complete
cat: test_PRIESSTESS_model_ON_heldout_auroc.tab: No such file or directory
AUROC on heldout: 
Model and results are in ./PRIESSTESS_output

FILES
Model: ./PRIESSTESS_output/PRIESSTESS_model.sav
Model weights: ./PRIESSTESS_output/PRIESSTESS_model_weights.tab
AUROC on heldout: ./PRIESSTESS_output/test_PRIESSTESS_model_ON_heldout_auroc.tab
--------

The solution seems to be dropping scikit-learn version back down to 0.22, which seems to contain both functions.


PRIESSTESS -fg /opt/PRIESSTESS/example_data/example_fg.tab.gz -bg /opt/PRIESSTESS/example_data/example_bg.tab.gz 
Folding 5000 fg probes
5000 probes of 5000 have been folded
Folding 5000 bg probes
5000 probes of 5000 have been folded
Identifying motifs with alphabet seq-4
Identifying motifs with alphabet seq-struct-8
Identifying motifs with alphabet seq-struct-16
Identifying motifs with alphabet seq-struct-28
Identifying motifs with alphabet struct-2
Identifying motifs with alphabet struct-4
Identifying motifs with alphabet struct-7
Training PRIESSTESS model
Testing PRIESSTESS model on heldout data
--------
PRIESSTESS model complete
AUROC on heldout: 0.57301632
Model and results are in ./PRIESSTESS_output

FILES
Model: ./PRIESSTESS_output/PRIESSTESS_model.sav
Model weights: ./PRIESSTESS_output/PRIESSTESS_model_weights.tab
AUROC on heldout: ./PRIESSTESS_output/test_PRIESSTESS_model_ON_heldout_auroc.tab
--------

I wonder which versions are used in the Laverty et. al. publication?

@LRuiRui517
Copy link

我也没有解决这个问题

@kaitlin309
Copy link
Owner

kaitlin309 commented Sep 15, 2022

Hi,

Thank you bringing this to my attention, I forgot to put the version of scikit-learn in the README. It is now there:

sklearn (PRIESSTESS was developed with version 0.23.2)

Have you got it working now? It seems that you do.

@kaitlin309
Copy link
Owner

I am going to close this issue, but I will also add the following to the README:

Note: A user of PRIESSTESS found that it would run only when the version of sklearn was dropped to 0.22.

@byee4
Copy link
Author

byee4 commented Sep 15, 2022

Thanks! I got it working with 0.22, but will try with 0.23.2 soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants