Error saying some group too small for qda

0 votes

This is my code:

library(MASS)
library(mlbench)
library(caret)
library(class)
data(Glass)
Glass <- data.frame(Glass)
Glass <- na.omit(Glass)
Glass$Type = as.factor(Glass$Type)
x = as.matrix(Glass[,names(Glass) != "Type"])
mode(x) = "numeric"
Glass[,names(Glass) != "Type"] <-x
ind <- sample(2, nrow(Glass), replace = TRUE, prob=c(0.8, 0.2))
train <- Glass[ind == 1,]
test <- Glass[ind == 2,]
train[,names(Glass) != "Type"] <- apply(train[,names(Glass) != "Type"], 2, jitter)

And I keep getting this following error:

Error in qda.default(x, grouping, ...) : some group is too small for 'qda'

Nov 9, 2018 in Data Analytics by Ali
• 11,360 points
4,684 views

1 answer to this question.

0 votes

It's not wrong code (there is little mistake), when this error show

some group is too small for 'qda'

This means that the dataSet is wrong. You should modify dataSet.

answered Nov 9, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+3 votes
1 answer

at model.fit I'm getting an error as : ValueError: Input contains NaN, infinity or a value too large for dtype('float32').

Hi, I think your X parameter contains null ...READ MORE

answered Apr 30, 2020 in Data Analytics by MD
• 95,460 points
3,030 views
0 votes
1 answer

": cannot open the connection" Error in R

There can be two reasons for this ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
5,113 views
+2 votes
1 answer

“subscript out of bounds” Error in r programming

This error is likely to occur when ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
9,584 views
+1 vote
1 answer

What does “replacement has” Error mean?

This error occurs when one tries to ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 52,350 points
715 views
0 votes
1 answer

Errors saying "Error: unexpected '}' in "}"

This is a syntax error: Enclose your if ...READ MORE

answered Nov 8, 2018 in Data Analytics by Maverick
• 10,840 points
3,139 views
0 votes
1 answer
0 votes
1 answer

Error saying "duplicate 'row.names' are not allowed" when trying to setup my data for the mlogit-package

Take out the chid.var argument in your call to mlogit.data, ...READ MORE

answered Nov 12, 2018 in Data Analytics by Maverick
• 10,840 points
2,086 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP