# Partial Dependence Plot in Knime

## Метаданные

- **Канал:** Saqib Ali
- **YouTube:** https://www.youtube.com/watch?v=yoW9I-XZ8mU
- **Дата:** 04.01.2021
- **Длительность:** 9:35
- **Просмотры:** 159
- **Источник:** https://ekstraktznaniy.ru/video/46017

## Описание

A brief overview of the Interpretable AI features in #Knime. This video covers the Partial Dependence Plot in Knime. A Partial Dependence Plot shows how a single continuous predictor variable impacts the output of a model when holding all other predictors constant. Essentially we inspect a single predictor variable and observe how the model behaves when we vary the value of that predictor variable. This is achieved by generating samples by varying the value of the given predictor. Knime has nodes that can generate these samples and then help visualize that sampled data using a Partial Dependency Plot. This plot is a great way to understand how your model will behave with new dataset.

The example workflow is available for download at:
https://lnkd.in/ggmtdSt

## Транскрипт

### <Untitled Chapter 1> []

hello this is sakeb in the last few videos i gave a brief overview of the interpretable ai nodes available in 94. 0 release in this video we'll take a look at the partial dependence plot node available in 9 as part of the interpretable ai nodes to recap a partial dependence plot shows how a single continuous predictor variable impacts the output of a model when holding all other predictors constant so essentially we take a look at a single predictor variable and observe how the model behaves when we vary the value of that predictor variable in a predefined domain this is achieved by generating samples by varying the value of the given predictor lyme has nodes that can generate these samples and then help visualize that sample data i'm using the heart failure data set from the uci machine learning repository this data set consists of various clinical features captured during the heart examination of patients uh the response variable and is whether that event occurred before the patient's next checkup so if we take a look at the predictor

### Predictor Variables [1:26]

variables and the response this is our response variable the that event and we have several predictor variables including the age uh anemia um ejection fraction which is essentially the rate of the flow uh from the heart it's given as a fraction and whether the person smokes or not and several uh the platelet counts and several other features so we'll take a we'll build a model using this data set but uh what we want to take a look at is how any of the continuous variables impact the final output of the model before we get into using the interpretable ai nodes in line let's take a look at the output of the partial dependence plot in nine so let's take a look at that let's click okay and once i open up the ice the partial dependence plot it brings up a chrome browser window with several plots and to move around within the plots we have you can click on this menu and it lists essentially lists all the features that are part of your model so these are all the continuous variables that are part of your model so in this case we have the age the creatine ejection fraction platelet count serum uh creatinine and serum so uh so as i mentioned earlier on the partial

### Partial Dependence Plot [3:15]

dependence plot shows how a model behaves when you vary a single predictor wave a single continuous predictor variable in a predefined domain while holding all the other predictors contacts constant so in this case if you take a look at the plot for the age we see that as the age increases let me close this out as the h increases the probability of the that event equals to 2 goes up so this is our class probability for that event equals to true and as you can see as the day the age goes up so we are wearing the h in the in this given model and we see that as the age goes up the probability of the dead event uh the class probability of the death humans equals two goes up now let's take a look at another um continuous variable in this model um so in this case let's take our ejection fraction so this is the rate of the flow um as it comes out of your heart so if you take a look at this variable and what's evident from this plot is that as the lower the ejection fraction the higher the class probability for the death events equals to true so it's another so we can say that uh in this particular model the way that it was built um if we if you have a lower ejection fraction uh the uh model will predict the that event to be true based on how we could uh cut or set our cutoff but the probability of on the class probability of that event equals to two goes up when the ejection fraction is lower similarly if we go back to the h which this is telling us is uh the way that this model works is that if the age goes up the class probability of death is equal to true goes up as well how

### How To Use these Interpretable Aei Nodes Inline [5:48]

to use these interpretable aei nodes inline to start off first you have to build your models so you start off with your data then you decide on which model to use and then you use the learner node and the predictor node as usual but in this case to use the interpretable api nodes in lime you have to use this partial dependence pre-processing meta node this metanode is available for nine from nine website and you can download it and use it as it is what this node does is generates a sample of data by varying the predictor variable in a predefined domain that your partial dependence plot node uses to visualize the data so the two nodes that you have to use is the preprocessing nodes and the partial dependence plot node now let's take a look at the configuration for the preprocessing nodes it's pretty straightforward all you have to do is select all the predictive variables the continuous predictive variables in your model that you want to plot and the number of samples in this case i left it off at 100 which is the default value and now let's take a look at the

### Partial Dependence Plot Configuration [7:21]

partial dependence plot configuration so in this case um the the features that we sampled in our previous preprocessing node we have to select those in this case we use the age uh the ejection fraction platelet counts theorem and the creatinine predictor variables and again the prediction columns in our case uh this is the class probability for uh for that uh predictable uh variable sorry the class probability of the prediction so now um so that's the configuration for that and i think that's pretty much it for the configuration uh one thing to note is that to add the class probabilities to your uh nine workflows in your predict uh predictor node you actually have to specify that by going into the configuration you have to specify that append the individual class probabilities so once you do that your class probabilities will be available in the partial dependence plot node right here so once you have set that up uh pretty much you run the run your flow and then once you actually take a look at the output of the partial dependence plot uh it brings it in a chrome browser and you can explore all your continuous variables by going into this menu and it will plot it will give you a partial dependence plot for each of the continuous variable in your model so hopefully this was useful and this just gives you an overview of the partial dependence plot uh where it comes from and how to use that in mind hopefully you like the video thank you bye
