result accuracy_score(y_test,y_predprint("accuracy:",result output confusion matrix[[ ]classification reportprecision recall -score support micro avg macro avg weighted avg accuracy visualizing decision tree the above decision tree can be visualized with the help of following codefrom sklearn tree import export_graphviz from sklearn externals six import stringio from ipython display import image import pydotplus dot_data stringio(export_graphviz(clfout_file=dot_datafilled=truerounded=truespecial_characters=true,feature_names feature_cols,class_names=[' ',' ']graph pydotplus graph_from_dot_data(dot_data getvalue()graph write_png('pima_diabetes_tree png'image(graph create_png()