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

n_splits=5 cannot be greater than the number of members in each class. #54

Open
sherlyn99 opened this issue Nov 29, 2023 · 0 comments
Open

Comments

@sherlyn99
Copy link

sherlyn99 commented Nov 29, 2023

I might have missed this in the documentation - what are the minimum number of samples for control and treatment required for the analysis?

Follow up: error disappeared after including more samples. Would be helpful to add the minimum number of samples required in the documentation

Traceback (most recent call last):
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/scripts/tmp9w0fsvnp.logistic_regression.py", line 54, in <module>
    folds = [(train, test) for train, test in cv.split(X, y)]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/scripts/tmp9w0fsvnp.logistic_regression.py", line 54, in <listcomp>
    folds = [(train, test) for train, test in cv.split(X, y)]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/conda/ae102f57fe1fb6ba91271bbd0ace3284_/lib/python3.11/site-packages/sklearn/model_selection/_split.py", line 1527, in split
    for train_index, test_index in cv.split(X, y, groups):
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/conda/ae102f57fe1fb6ba91271bbd0ace3284_/lib/python3.11/site-packages/sklearn/model_selection/_split.py", line 377, in split
    for train, test in super().split(X, y, groups):
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/conda/ae102f57fe1fb6ba91271bbd0ace3284_/lib/python3.11/site-packages/sklearn/model_selection/_split.py", line 108, in split
    for test_index in self._iter_test_masks(X, y, groups):
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/conda/ae102f57fe1fb6ba91271bbd0ace3284_/lib/python3.11/site-packages/sklearn/model_selection/_split.py", line 770, in _iter_test_masks
    test_folds = self._make_test_folds(X, y)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/y1weng/Downloads/20231129_qadabra_gutb/mi04t1_qadabra_out/.snakemake/conda/ae102f57fe1fb6ba91271bbd0ace3284_/lib/python3.11/site-packages/sklearn/model_selection/_split.py", line 732, in _make_test_folds
    raise ValueError(
ValueError: n_splits=5 cannot be greater than the number of members in each class.
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

1 participant