title: Check the accuracy of decision tree classifier with Python
body: <p>I wrote a function that takes dataset (excel / pandas) and some values, and then predicts outcome with decision tree classifier. I have done that with sklearn.
  Can you help me with this, I have looked over the web and this website but I couldnt find the answer that works.
  I have tried to do this, but it does not work:</p>
  
  <pre><code>from sklearn.metrics import accuracy_score
  score = accuracy_score(variable_list, result_list)
  </code></pre>
  
  <p>This is the error that I get:</p>
  
  <pre><code>ValueError: Classification metrics can't handle a mix of continuous-multioutput and multiclass targets
  </code></pre>
  
  <p>This is the code(I removed code for accuracy)</p>
  
  <pre><code>import pandas as pd
  import math
  import xlrd
  from sklearn.model_selection import train_test_split
  from sklearn import tree
  
  def predict_concrete_class(input_data, cement, blast_fur_slug,fly_ash,
                              water, superpl, coarse_aggr, fine_aggr, days):
  
      data_for_tree = concrete_strenght_class(input_data)
  
      variable_list = []
      result_list = []
  
      for index, row in data_for_tree.iterrows():
          variable = row.tolist()
          variable = variable[0:8]
  
          variable_list.append(variable)
  
          result_list.append(row[-1])
  
      decision_tree = tree.DecisionTreeClassifier()
      decision_tree = decision_tree.fit(variable_list,result_list)
  
      input_values = [cement, blast_fur_slug, fly_ash, water, superpl, coarse_aggr, fine_aggr, days]
  
      prediction = decision_tree.predict([input_values])
  
      info = "Prediction of future concrete class after "+ str(days)+" days: "+ str(prediction[0])
  
      return info
  
  print(predict_concrete_class(data, 500, 0, 0, 200, 0, 1125, 613, 3))
  </code></pre>