# GBM - PDP

[Code Implementation Here](https://colab.research.google.com/drive/1SiKKQ5T9rgrYjtDVEEraN1QZxTnztDF8?usp=sharing)

### What is GBM?

* Gradient Boosting Machine is a machine learning algorithm that forms an ensemble of weakly predicted decision trees
* It constructs a forward stage-wise additive model by implementing gradient descent in function space
* Also known as MART (Multiple Additive Regression Trees) and GBRT (Gradient Boosted Regression Trees)

### Making the Model

**Dataset:** Pima Indians Diabetes; **Target:** Outcome

The data is trained by calling the GradientBoostingClassifier function from Scikit learn Library

**Accuracy:**&#x20;

### **Implementation of Interpretability**

For this model, we will interpret with Partial Dependence Plots.&#x20;

![](/files/-MEfamNr5AFv0CQi4nGm)

With just few lines of code, we can plot the PDPs for any dataset using the sklearn partial\_dependence library.

### Visualizations

**PDP for every feature**

![](/files/-MEfbIMVi0-utHTLah_d)

The above plot shows how change in output varies with variations in feature values. Some key points for interpretation from the above plots:

* As Pregnancies increase, the person's chances of becoming diabetic go up
* Higher the Glucose, higher the chances of person becoming diabetic
* BMI more than 25 increases an individuals chances of becoming diabetic

&#x20;**3-D PDPs**

![](/files/-MEfcp8yXjzuB6IpNZpE)

These plots show the combined effect of two features on the change in output. As seen above, a reduction in both - Insulin and DiabetesPedigreeFunction, results in negative change of a person being diabetic (nearing non-diabetic situation).

**PDP interact plot**&#x20;

![](/files/-MEfeHMoH8oWZu97hWG5)

The below plot shows the change output prediction (value inside square) for every combination of values between the features Insulin and DiabetesPedigreeFunction(values given by scale).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://maheshwarappa-a.gitbook.io/explainable-ai-1/implementation-of-these-techniques-on-different-models/gbm-pdp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
