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?
$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.
python data-mining cross-validation
$endgroup$
add a comment |
$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.
python data-mining cross-validation
$endgroup$
add a comment |
$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.
python data-mining cross-validation
$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
python data-mining cross-validation
edited Apr 7 at 14:23
Tasos
1,59011138
1,59011138
asked Mar 31 at 2:03
monkmonk
164
164
add a comment |
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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