title: ValueError: not enough values to unpack when using scikit-learn
body: <p>I want to classify the iris dataset using naive bayes and decision trees from scikit-learn. I got a ValueError: not enough values to unpack (expected 4, got 2). What's wrong with my code? I checked the docs for <code>train_test_split</code>. The inputs and outputs seem to match.</p>
  <pre><code>from sklearn import naive_bayes, tree, metrics
  from sklearn.datasets import load_iris
  from sklearn.model_selection import train_test_split
  from random import seed
  from math import sqrt
  from math import pi
  from math import exp
  
  # get all data
  iris = datasets.load_iris()
  
  # get raw data and lable
  iris_data = iris.data
  iris_labels = list(iris.target)
  
  labeled_data = list(zip(iris_data, iris_labels))
  
  # run the designated classifier
  def run_classifier(classifier, training, testing):
      classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)
  
      expect = testing[1]
      predict = classifier.predict(testing[0])
      
      return expect, predict
  
  # collect data on training size plateau
  def simulate():
      # progress through range of testing data sizes
      nb_acc = []
      tree_acc = []
      training_fracs = [x/1000 for x in range(500, 850, 25)]
  
      for i in training_fracs:
          nb = sklearn.naive_bayes.CategoricalNB()
          dt = tree.DecisionTreeClassifier()
          X_train, X_test, y_train, y_test = train_test_split(df, test_size=0.2, random_state=25)
        
          nb_expect, nb_predict = run_classifier(nb, training_set, testing_set)
          dt_expect, dt_predict = run_classifier(dt, training_set, testing_set)
          
          nb_acc.append(metrics.accuracy_score(nb_expect, nb_predict))
          tree_acc.append(metrics.accuracy_score(dt_expect, dt_predict))
          
      return nb_acc, tree_acc, training_fracs
          
  nb_acc, tree_acc, training_fracs = simulate()
  
  print(f&quot;Naive Bayes accuracy @ 50% training: {nb_acc[0]}&quot;)
  print(f&quot;Decision Tree accuracy @ 50% training: {tree_acc[0]}&quot;)
  
  
  &gt; 
      &gt; ValueError                                Traceback (most recent call
      &gt; &gt; last) &lt;ipython-input-536-cedfcfcdf7fa&gt; in &lt;module&gt;
      &gt; &gt;      28     return nb_acc, tree_acc, training_fracs
      &gt; &gt;      29 
      &gt; &gt; ---&gt; 30 nb_acc, tree_acc, training_fracs = simulate()
      &gt; &gt;      31 
      &gt; &gt;      32 print(f&quot;Naive Bayes accuracy @ 50% training: {nb_acc[0]}&quot;)
      &gt; &gt; 
      &gt; &gt; &lt;ipython-input-536-cedfcfcdf7fa&gt; in simulate()
      &gt; &gt;      18         nb = sklearn.naive_bayes.CategoricalNB()
      &gt; &gt;      19         dt = tree.DecisionTreeClassifier()
      &gt; &gt; ---&gt; 20         X_train, X_test, y_train, y_test = train_test_split(df, test_size=0.2, random_state=25)
      &gt; &gt;      21 
      &gt; &gt;      22         nb_expect, nb_predict = run_classifier(nb, training_set, testing_set)
      &gt; &gt; 
      &gt; &gt; ValueError: not enough values to unpack (expected 4, got 2)
  </code></pre>