title: How to get accuracy for all the predicted class labels
body: <p>How can I find the overall accuracy of the outputs that we got by running a decision tree algorithm.I am able to get the top five class labels for the active user input but I am getting the accuracy for the X_train and Y_train dataset using accuracy_score().Suppose I am getting five top recommendation . I wish to get the accuracy for each class labels and with the help of these, the overall accuracy for the output.Please suggest some idea.</p>
  
  <p>My python script is here:
  here event is the different class labels</p>
  
  <pre><code>DTC= DecisionTreeClassifier()
  
  DTC.fit(X_train_one_hot,y_train)
  print("output from DTC:")
  res=DTC.predict_proba(X_test_one_hot)
  new=list(chain.from_iterable(res))
  #Here I got the index value of top five probabilities
  index=sorted(range(len(new)), key=lambda i: new[i], reverse=True)[:5]
  for i in index:
      print(event[i])
  
  Here is the sample code which i tried to get the accuracy for the predicted class labels: 
  here index is the index for the top five probability of class label and event is the different class label. 
  for i in index: 
      DTC.fit(X_train_one_hot,y_train) 
      y_pred=event[i]  
      AC=accuracy_score((event,y_pred)*100) 
      print(AC) 
  </code></pre>