title: Understanding Partial Dependence for Gradient Boosted Regression trees
body: <p>I am looking at the <a href="http://scikit-learn.org/stable/auto_examples/ensemble/plot_partial_dependence.html" rel="noreferrer">tutorial</a> for partial dependence plots in Python. No equation is given in the tutorial or in the <a href="http://scikit-learn.org/stable/modules/generated/sklearn.ensemble.partial_dependence.partial_dependence.html" rel="noreferrer">documentation</a>. The <a href="https://www.rdocumentation.org/packages/randomForest/versions/4.6-12/topics/partialPlot" rel="noreferrer">documentation</a> of the R function gives the formula I expected: </p>
  
  <p><a href="https://i.stack.imgur.com/jEcyW.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jEcyW.png" alt="enter image description here"></a></p>
  
  <p>This does not seem to make sense with the results given in the Python tutorial. If it is an average of the prediction of house prices, then how is it negative and small? I would expect values in the millions. Am I missing something?</p>
  
  <p>Update:</p>
  
  <p>For regression it seems the average is subtracted off of the above formula. How would this be added back? For my trained <strong>model</strong> I can get the partial dependence by</p>
  
  <pre><code>from sklearn.ensemble.partial_dependence import partial_dependence
  partial_dependence, independent_value = partial_dependence(model, features.index(independent_feature),X=df2[features])
  </code></pre>
  
  <p>I want to add (?) back on the average. Would I get this by just using model.predict() on the df2 values with the independent_feature values changed?</p>