I have a basic decision tree classifier with Scikit-Learn:
#Used to determine men from women based on height and shoe size
from sklearn import tree
#height and shoe size
X = [[65,9],[67,7],[70,11],[62,6],[60,7],[72,13],[66,10],[67,7.5]]
Y=["male","female","male","female","female","male","male","female"]
#creating a decision tree
clf = tree.DecisionTreeClassifier()
#fitting the data to the tree
clf.fit(X, Y)
#predicting the gender based on a prediction
prediction = clf.predict([68,9])
#print the predicted gender
print(prediction)
When I run the program, it always outputs either "male" or "female", but how would I be able to see the probability of the prediction being male or female? For example, the prediction above returns "male", but how would I get it to print the probability of the prediction being male?
Thanks!