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

Error using MultilabelStratifiedKFold #25

Closed
robertogarces opened this issue Jul 27, 2022 · 4 comments
Closed

Error using MultilabelStratifiedKFold #25

robertogarces opened this issue Jul 27, 2022 · 4 comments

Comments

@robertogarces
Copy link

robertogarces commented Jul 27, 2022

Hi Trent! First, thanks for this repository, it have helped me a lot.

I have a question. I use the MultilabelStratifiedKFold for a machine learning model, but since the last week it have been giving me an error. I haven't changed anything on it, so I don't know what can be happening.

The error I'm having is in this line of code:

mskf = MultilabelStratifiedKFold(n_splits=3, shuffle=True, random_state=42)

And the error that it throws is it:

Input In [13], in <cell line: 6>()
      3 oof_preds["fold_idx"] = -1
      4 oof_preds["oof_pred"] = -1
----> 6 mskf = MultilabelStratifiedKFold(n_splits=3, shuffle=True, random_state=42)
      7 mskf_split = mskf.split(dataset, dataset[["rvm_tipo_enc","rvm_marca_enc","rvm_antiguedad","converted"]])
      9 for fold,(train_idx,valid_idx) in enumerate(mskf_split):

File ~\Anaconda3\envs\JARVIS\lib\site-packages\iterstrat\ml_stratifiers.py:157, in MultilabelStratifiedKFold.__init__(self, n_splits, shuffle, random_state)
    156 def __init__(self, n_splits=3, shuffle=False, random_state=None):
--> 157     super(MultilabelStratifiedKFold, self).__init__(n_splits, shuffle, random_state)

TypeError: __init__() takes 2 positional arguments but 4 were given```



What can be happening on here? Thanks a lot!
@trent-b
Copy link
Owner

trent-b commented Jul 29, 2022

Hi @robertogarces, please ensure you are using the latest version (0.1.7). See this Closed issue that began with the 1.0.0 release of scikit-learn: #18. Please let me know if upgrading resolves the issue.

@robertogarces
Copy link
Author

Hi @trent-b. I was using the 0.1.6 version, and upgrading it solved the problem. Thank you so much for your quick answer. Greetings!

@trent-b
Copy link
Owner

trent-b commented Jul 29, 2022

Glad upgrading worked!

@trent-b trent-b closed this as completed Jul 29, 2022
@spoorgholi74
Copy link

Hi, I get the same issue in version 1.2 of scikit-learn and 0.1.7 on this library

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