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

          Adding axes to figuresAdding axes labels to LaTeX figuresLaTeX equivalent of ConTeXt buffersRotate a node but not its content: the case of the ellipse decorationHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?adding axes to shapesAlign axes across subfiguresAdding figures with a certain orderLine up nested tikz enviroments or how to get rid of themAdding axes labels to LaTeX figures

          Tähtien Talli Jäsenet | Lähteet | NavigointivalikkoSuomen Hippos – Tähtien Talli

          Do these cracks on my tires look bad? The Next CEO of Stack OverflowDry rot tire should I replace?Having to replace tiresFishtailed so easily? Bad tires? ABS?Filling the tires with something other than air, to avoid puncture hassles?Used Michelin tires safe to install?Do these tyre cracks necessitate replacement?Rumbling noise: tires or mechanicalIs it possible to fix noisy feathered tires?Are bad winter tires still better than summer tires in winter?Torque converter failure - Related to replacing only 2 tires?Why use snow tires on all 4 wheels on 2-wheel-drive cars?