The minimum number of groups for any class cannot be less than 2 error The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election Resultsabout predict the class for a new datapointTensorFlow doesn't learn when input=output (or probably I am missing something)Will cross validation performance be an accurate indication for predicting the true performance on an independent data set?Handling data imbalance and class number for classificationHow to resolve Error in predict.rpart(fitTree, data = hypo_mode, type = “class”) : Invalid prediction for “rpart” object?Is it possible to have a validation error less than train error for a while followed by the reverse behaviour?AUC calculated for a given target class while there are more than 2 groups to compare withMultivariate VAR model: ValueError: x already contains a constantChoose CNN architecture first, then optimize parameters - validation vs test performance to pick architecture?

Are my PIs rude or am I just being too sensitive?

Python - Fishing Simulator

How does this infinite series simplify to an integral?

Is every episode of "Where are my Pants?" identical?

The following signatures were invalid: EXPKEYSIG 1397BC53640DB551

How to prevent selfdestruct from another contract

Can withdrawing asylum be illegal?

Finding the path in a graph from A to B then back to A with a minimum of shared edges

how can a perfect fourth interval be considered either consonant or dissonant?

A pet rabbit called Belle

Arduino Pro Micro - switch off LEDs

Hopping to infinity along a string of digits

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

Is this wall load bearing? Blueprints and photos attached

First use of “packing” as in carrying a gun

What information about me do stores get via my credit card?

Who or what is the being for whom Being is a question for Heidegger?

How does ice melt when immersed in water

What's the point in a preamp?

Is above average number of years spent on PhD considered a red flag in future academia or industry positions?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Why is superheterodyning better than direct conversion?

Semisimplicity of the category of coherent sheaves?

Relations between two reciprocal partial derivatives?



The minimum number of groups for any class cannot be less than 2 error



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election Resultsabout predict the class for a new datapointTensorFlow doesn't learn when input=output (or probably I am missing something)Will cross validation performance be an accurate indication for predicting the true performance on an independent data set?Handling data imbalance and class number for classificationHow to resolve Error in predict.rpart(fitTree, data = hypo_mode, type = “class”) : Invalid prediction for “rpart” object?Is it possible to have a validation error less than train error for a while followed by the reverse behaviour?AUC calculated for a given target class while there are more than 2 groups to compare withMultivariate VAR model: ValueError: x already contains a constantChoose CNN architecture first, then optimize parameters - validation vs test performance to pick architecture?










1












$begingroup$


cv_split = StratifiedShuffleSplit(n_splits=10, test_size=0.3, random_state=0)

# Performing cross-validation to estimate the performance of the models
for idx, est in enumerate(estimator):

cv_results = cross_validate(est[1](), x_value, y_value, cv=cv_split)


I got following error from this code




ValueError: The least populated class in y has only 1 member, which is
too few. The minimum number of groups for any class cannot be less
than 2.




and my y_value looks like
y_value = array([221900, 180000, 510000, ..., 360000, 400000, 325000])



I used this method before and y_value has the same shape as before.










share|improve this question











$endgroup$
















    1












    $begingroup$


    cv_split = StratifiedShuffleSplit(n_splits=10, test_size=0.3, random_state=0)

    # Performing cross-validation to estimate the performance of the models
    for idx, est in enumerate(estimator):

    cv_results = cross_validate(est[1](), x_value, y_value, cv=cv_split)


    I got following error from this code




    ValueError: The least populated class in y has only 1 member, which is
    too few. The minimum number of groups for any class cannot be less
    than 2.




    and my y_value looks like
    y_value = array([221900, 180000, 510000, ..., 360000, 400000, 325000])



    I used this method before and y_value has the same shape as before.










    share|improve this question











    $endgroup$














      1












      1








      1





      $begingroup$


      cv_split = StratifiedShuffleSplit(n_splits=10, test_size=0.3, random_state=0)

      # Performing cross-validation to estimate the performance of the models
      for idx, est in enumerate(estimator):

      cv_results = cross_validate(est[1](), x_value, y_value, cv=cv_split)


      I got following error from this code




      ValueError: The least populated class in y has only 1 member, which is
      too few. The minimum number of groups for any class cannot be less
      than 2.




      and my y_value looks like
      y_value = array([221900, 180000, 510000, ..., 360000, 400000, 325000])



      I used this method before and y_value has the same shape as before.










      share|improve this question











      $endgroup$




      cv_split = StratifiedShuffleSplit(n_splits=10, test_size=0.3, random_state=0)

      # Performing cross-validation to estimate the performance of the models
      for idx, est in enumerate(estimator):

      cv_results = cross_validate(est[1](), x_value, y_value, cv=cv_split)


      I got following error from this code




      ValueError: The least populated class in y has only 1 member, which is
      too few. The minimum number of groups for any class cannot be less
      than 2.




      and my y_value looks like
      y_value = array([221900, 180000, 510000, ..., 360000, 400000, 325000])



      I used this method before and y_value has the same shape as before.







      python data-mining cross-validation






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 7 at 14:23









      Tasos

      1,59011138




      1,59011138










      asked Mar 31 at 2:03









      monkmonk

      164




      164




















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "557"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48282%2fthe-minimum-number-of-groups-for-any-class-cannot-be-less-than-2-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Data Science Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f48282%2fthe-minimum-number-of-groups-for-any-class-cannot-be-less-than-2-error%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Marja Vauras Lähteet | Aiheesta muualla | NavigointivalikkoMarja Vauras Turun yliopiston tutkimusportaalissaInfobox OKSuomalaisen Tiedeakatemian varsinaiset jäsenetKasvatustieteiden tiedekunnan dekaanit ja muu johtoMarja VaurasKoulutusvienti on kestävyys- ja ketteryyslaji (2.5.2017)laajentamallaWorldCat Identities0000 0001 0855 9405n86069603utb201588738523620927

          Which is better: GPT or RelGAN for text generation?2019 Community Moderator ElectionWhat is the difference between TextGAN and LM for text generation?GANs (generative adversarial networks) possible for text as well?Generator loss not decreasing- text to image synthesisChoosing a right algorithm for template-based text generationHow should I format input and output for text generation with LSTMsGumbel Softmax vs Vanilla Softmax for GAN trainingWhich neural network to choose for classification from text/speech?NLP text autoencoder that generates text in poetic meterWhat is the interpretation of the expectation notation in the GAN formulation?What is the difference between TextGAN and LM for text generation?How to prepare the data for text generation task

          Is this part of the description of the Archfey warlock's Misty Escape feature redundant?When is entropic ward considered “used”?How does the reaction timing work for Wrath of the Storm? Can it potentially prevent the damage from the triggering attack?Does the Dark Arts Archlich warlock patrons's Arcane Invisibility activate every time you cast a level 1+ spell?When attacking while invisible, when exactly does invisibility break?Can I cast Hellish Rebuke on my turn?Do I have to “pre-cast” a reaction spell in order for it to be triggered?What happens if a Player Misty Escapes into an Invisible CreatureCan a reaction interrupt multiattack?Does the Fiend-patron warlock's Hurl Through Hell feature dispel effects that require the target to be on the same plane as the caster?What are you allowed to do while using the Warlock's Eldritch Master feature?