title: In sklearn is there a way to test the confidence of a prediction made my a DecisionTreeClassifier Model?
body: <p>I am succesfully using the sklearn library in python and really enjoying it. </p>
  
  <p>I am able to create and fit a model of the DecisionTreeClassifierType with the following code:</p>
  
  <pre><code>clf = tree.DecisionTreeClassifier()
  
  clf = clf.fit(features, labels)
  </code></pre>
  
  <p>I can then use the model to predict the class of new inputs like so:</p>
  
  <pre><code>clf.predict([[20, 50, 10]])
  </code></pre>
  
  <p>The above line will return a 0 or a 1 depending on which class the model predicts this data will have.I was wondering if there is some way to get the confidence/probability the model has for a prediction?</p>
  
  <p>So if it predicts the classification for the input to be 1, the probabiliy/confidence would be a decimal like 0.8 or a percent like 80%. Any ideas on if this is compatible/possible with sklearn's DecisionTreeClassifier?</p>