Model-agnostic Interpretable Machine Learning
Wright, Marvin N.
Marvin, Computer Engineer and Biostatistician, is the head of the Emmy Noether research group on interpretable machine learning, funded by the German Research Foundation, at the Leibniz Institute for Prevention Research and Epidemiology – BIPS in Bremen, Germany. Since February 2021, he is also Professor of Machine Learning in Statistics at the University of Bremen. He has a research focus on statistical learning and interpretable machine learning and is interested in epidemiological applications to high-dimensional genetic data and longitudinal register data. Marvin is also author of several R packages, including the random forest package ranger. Marvin presented the results of his latest paper, just accepted in Machine Learning journal, explaining the conditional predictive impact (CPI), a model-agnostic interpretable machine learning method which can handle correlated predictor variables and adjust for confounders. The method builds on the knockoff framework of Candès et al. (2018) and works in conjunction with any valid knockoff sampler, supervised learning algorithm, and loss function. Marvin briefly described the method, show selected simulation results and give an example (with R code) of the application. The CPI has been implemented in an R package, cpi, which can be downloaded from this URL.
 I'll give you an example in R. So if you think about machine learning, you probably think like image classification or natural language processing or speech recognition coming to your mind. So for example, you might see here the CT image and your machine learning detects a tumor right here in this CT image. But all of these applications are about prediction. But in epidemiology, that's also the definition of the WHO is that we're interested in the determinants of diseases. So that is interpretation. So we don't want to predict something, some disease states, we also want to do that. But that's, I would say, more rarely. But usually we're interested in understanding diseases. And that's what we want to do here. So to develop model agnostic interpretable machine learning. So model agnostic means you can choose your machine learning method and your interpretation methods method works anyway. So the interpretation method doesn't dictate the machine learning method you want to use. And more specifically, we want to talk about conditional variable importance. So consider this very typical example, you have an exposure x, an outcome y and a confounder z. And now the confounder has an effect on x and y, but there's no effect from your exposure to the outcome. And if you apply your standard linear model to that, you will see effects like that. So if you scale that, you would see that x has a zero effect on y and z has a large effect on y. And that I would say is correct if you look at this deck right here. But if you apply a typical machine learning method, so for example, you apply random forest and calculate the permutation variable importance, you'll get also an effect of x. And that's because x is correlated to y. So the method cannot handle cannot adjust for the confounding by the confounder z. The reason is that the linear model is a conditional method, but the random forest or in general, most machine learning interpretability methods are marginal measures. So we want to fill maybe this gap here on the right. So we want to do machine learning, but do a conditional testing. And if you, from a statistical perspective, the marginal test tests whether your variable of interest, call it xj, is independent of y. So is there a dependency between the two? And the conditional hypothesis we're interested in is xj independent of y, given all other x's. So all other variables you have in the data set that might be confounders. And as I just said, we want to do conditional testing with machine learning. Just you might have heard of the permutation importance. That's the one we just used in the random forest. I briefly explained the algorithm. So what you do is you fit your model to your data, you determine some kind of loss function. So how well does the model predict unseen data? And now you replace a variable of interest by a permuted version of that variable, and determine the loss afterwards. So how much does the prediction get worse if you permute your variable of interest? So if it gets worse, the variable was important. If it doesn't get worse, the variable wasn't important. And that's why your permutation importance is a difference between the two losses. So your estimated variable importance of the variable j is this difference. And that's the marginal measure as I've shown in the box plot on the second slide, because the permutation results in xj star. So the permuted of xj being independent of y, but also independent of our others, because it just permuted, it makes it independent of all other variables in your data. And what we do in our method is only a slight modification. Instead of the permutation, here the difference is highlighted in red. We replace the variable by its knockoff version. So I'll explain a little bit more on that. And then the remains the steps four and five remain the same. So we determine the loss afterwards and look at the difference. Now we call this the conditional predictive impact instead of the permutation variable importance. And the difference is that these knockoffs result in your now knockoff variable is independent of y, but preserves all correlations between to the other axis. So for example, the correlations to a confounder remains there. And that's why it's a conditional measure. For the knockoffs, I won't go into the details, but the idea is to have a knockoff matrix x tilde, which is where you have equal correlations between your original variables and the variables in the knockoff matrix. So the correlation between the two variables in the original data set is the same as the two knockoff variables. And also the same if you take one from the original and one from the knockoff matrix. But your x tilde is independent of y given x. So that was originally proposed for as negative controls for the forces covering rate. But that original method is this Kandes 2018 paper requires an existing variable points. And that's the part where the model agnostic comes into play, because this is not model agnostic, because you need that existing method. And they often use it from the Lassoux, but it also works for example with the random forest, you could also plug in other methods, but you need a model specific model specific variable importance measure for our method, you don't need that. There have many, many knockoff samplers have been proposed very recently. So they are multivariate Gaussian ones or second order multivariate Gaussian ones in Markov model, you can also use deep learning approaches for that, and so on. We now focus on the second order multivariate Gaussian in Markov model, but it actually doesn't matter so much, which does matter, but it works just with all of them. We'll see that a bit later. We can also do statistical inference. So you can show that our CPI estimate is as in totally normally distributed. So we can just use the instant wise loss for statistical inference. We change the algorithm just a little bit that we use as a look at instance wise loss and not the, so for example, instead of the mean squared error, we just look at the squared error. And then we can use that for statistical testing, and just do a T test or also a fishes accept randomization test for small samples actually also works for large samples. So that's a big plus that you can get statistical testing, you get standard error estimates, you get confidence intervals, but you don't get with most of the machine learning interpretability methods. So the result is here on the right, we see now on our toy example that we do see no effect of the exposure on the con on the outcome, but we do see an effect of the confounder on the outcome. And that's actually what you see in the graph. So we have a conditional measure based on machine learning. I also want to show some simulation results. If you're interested in the details of the simulation study, I have the slides prepared, just want to save some time. So these are the box plots of calculated CPI values with different machine learning methods, could argue that maybe the first one is not a machine learning method, and once on linear and on nonlinear data. And you see that and the effect size here on the horizontal axis, and you see that the CPI values increase with the effect size, that's what you would expect for it to work, but also that it's at zero for no effect, for example, the only case where it's not working is for nonlinear data on with the linear model, which makes sense. As a linear model has no power to detect anything on nonlinear data. That's why you might use machine learning in the end. You can also look at the type one and type two error. So here the zero effect size, that's the type one error. And you see that for all four methods, this is at 0.05 as expected, and the power increases over time. So by that you can see that it works again with all of these different machine learning methods. And I want to show you a brief example on how to use that. And I'll show you some R code for that. So to use, there's the CPI package. I forgot to put the GitHub link here, I just noted. So you would have to install it from GitHub at the moment because it's not on Cran yet. And you load the CPI package, the MLR package, and we also use ggplot for plotting. And we want to use the Boston Housing Data. The data is already included in the MLR package, but there is a two level factor and we have to convert that to binary. So that's the first step we have to do as a preparation. And then we can just apply CPI on the task we just defined. And we say here we want to use Ranger, so a random forest. We could add here, for example, we want to have 500 trees and try a value of whatever value you want to choose. And we said that we estimate loss and we need some kind of resampling for that. And here we use a 10-fold cross-validation. So it will then do internally a 10-fold cross-validation and estimate the loss by that cross-validation. And then you almost immediately get the result. And that's here, for example, for the variable RM, I think that's number of rooms. You get quite a high CPI estimate, very small p-value. And you also get the lower part of the confidence interval, which is also far away from zero. And you also get some others. For example, here this one, you don't know what the variable represents. The CPI value is close to zero, p-value is quite big, and also the lower end of the confidence interval is below zero. So that's then the result you get. We can do the same maybe again for a support vector machine. So now instead of Ranger, we use here the SVM with the radial kernel. And instead of just to show you that you can choose other methods here, instead of the 10-fold cross-validation, we use a five times repeated sub-sampling. So this is all. If you have used the MLR package before, you will know these re-sampling and make learner things that's specific to MLR. And we save the results from that call and plot it with ggplot. Then the result looks like this. So we see that again, this number of rooms get a high estimate. And now we plotted a bar plot and added some standard errors. And you see, for example, that you have some very small values. And by the standard error, you can also get some idea of the variability in that. Because it often happens that these things are a little bit unstable and bar plots of random forest variable importance might look completely different if you run it again. And it's, I think, quite important to get variability estimates for that. Okay, to conclude, so our conditional predictive impact is the model-agnostic method. So you can plug in any machine learning method you want to. It can be as simple as the linear model. But it can also be a fancy deep learning algorithm. You don't have to refit it. You just have to predict again. So even if you have a complicated deep learning method, the CPI will be quite fast because prediction is fast in your network. As we've seen it's conditional. So you can adjust for confounders and handling correlations. And I think that's very, very important if you really want to interpret, especially in epidemiology, any effects of any, I don't know, let it be an effect of a gene on a disease or let it be lifestyle factors, you always have to adjust for confounders. And that's actually not possible if you use the standard interpretability methods. You can do statistical testing without mutations or bootstrapping. And so far we have applied that to low-dimensional tabular data. So that's kind of what we have seen with the Boston Housing data. We've also, we also did that on other data sets. In the paper, we also have an example that's already quite high-dimensional on gene expression data. And recently that's not in the paper and also not published yet, is the application to genome-wide data. But this Gaussian knockoff sampler won't work for genome-wide data. So there we have several hundred thousand variables. So, but there's a hidden mark of knockoff sampler, which we can use there. And that's also, I think a nice feature that you, if you want to go for a new application where the other knockoff samplers won't work, you can plug in any new or different knockoff sampler. You want to just have to fit to the data at hand. And for the future, so a very important thing we have to, we have to find a solution for is to handle categorical data. So this genetic data is kind of categorical, but this is a very specific application. But in general, the knockoffs have been mostly proposed for continuous data, not for categorical one. And one solution could be dummy coding, but that also has some problems. And the next step in that direction is then mixed data. So if you have categorical and continuous data in the same data set, as in reality, you usually have. So that's, I think, for the application, a very, very important point to add. And we can also look at local importance. So that means, so I said that you do the statistical testing over the sample wise loss. So you could quite easily look at local importance. So you get the loss for every, for every person and usually in an AP data set. And then you could look at subgroups of persons and only calculate the effect for a subgroup. And a technical step we have to do is to also add support for MLR3. So you maybe have heard, if you have used MLR, that there's a new version and the old one is not really developed any further. So it would be good to also add support for the new MLR package. Okay. Thank you for listening. And now I'm open for questions. Yes. Thank you, Marvin. And so, yes, that was really straight, straight talk and on time. So it gives us a lot of time to ask you questions. So I'm opening the floor. Please, if you have a question, you can either write it on the chat or just turn on the microphone and ask the question directly. Well, I have a sort of question, I think. Please. I use our a fair amount for modeling. And one of the things we sometimes have to do is, if one is, if I am producing something for a continent, let's say, I have to subdivide the areas into zones and then do separate random forest models for each. And I have trouble combining them, combining, I mean, getting any, some sort of idea apart from the standard sensitivity or whatever and specificity. I have trouble combining the results of all these different models into one sort of overview of the sort that you're suggesting. Is your framework amenable to that? Can you or not? So you could fit a model on the whole data and then in the just in the interpretation part. Yeah. I mean, essentially, we would, it's a matter of combining the results from several different models. If you have a model for a continent, let's say, I would do maybe 10 models for different zones. Those zones may not be a country, they may be, let's say, landings, forest or cultivation. So they interlock, which makes it quite difficult to play with. So I'm interested to know whether it's possible to to identify, get some sort of overall identification of the different confounders, as you call them, by combining the results from the different models. I have no idea. I've always had trouble with RF from that point of view. And I wonder if your methodology would be more amenable to that. Actually, that's, I would say that depends on the underlying machine learning method, because our method is kind of post hoc. So you can choose whatever machine learning method you want. You have your model, and you might have already tested it for prediction performance and all that. And then you want to look at the important factors for the prediction, or maybe even interpret the facts in there. Okay. Okay. Time for more questions, please. So just to just to confirm, Marvin, so that you made the package called CPI. And that comes with this publication that you submitted with your colleague, right? Yes. Maybe tell us this package is still not on the ground, but how much is it ready to be used? I just put the link to the chat, if you're interested. I forgot it on the slide, but it's also in the paper. And I think it's ready to use. And is it optimized for large data set? Is it very computational? So the computational part would be the refitting here with the resampling method. But you don't, as I've said, you don't have to refit. So it's not very computational. If you don't have a model which takes very long to predict. So Tom, you know that the random forests can take some time to predict. And for example, neural networks are very fast in prediction. But usually it's not such a big issue. The computation time, the computation time for the resampling, what is an issue is the computation time for the knockoffs. So if you have low dimensional data, it's usually quite fast. But if you have high dimensional data, it takes some time. So for example, on the gene expression data set, it took, I think, 48 hours to calculate the knockoffs without parallel computation and all that. So that could be optimized, but it still took some time. But I think the knockoffs are improving, very much improving, and there will be better knockoff procedures in the future also for high dimensional data. Okay, can you go to slide 12? Sure. So like the new, I mean, the method that you introduced is the one on the right, the right plot. I see that the confidence bands are really narrow, they're more narrow than on the linear model. And so is this also some kind of a like over optimistic confidence intervals, because the lower one is really narrow, I mean, literally like there's no uncertainty. So is there some overfitting happening? That's what I'm trying to ask. Or do you find it, have you done a like a test of the how accurate are the confidence intervals? So actually, these, these are not the confidence intervals, but these are just box plots of simulation replicates. Okay, okay, sorry, then I misunderstood that. And you see that here for the linear model, this one is quite small, and this one is big, and here's the other way around. Actually, I haven't really thought about that. I bought the different, I might have to investigate why here it's always zero, because it could also be always zero here, because this should also be perfect conditional. Started with the typical machine learning tasks. So these benchmarking data sets as post nousing. And but our actually the reason to develop such a method was genetic data. But it turned out, as I've explained that the method is very general. So in general, it makes sense as soon as you have correlated data to use the CPI or in general, the conditional method. And you could ask a researcher and ask, do you have correlations in your data? And I guess it will be hard to find someone who says no. So I would say it's a very, the field of application is very, very broad. So it's maybe not only model agnostic, but also application agnostic. So you but you have to find a knockoff sampler that works with your data. And that's not always easy. So for example, the one for the genome white data, we were lucky that it was already there. So we didn't have to develop it ourselves. But yeah, knock them new knockoffs, new knockoff method or knockoff samples proposed on the time. So it seems to be very reactive, active research topic. So that will then also broaden the scope of the CPI because they completely realize on the knockoffs. It's not working yet for categorical or mixed data, except some special cases like binary variables or on genetic data, it's working with this one specific type of knockoff sampler. But in general, that's a major challenge to solve. It's useful if you have non-linear or high dimensional data. So images, a speech or text and always machine learning is a big plus. But also just for if you have big data sets. And if you if we go back to my genetic example, so what you usually do is the univariate regression model. So you take each genetic variant, calculate the regression model on the outcome, and maybe adjust for some confounders to get an effect estimate. But that completely misses any relations between the genetic variants. That's why we want to use a multivariate method. But to use a multivariate regression won't work because then you have this multi-cognitive issues that you have more variables than observations and the whole modeling the model does not fit. So it's not working. And that's then where machine learning might come into play. But then you have your multivariate model. So you apply your random forest to your genome white data. But then in the end, it's not actually multivariate again, if you have not a conditional importance measure. If you look if you want to look at the importance of the genetic variants, and then and yeah, and that it's one case which can be solved with the the CPI method. The typical examples are as I've explained always on prediction. So and I think these are big implications of machine learning. So for example, you want to do risk prediction, or you want to do personalized medicine and give treatment which is personalized to a specific person. And I think machine learning is very useful for these. But there are also many smaller things which are maybe not so well known or just very specific. So for an example, maybe going back to the genetic example, genetic epidemiology, you use machine learning for risk prediction. So you might have some sequence data or some gene expression data and you want to predict someone's risk for a disease. And you might also want to use interpretability methods as I described to find genetic variants which are associated with the disease. So this is all I think well known and one of the well known applications of machine learning and epidemiology. But they also if you look at in the sequence data, if you look at the bioinformatics tool chain used to pre-process the data, there are so many very, very small steps where also machine learning comes into play. And that's often overlooked. So you often just look at these major prediction applications. But also there's obviously a hype on machine learning. And I think machine learning cannot solve all the problems sometimes start off. So if our goal in the end is to understand the disease or to understand risk factors, we still need statistics and we also still need epidemiology. So machine learning is a tool that can help us but it's not like the AI which solves all the problems for us.
 I'll give you an example in R. So if you think about machine learning, you probably think  like image classification or natural language processing or speech recognition coming to  your mind. So for example, you might see here the CT image and your machine learning detects a tumor  right here in this CT image. But all of these applications are about prediction.  But in epidemiology, that's also the definition of the WHO is that we're interested in the  determinants of diseases. So that is interpretation. So we don't want to predict something, some disease  states, we also want to do that. But that's, I would say, more rarely. But usually we're  interested in understanding diseases. And that's what we want to do here. So to develop model  agnostic interpretable machine learning. So model agnostic means you can choose your machine  learning method and your interpretation methods method works anyway. So the interpretation method  doesn't dictate the machine learning method you want to use. And more specifically, we want to  talk about conditional variable importance. So consider this very typical example, you have an  exposure x, an outcome y and a confounder z. And now the confounder has an effect on x and y,  but there's no effect from your exposure to the outcome. And if you apply your standard linear  model to that, you will see effects like that. So if you scale that, you would see that x has a  zero effect on y and z has a large effect on y. And that I would say is correct if you look at  this deck right here. But if you apply a typical machine learning method, so for example, you  apply random forest and calculate the permutation variable importance, you'll get also an effect of  x. And that's because x is correlated to y. So the method cannot handle cannot adjust for the  confounding by the confounder z. The reason is that the linear model is a conditional method,  but the random forest or in general, most machine learning interpretability methods are marginal  measures. So we want to fill maybe this gap here on the right. So we want to do machine learning,  but do a conditional testing. And if you, from a statistical perspective, the marginal test  tests whether your variable of interest, call it xj, is independent of y. So is there a dependency  between the two? And the conditional hypothesis we're interested in is xj independent of y,  given all other x's. So all other variables you have in the data set that might be  confounders. And as I just said, we want to do conditional testing with machine learning.  Just you might have heard of the permutation importance. That's the one we just used in the  random forest. I briefly explained the algorithm. So what you do is you fit your model to your data,  you determine some kind of loss function. So how well does the model predict unseen data?  And now you replace a variable of interest by a permuted version of that variable,  and determine the loss afterwards. So how much does the prediction get worse if you permute  your variable of interest? So if it gets worse, the variable was important. If it doesn't get  worse, the variable wasn't important. And that's why your permutation importance is a difference  between the two losses. So your estimated variable importance of the variable j is this difference.  And that's the marginal measure as I've shown in the box plot on the second slide,  because the permutation results in xj star. So the permuted of xj being independent of y,  but also independent of our others, because it just permuted, it makes it independent of all other  variables in your data. And what we do in our method is only a slight modification. Instead of  the permutation, here the difference is highlighted in red. We replace the variable by its knockoff  version. So I'll explain a little bit more on that. And then the remains the steps four and five remain  the same. So we determine the loss afterwards and look at the difference. Now we call this the  conditional predictive impact instead of the permutation variable importance.  And the difference is that these knockoffs result in your now knockoff variable is independent  of y, but preserves all correlations between to the other axis. So for example, the correlations to  a confounder remains there. And that's why it's a conditional measure.  For the knockoffs, I won't go into the details, but the idea is to have a knockoff matrix x tilde,  which is where you have equal correlations between your original variables and the variables in the  knockoff matrix. So the correlation between the two variables in the original data set is the same  as the two knockoff variables. And also the same if you take one from the original and one from the  knockoff matrix. But your x tilde is independent of y given x. So that was originally proposed for  as negative controls for the forces covering rate. But that original method is this Kandes  2018 paper requires an existing variable points. And that's the part where the model agnostic comes  into play, because this is not model agnostic, because you need that existing method. And they  often use it from the Lassoux, but it also works for example with the random forest,  you could also plug in other methods, but you need a model specific model specific variable  importance measure for our method, you don't need that. There have many, many knockoff samplers  have been proposed very recently. So they are multivariate Gaussian ones or second order multivariate  Gaussian ones in Markov model, you can also use deep learning approaches for that, and so on.  We now focus on the second order multivariate Gaussian in Markov model, but it actually  doesn't matter so much, which does matter, but it works just with all of them. We'll see that  a bit later. We can also do statistical inference. So you can show that our CPI estimate is as  in totally normally distributed. So we can just use the instant wise loss for statistical inference.  We change the algorithm just a little bit that we use as a look at instance wise loss and not  the, so for example, instead of the mean squared error, we just look at the squared error. And then  we can use that for statistical testing, and just do a T test or also a fishes accept randomization  test for small samples actually also works for large samples. So that's a big plus that you  can get statistical testing, you get standard error estimates, you get confidence intervals,  but you don't get with most of the machine learning interpretability methods.  So the result is here on the right, we see now on our toy example that we do see no effect of  the exposure on the con on the outcome, but we do see an effect of the confounder on the outcome.  And that's actually what you see in the graph. So we have a conditional measure based on machine  learning. I also want to show some simulation results. If you're interested in the details of  the simulation study, I have the slides prepared, just want to save some time. So these are the  box plots of calculated CPI values with different machine learning methods, could argue that maybe  the first one is not a machine learning method, and once on linear and on nonlinear data.  And you see that and the effect size here on the horizontal axis, and you see that the CPI  values increase with the effect size, that's what you would expect for it to work, but also that  it's at zero for no effect, for example, the only case where it's not working is for nonlinear data  on with the linear model, which makes sense. As a linear model has no power to detect anything on  nonlinear data. That's why you might use machine learning in the end. You can also look at the  type one and type two error. So here the zero effect size, that's the type one error. And you  see that for all four methods, this is at 0.05 as expected, and the power increases over time.  So by that you can see that it works again with all of these different machine learning methods.  And I want to show you a brief example on how to use that. And I'll show you some R code for that.  So to use, there's the CPI package. I forgot to put the GitHub link here, I just noted. So you  would have to install it from GitHub at the moment because it's not on Cran yet. And you load the CPI  package, the MLR package, and we also use ggplot for plotting. And we want to use the Boston Housing  Data. The data is already included in the MLR package, but there is a two level factor and we  have to convert that to binary. So that's the first step we have to do as a preparation.  And then we can just apply CPI on the task we just defined. And we say here we want to use  Ranger, so a random forest. We could add here, for example, we want to have 500 trees and try a  value of whatever value you want to choose. And we said that we estimate loss and we need some kind  of resampling for that. And here we use a 10-fold cross-validation. So it will then do internally  a 10-fold cross-validation and estimate the loss by that cross-validation. And then you  almost immediately get the result. And that's here, for example, for the variable RM, I think  that's number of rooms. You get quite a high CPI estimate, very small p-value. And you also get  the lower part of the confidence interval, which is also far away from zero. And you also get some  others. For example, here this one, you don't know what the variable represents. The CPI  value is close to zero, p-value is quite big, and also the lower end of the confidence interval is  below zero. So that's then the result you get. We can do the same maybe again for a support vector  machine. So now instead of Ranger, we use here the SVM with the radial kernel. And instead of just  to show you that you can choose other methods here, instead of the 10-fold cross-validation,  we use a five times repeated sub-sampling. So this is all. If you have used the MLR package  before, you will know these re-sampling and make learner things that's specific to MLR.  And we save the results from that call and plot it with ggplot. Then the result looks like this.  So we see that again, this number of rooms get a high estimate. And now we plotted a bar plot  and added some standard errors. And you see, for example, that you have some very small values.  And by the standard error, you can also get some idea of the variability in that. Because it often  happens that these things are a little bit unstable and bar plots of random forest variable  importance might look completely different if you run it again. And it's, I think, quite important to  get variability estimates for that. Okay, to conclude, so our conditional predictive impact is the  model-agnostic method. So you can plug in any machine learning method you want to. It can be  as simple as the linear model. But it can also be a fancy deep learning algorithm. You don't  have to refit it. You just have to predict again. So even if you have a complicated deep learning  method, the CPI will be quite fast because prediction is fast in your network. As we've seen  it's conditional. So you can adjust for confounders and handling correlations. And I think that's very,  very important if you really want to interpret, especially in epidemiology, any effects of  any, I don't know, let it be an effect of a gene on a disease or let it be lifestyle factors,  you always have to adjust for confounders. And that's actually not possible if you use  the standard interpretability methods. You can do statistical testing without  mutations or bootstrapping. And so far we have applied that to low-dimensional tabular data.  So that's kind of what we have seen with the Boston Housing data. We've also, we also did that  on other data sets. In the paper, we also have an example that's already quite high-dimensional  on gene expression data. And recently that's not in the paper and also not published yet,  is the application to genome-wide data. But this Gaussian knockoff sampler won't work for  genome-wide data. So there we have several hundred thousand variables. So, but there's a hidden mark  of knockoff sampler, which we can use there. And that's also, I think a nice feature that you,  if you want to go for a new application where the other knockoff samplers won't work, you can  plug in any new or different knockoff sampler. You want to just have to fit to the data at hand.  And for the future, so a very important thing we have to, we have to find a solution for  is to handle categorical data. So this genetic data is kind of categorical, but this is a very  specific application. But in general, the knockoffs have been mostly proposed for continuous data,  not for categorical one. And one solution could be dummy coding, but that also has some problems.  And the next step in that direction is then mixed data. So if you have categorical and  continuous data in the same data set, as in reality, you usually have. So that's, I think,  for the application, a very, very important point to add. And we can also look at local importance.  So that means, so I said that you do the statistical testing over the sample wise loss.  So you could quite easily look at local importance. So you get the loss for every,  for every person and usually in an AP data set. And then you could look at subgroups of persons  and only calculate the effect for a subgroup. And a technical step we have to do is to also add  support for MLR3. So you maybe have heard, if you have used MLR, that there's a new version  and the old one is not really developed any further. So it would be good to also add support  for the new MLR package. Okay. Thank you for listening. And now I'm open for questions.  Yes. Thank you, Marvin. And so, yes, that was really straight, straight talk and on time.  So it gives us a lot of time to ask you questions. So I'm opening the floor. Please,  if you have a question, you can either write it on the chat or just turn on the microphone and  ask the question directly. Well, I have a sort of question, I think.  Please. I use our a fair amount for modeling. And one of the things we sometimes have to do is,  if one is, if I am producing something for a continent, let's say, I have to subdivide  the areas into zones and then do separate random forest models for each. And I have trouble combining  them, combining, I mean, getting any, some sort of idea apart from the standard sensitivity or whatever  and specificity. I have trouble combining the results of all these different models into one  sort of overview of the sort that you're suggesting. Is your framework amenable to that? Can you or not?  So you could fit a model on the whole data and then in the just in the interpretation part.  Yeah. I mean, essentially, we would, it's a matter of combining the results from several  different models. If you have a model for a continent, let's say, I would do maybe 10 models  for different zones. Those zones may not be a country, they may be, let's say, landings,  forest or cultivation. So they interlock, which makes it quite difficult to play with.  So I'm interested to know whether it's possible to  to identify, get some sort of overall identification of the different confounders, as you call them,  by combining the results from the different models. I have no idea. I've always had trouble with RF  from that point of view. And I wonder if your methodology would be more amenable to that.  Actually, that's, I would say that depends on the underlying machine learning method, because  our method is kind of post hoc. So you can choose whatever machine learning method you want. You  have your model, and you might have already tested it for prediction performance and all that.  And then you want to look at the important factors for the prediction, or maybe even interpret  the facts in there. Okay. Okay. Time for more questions, please.  So just to just to confirm, Marvin, so that you made the package called CPI. And that comes with  this publication that you submitted with your colleague, right? Yes. Maybe tell us this package  is still not on the ground, but how much is it ready to be used? I just put the link to the chat,  if you're interested. I forgot it on the slide, but it's also in the paper. And I think it's ready  to use. And is it optimized for large data set? Is it very computational? So the computational part  would be the refitting here with the resampling method. But you don't, as I've said, you don't  have to refit. So it's not very computational. If you don't have a model which takes very long to  predict. So Tom, you know that the random forests can take some time to predict. And for example,  neural networks are very fast in prediction. But usually it's not such a big issue.  The computation time, the computation time for the resampling, what is an issue is the  computation time for the knockoffs. So if you have low dimensional data, it's usually quite fast.  But if you have high dimensional data, it takes some time. So for example, on the gene expression  data set, it took, I think, 48 hours to calculate the knockoffs without parallel computation and all  that. So that could be optimized, but it still took some time. But I think the knockoffs are  improving, very much improving, and there will be better knockoff procedures in the future also for  high dimensional data. Okay, can you go to slide 12? Sure. So like the new, I mean, the method that  you introduced is the one on the right, the right plot. I see that the confidence bands are really  narrow, they're more narrow than on the linear model. And so is this also some kind of a  like over optimistic confidence intervals, because the lower one is really narrow, I mean,  literally like there's no uncertainty. So is there some overfitting happening? That's what I'm  trying to ask. Or do you find it, have you done a like a test of the how accurate are the confidence  intervals? So actually, these, these are not the confidence intervals, but these are just box plots  of simulation replicates. Okay, okay, sorry, then I misunderstood that. And you see that here for  the linear model, this one is quite small, and this one is big, and here's the other way around.  Actually, I haven't really thought about that. I bought the different, I might have to investigate  why here it's always zero, because it could also be always zero here, because this should also be  perfect conditional. Started with the typical machine learning tasks. So these benchmarking  data sets as post nousing. And but our actually the reason to develop such a method was genetic  data. But it turned out, as I've explained that the method is very general. So in general, it makes  sense as soon as you have correlated data to use the CPI or in general, the conditional method. And  you could ask a researcher and ask, do you have correlations in your data? And I guess it will be  hard to find someone who says no. So I would say it's a very, the field of application is very,  very broad. So it's maybe not only model agnostic, but also application agnostic.  So you but you have to find a knockoff sampler that works with your data. And that's not always easy.  So for example, the one for the genome white data, we were lucky that it was already there.  So we didn't have to develop it ourselves. But yeah, knock them new knockoffs, new knockoff method  or knockoff samples proposed on the time. So it seems to be very reactive, active research topic.  So that will then also broaden the scope of the CPI because they completely realize on the knockoffs.  It's not working yet for categorical or mixed data, except some special cases like binary variables or  on genetic data, it's working with this one specific type of knockoff sampler. But in general,  that's a major challenge to solve. It's useful if you have non-linear or high dimensional data.  So images, a speech or text and always machine learning is a big plus. But also just for  if you have big data sets. And if you if we go back to my genetic example, so what you usually do  is the univariate regression model. So you take each genetic variant, calculate the regression  model on the outcome, and maybe adjust for some confounders to get an effect estimate.  But that completely misses any relations between the genetic variants. That's why we want to use a  multivariate method. But to use a multivariate regression won't work because then you have  this multi-cognitive issues that you have more variables than observations and the whole modeling  the model does not fit. So it's not working. And that's then where machine learning might  come into play. But then you have your multivariate model. So you apply your random forest to your  genome white data. But then in the end, it's not actually multivariate again, if you have not a  conditional importance measure. If you look if you want to look at the importance of the  genetic variants, and then and yeah, and that it's one case which can be solved with the the CPI method.  The typical examples are as I've explained always on prediction. So and I think these are  big implications of machine learning. So for example, you want to do risk prediction,  or you want to do personalized medicine and give treatment which is personalized to a specific  person. And I think machine learning is very useful for these. But there are also many smaller things  which are maybe not so well known or just very specific. So for an example, maybe going back to  the genetic example, genetic epidemiology, you use machine learning for risk prediction. So you might  have some sequence data or some gene expression data and you want to predict someone's risk for a  disease. And you might also want to use interpretability methods as I described to find genetic  variants which are associated with the disease. So this is all I think well known and one of the  well known applications of machine learning and epidemiology. But they also if you look at  in the sequence data, if you look at the bioinformatics tool chain used to pre-process the data,  there are so many very, very small steps where also machine learning comes into play. And that's  often overlooked. So you often just look at these major prediction applications. But also  there's obviously a hype on machine learning. And I think machine learning cannot solve all  the problems sometimes start off. So if our goal in the end is to understand the disease or to  understand risk factors, we still need statistics and we also still need epidemiology. So machine  learning is a tool that can help us but it's not like the AI which solves all the problems for us.
MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_0_131.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_132_251.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_252_467.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_468_2279.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_2280_4451.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_4452_5447.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_5448_7355.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_7356_8699.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_8700_11351.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_11352_12527.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_12528_13163.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_13164_15191.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_15192_20435.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_20436_25499.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_25500_31691.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_31692_33527.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_33528_35567.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_35568_35687.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_35688_35807.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_35808_35855.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_35856_35987.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_35988_37115.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_37116_38207.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_38208_38255.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_38256_38387.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_38388_38747.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_38748_38795.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_38796_38927.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_38928_39395.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_39396_39455.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_39456_39803.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_39804_40295.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_40296_41147.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_41148_41663.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_41664_42035.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_42036_42095.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_42096_42779.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_42780_42935.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_42936_43355.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_43356_43403.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_43404_43775.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_43776_43943.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_43944_44231.png MOOD_ScienceWebinars_MarvinWright_ModelAgnosticInterpretableMachineLearning_June2021_44232_44253.png
I'll give you an example in R. So if you think about machine learning, you probably think like image classification or natural language processing or speech recognition coming to your mind. So for example, you might see here the CT image and your machine learning detects a tumor right here in this CT image. But all of these applications are about prediction. But in epidemiology, that's also the definition of the WHO is that we're interested in the determinants of diseases. So that is interpretation. So we don't want to predict something, some disease states, we also want to do that. But that's, I would say, more rarely. But usually we're interested in understanding diseases. And that's what we want to do here. So to develop model agnostic interpretable machine learning. So model agnostic means you can choose your machine learning method and your interpretation methods method works anyway. So the interpretation method doesn't dictate the machine learning method you want to use. And more specifically, we want to talk about conditional variable importance. So consider this very typical example, you have an exposure x, an outcome y and a confounder z. And now the confounder has an effect on x and y, but there's no effect from your exposure to the outcome. And if you apply your standard linear model to that, you will see effects like that. So if you scale that, you would see that x has a zero effect on y and z has a large effect on y. And that I would say is correct if you look at this deck right here. But if you apply a typical machine learning method, so for example, you apply random forest and calculate the permutation variable importance, you'll get also an effect of x. And that's because x is correlated to y. So the method cannot handle cannot adjust for the confounding by the confounder z. The reason is that the linear model is a conditional method, but the random forest or in general, most machine learning interpretability methods are marginal measures. So we want to fill maybe this gap here on the right. So we want to do machine learning, but do a conditional testing. And if you, from a statistical perspective, the marginal test tests whether your variable of interest, call it xj, is independent of y. So is there a dependency between the two? And the conditional hypothesis we're interested in is xj independent of y, given all other x's. So all other variables you have in the data set that might be confounders. And as I just said, we want to do conditional testing with machine learning. Just you might have heard of the permutation importance. That's the one we just used in the random forest. I briefly explained the algorithm. So what you do is you fit your model to your data, you determine some kind of loss function. So how well does the model predict unseen data? And now you replace a variable of interest by a permuted version of that variable, and determine the loss afterwards. So how much does the prediction get worse if you permute your variable of interest? So if it gets worse, the variable was important. If it doesn't get worse, the variable wasn't important. And that's why your permutation importance is a difference between the two losses. So your estimated variable importance of the variable j is this difference. And that's the marginal measure as I've shown in the box plot on the second slide, because the permutation results in xj star. So the permuted of xj being independent of y, but also independent of our others, because it just permuted, it makes it independent of all other variables in your data. And what we do in our method is only a slight modification. Instead of the permutation, here the difference is highlighted in red. We replace the variable by its knockoff version. So I'll explain a little bit more on that. And then the remains the steps four and five remain the same. So we determine the loss afterwards and look at the difference. Now we call this the conditional predictive impact instead of the permutation variable importance. And the difference is that these knockoffs result in your now knockoff variable is independent of y, but preserves all correlations between to the other axis. So for example, the correlations to a confounder remains there. And that's why it's a conditional measure. For the knockoffs, I won't go into the details, but the idea is to have a knockoff matrix x tilde, which is where you have equal correlations between your original variables and the variables in the knockoff matrix. So the correlation between the two variables in the original data set is the same as the two knockoff variables. And also the same if you take one from the original and one from the knockoff matrix. But your x tilde is independent of y given x. So that was originally proposed for as negative controls for the forces covering rate. But that original method is this Kandes 2018 paper requires an existing variable points. And that's the part where the model agnostic comes into play, because this is not model agnostic, because you need that existing method. And they often use it from the Lassoux, but it also works for example with the random forest, you could also plug in other methods, but you need a model specific model specific variable importance measure for our method, you don't need that. There have many, many knockoff samplers have been proposed very recently. So they are multivariate Gaussian ones or second order multivariate Gaussian ones in Markov model, you can also use deep learning approaches for that, and so on. We now focus on the second order multivariate Gaussian in Markov model, but it actually doesn't matter so much, which does matter, but it works just with all of them. We'll see that a bit later. We can also do statistical inference. So you can show that our CPI estimate is as in totally normally distributed. So we can just use the instant wise loss for statistical inference. We change the algorithm just a little bit that we use as a look at instance wise loss and not the, so for example, instead of the mean squared error, we just look at the squared error. And then we can use that for statistical testing, and just do a T test or also a fishes accept randomization test for small samples actually also works for large samples. So that's a big plus that you can get statistical testing, you get standard error estimates, you get confidence intervals, but you don't get with most of the machine learning interpretability methods. So the result is here on the right, we see now on our toy example that we do see no effect of the exposure on the con on the outcome, but we do see an effect of the confounder on the outcome. And that's actually what you see in the graph. So we have a conditional measure based on machine learning. I also want to show some simulation results. If you're interested in the details of the simulation study, I have the slides prepared, just want to save some time. So these are the box plots of calculated CPI values with different machine learning methods, could argue that maybe the first one is not a machine learning method, and once on linear and on nonlinear data. And you see that and the effect size here on the horizontal axis, and you see that the CPI values increase with the effect size, that's what you would expect for it to work, but also that it's at zero for no effect, for example, the only case where it's not working is for nonlinear data on with the linear model, which makes sense. As a linear model has no power to detect anything on nonlinear data. That's why you might use machine learning in the end. You can also look at the type one and type two error. So here the zero effect size, that's the type one error. And you see that for all four methods, this is at 0.05 as expected, and the power increases over time. So by that you can see that it works again with all of these different machine learning methods. And I want to show you a brief example on how to use that. And I'll show you some R code for that. So to use, there's the CPI package. I forgot to put the GitHub link here, I just noted. So you would have to install it from GitHub at the moment because it's not on Cran yet. And you load the CPI package, the MLR package, and we also use ggplot for plotting. And we want to use the Boston Housing Data. The data is already included in the MLR package, but there is a two level factor and we have to convert that to binary. So that's the first step we have to do as a preparation. And then we can just apply CPI on the task we just defined. And we say here we want to use Ranger, so a random forest. We could add here, for example, we want to have 500 trees and try a value of whatever value you want to choose. And we said that we estimate loss and we need some kind of resampling for that. And here we use a 10-fold cross-validation. So it will then do internally a 10-fold cross-validation and estimate the loss by that cross-validation. And then you almost immediately get the result. And that's here, for example, for the variable RM, I think that's number of rooms. You get quite a high CPI estimate, very small p-value. And you also get the lower part of the confidence interval, which is also far away from zero. And you also get some others. For example, here this one, you don't know what the variable represents. The CPI value is close to zero, p-value is quite big, and also the lower end of the confidence interval is below zero. So that's then the result you get. We can do the same maybe again for a support vector machine. So now instead of Ranger, we use here the SVM with the radial kernel. And instead of just to show you that you can choose other methods here, instead of the 10-fold cross-validation, we use a five times repeated sub-sampling. So this is all. If you have used the MLR package before, you will know these re-sampling and make learner things that's specific to MLR. And we save the results from that call and plot it with ggplot. Then the result looks like this. So we see that again, this number of rooms get a high estimate. And now we plotted a bar plot and added some standard errors. And you see, for example, that you have some very small values. And by the standard error, you can also get some idea of the variability in that. Because it often happens that these things are a little bit unstable and bar plots of random forest variable importance might look completely different if you run it again. And it's, I think, quite important to get variability estimates for that. Okay, to conclude, so our conditional predictive impact is the model-agnostic method. So you can plug in any machine learning method you want to. It can be as simple as the linear model. But it can also be a fancy deep learning algorithm. You don't have to refit it. You just have to predict again. So even if you have a complicated deep learning method, the CPI will be quite fast because prediction is fast in your network. As we've seen it's conditional. So you can adjust for confounders and handling correlations. And I think that's very, very important if you really want to interpret, especially in epidemiology, any effects of any, I don't know, let it be an effect of a gene on a disease or let it be lifestyle factors, you always have to adjust for confounders. And that's actually not possible if you use the standard interpretability methods. You can do statistical testing without mutations or bootstrapping. And so far we have applied that to low-dimensional tabular data. So that's kind of what we have seen with the Boston Housing data. We've also, we also did that on other data sets. In the paper, we also have an example that's already quite high-dimensional on gene expression data. And recently that's not in the paper and also not published yet, is the application to genome-wide data. But this Gaussian knockoff sampler won't work for genome-wide data. So there we have several hundred thousand variables. So, but there's a hidden mark of knockoff sampler, which we can use there. And that's also, I think a nice feature that you, if you want to go for a new application where the other knockoff samplers won't work, you can plug in any new or different knockoff sampler. You want to just have to fit to the data at hand. And for the future, so a very important thing we have to, we have to find a solution for is to handle categorical data. So this genetic data is kind of categorical, but this is a very specific application. But in general, the knockoffs have been mostly proposed for continuous data, not for categorical one. And one solution could be dummy coding, but that also has some problems. And the next step in that direction is then mixed data. So if you have categorical and continuous data in the same data set, as in reality, you usually have. So that's, I think, for the application, a very, very important point to add. And we can also look at local importance. So that means, so I said that you do the statistical testing over the sample wise loss. So you could quite easily look at local importance. So you get the loss for every, for every person and usually in an AP data set. And then you could look at subgroups of persons and only calculate the effect for a subgroup. And a technical step we have to do is to also add support for MLR3. So you maybe have heard, if you have used MLR, that there's a new version and the old one is not really developed any further. So it would be good to also add support for the new MLR package. Okay. Thank you for listening. And now I'm open for questions. Yes. Thank you, Marvin. And so, yes, that was really straight, straight talk and on time. So it gives us a lot of time to ask you questions. So I'm opening the floor. Please, if you have a question, you can either write it on the chat or just turn on the microphone and ask the question directly. Well, I have a sort of question, I think. Please. I use our a fair amount for modeling. And one of the things we sometimes have to do is, if one is, if I am producing something for a continent, let's say, I have to subdivide the areas into zones and then do separate random forest models for each. And I have trouble combining them, combining, I mean, getting any, some sort of idea apart from the standard sensitivity or whatever and specificity. I have trouble combining the results of all these different models into one sort of overview of the sort that you're suggesting. Is your framework amenable to that? Can you or not? So you could fit a model on the whole data and then in the just in the interpretation part. Yeah. I mean, essentially, we would, it's a matter of combining the results from several different models. If you have a model for a continent, let's say, I would do maybe 10 models for different zones. Those zones may not be a country, they may be, let's say, landings, forest or cultivation. So they interlock, which makes it quite difficult to play with. So I'm interested to know whether it's possible to to identify, get some sort of overall identification of the different confounders, as you call them, by combining the results from the different models. I have no idea. I've always had trouble with RF from that point of view. And I wonder if your methodology would be more amenable to that. Actually, that's, I would say that depends on the underlying machine learning method, because our method is kind of post hoc. So you can choose whatever machine learning method you want. You have your model, and you might have already tested it for prediction performance and all that. And then you want to look at the important factors for the prediction, or maybe even interpret the facts in there. Okay. Okay. Time for more questions, please. So just to just to confirm, Marvin, so that you made the package called CPI. And that comes with this publication that you submitted with your colleague, right? Yes. Maybe tell us this package is still not on the ground, but how much is it ready to be used? I just put the link to the chat, if you're interested. I forgot it on the slide, but it's also in the paper. And I think it's ready to use. And is it optimized for large data set? Is it very computational? So the computational part would be the refitting here with the resampling method. But you don't, as I've said, you don't have to refit. So it's not very computational. If you don't have a model which takes very long to predict. So Tom, you know that the random forests can take some time to predict. And for example, neural networks are very fast in prediction. But usually it's not such a big issue. The computation time, the computation time for the resampling, what is an issue is the computation time for the knockoffs. So if you have low dimensional data, it's usually quite fast. But if you have high dimensional data, it takes some time. So for example, on the gene expression data set, it took, I think, 48 hours to calculate the knockoffs without parallel computation and all that. So that could be optimized, but it still took some time. But I think the knockoffs are improving, very much improving, and there will be better knockoff procedures in the future also for high dimensional data. Okay, can you go to slide 12? Sure. So like the new, I mean, the method that you introduced is the one on the right, the right plot. I see that the confidence bands are really narrow, they're more narrow than on the linear model. And so is this also some kind of a like over optimistic confidence intervals, because the lower one is really narrow, I mean, literally like there's no uncertainty. So is there some overfitting happening? That's what I'm trying to ask. Or do you find it, have you done a like a test of the how accurate are the confidence intervals? So actually, these, these are not the confidence intervals, but these are just box plots of simulation replicates. Okay, okay, sorry, then I misunderstood that. And you see that here for the linear model, this one is quite small, and this one is big, and here's the other way around. Actually, I haven't really thought about that. I bought the different, I might have to investigate why here it's always zero, because it could also be always zero here, because this should also be perfect conditional. Started with the typical machine learning tasks. So these benchmarking data sets as post nousing. And but our actually the reason to develop such a method was genetic data. But it turned out, as I've explained that the method is very general. So in general, it makes sense as soon as you have correlated data to use the CPI or in general, the conditional method. And you could ask a researcher and ask, do you have correlations in your data? And I guess it will be hard to find someone who says no. So I would say it's a very, the field of application is very, very broad. So it's maybe not only model agnostic, but also application agnostic. So you but you have to find a knockoff sampler that works with your data. And that's not always easy. So for example, the one for the genome white data, we were lucky that it was already there. So we didn't have to develop it ourselves. But yeah, knock them new knockoffs, new knockoff method or knockoff samples proposed on the time. So it seems to be very reactive, active research topic. So that will then also broaden the scope of the CPI because they completely realize on the knockoffs. It's not working yet for categorical or mixed data, except some special cases like binary variables or on genetic data, it's working with this one specific type of knockoff sampler. But in general, that's a major challenge to solve. It's useful if you have non-linear or high dimensional data. So images, a speech or text and always machine learning is a big plus. But also just for if you have big data sets. And if you if we go back to my genetic example, so what you usually do is the univariate regression model. So you take each genetic variant, calculate the regression model on the outcome, and maybe adjust for some confounders to get an effect estimate. But that completely misses any relations between the genetic variants. That's why we want to use a multivariate method. But to use a multivariate regression won't work because then you have this multi-cognitive issues that you have more variables than observations and the whole modeling the model does not fit. So it's not working. And that's then where machine learning might come into play. But then you have your multivariate model. So you apply your random forest to your genome white data. But then in the end, it's not actually multivariate again, if you have not a conditional importance measure. If you look if you want to look at the importance of the genetic variants, and then and yeah, and that it's one case which can be solved with the the CPI method. The typical examples are as I've explained always on prediction. So and I think these are big implications of machine learning. So for example, you want to do risk prediction, or you want to do personalized medicine and give treatment which is personalized to a specific person. And I think machine learning is very useful for these. But there are also many smaller things which are maybe not so well known or just very specific. So for an example, maybe going back to the genetic example, genetic epidemiology, you use machine learning for risk prediction. So you might have some sequence data or some gene expression data and you want to predict someone's risk for a disease. And you might also want to use interpretability methods as I described to find genetic variants which are associated with the disease. So this is all I think well known and one of the well known applications of machine learning and epidemiology. But they also if you look at in the sequence data, if you look at the bioinformatics tool chain used to pre-process the data, there are so many very, very small steps where also machine learning comes into play. And that's often overlooked. So you often just look at these major prediction applications. But also there's obviously a hype on machine learning. And I think machine learning cannot solve all the problems sometimes start off. So if our goal in the end is to understand the disease or to understand risk factors, we still need statistics and we also still need epidemiology. So machine learning is a tool that can help us but it's not like the AI which solves all the problems for us.
I'll give you an example in R. So if you think interested in understanding diseases. And that's agnostic interpretable machine learning. So model the method cannot handle cannot adjust for the confounding by the confounder z. The reason is just used in the random forest. I briefly kind of loss function. So how well does the model original variables and the variables in the and so on. We now focus on the second order learning. I also want to show some simulation that. And I'll show you some R code for that. So conclude, so our conditional predictive impact is the model-agnostic method. So you can plug in any machine learning method you want to. It can be as conditional. So you can adjust for confounders paper and also not published yet, is the is to handle categorical data. So this genetic I think, for the application, a very, very matter of combining the results from several confirm, Marvin, so that you made the package correlated data to use the CPI or in general, the a knockoff sampler that works with your data. And look if you want to look at the importance of the as I described to find genetic variants which are applications of machine learning and