I have much more than three elements in every class, but I get this error: "class cannot be less than k=3 in scikit-learn"
The algorithm requires that there be at least 3 instances for a label in your training set. Although your target
array contains at least 3 instances of each label, but when you split the data between training and testing, not all the training labels have 3 instances.
You either need to merge some class labels or increase your training samples to solve the problem.