title: How to get average score of K-Fold cross validation with sklearn
body: <p>I apply decision tree with K-fold using sklearn and someone can help me to show the average score of it. Below is my code:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  import matplotlib.pyplot as plt
  from sklearn.model_selection import KFold
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.metrics import confusion_matrix,classification_report
  
  dta=pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/blood-transfusion/transfusion.data")
  
  X=dta.drop("whether he/she donated blood in March 2007",axis=1)
  
  X=X.values # convert dataframe to numpy array
  
  y=dta["whether he/she donated blood in March 2007"]
  
  y=y.values # convert dataframe to numpy array
  
  kf = KFold(n_splits=10)
  
  KFold(n_splits=10, random_state=None, shuffle=False)
  
  clf_tree=DecisionTreeClassifier()
  
  for train_index, test_index in kf.split(X):
      X_train, X_test = X[train_index], X[test_index]
      y_train, y_test = y[train_index], y[test_index]
      clf=clf_tree.fit(X_train,y_train)
      print("classification_report_tree", 
             classification_report(y_test,clf_tree.predict(X_test)))
  </code></pre>