Explainable AI explained! | #3 LIME

  Рет қаралды 54,322

DeepFindr

DeepFindr

Күн бұрын

▬▬ Resources ▬▬▬▬▬▬▬▬▬▬▬
Code: github.com/deepfindr/xai-series
Book: christophm.github.io/interpre...
▬▬ Timestamps ▬▬▬▬▬▬▬▬▬▬▬
00:00 Introduction
02:31 Paper explanation
03:34 The math / formula
08:35 LIME in practice
▬▬ Support me if you like 🌟
►Link to this channel: bit.ly/3zEqL1W
►Support me on Patreon: bit.ly/2Wed242
►Buy me a coffee on Ko-Fi: bit.ly/3kJYEdl

Пікірлер: 84
@sakshamgulati1578
@sakshamgulati1578 3 жыл бұрын
One of the best and wholesome explanations on this topic! Kudos!
@yangbai657
@yangbai657 Жыл бұрын
The objective function part is amazingly well explained.
@arturocdb
@arturocdb 9 ай бұрын
i just want it to ongratulate you!... you are the only one in you tube that can have a solid background (books and papers) about what is teaching in a video. thaank you so much... your video help me a lot!...,
@briggstwitchell1654
@briggstwitchell1654 3 ай бұрын
Wow, very clear and concise explanation of a fairly complex technique. Thank you very much for the effort you put in to this. Very helpful!
@techjack6307
@techjack6307 2 жыл бұрын
Concise and great explanation on the topic.
@dvabhinav31
@dvabhinav31 2 ай бұрын
Wow! Such a cool explanation. I had some intuition issues after reading the paper that are now solved due to this video. Thanks a lot!
@user-hl5sk1oj1m
@user-hl5sk1oj1m 2 жыл бұрын
great work! I am a lucky person cuz I found this channel, as My major interests are GNN and XAI. thank you so much for brilliant works.
@DeepFindr
@DeepFindr 2 жыл бұрын
Perfect :)
@abhirama
@abhirama Жыл бұрын
Amazingly clear explanation.
@hqi7573
@hqi7573 3 жыл бұрын
Really cool video. Love the format that mix theory and coding. Just one point for disscussion: We need to measure Recall even for a binary classifier or for balanced data. It measrus a classifier's ability to find out all positive examples. And precison measures how well are the positive predictions. So they measure two different type of errors. In statistics we talk about Error of type one or type two
@DeepFindr
@DeepFindr 3 жыл бұрын
Thanks! Yes you are right. Ideally it makes sense to look at all the metrics that are commonly used :) ROC, accuracy, precision, recall,...
@nintishia
@nintishia 3 жыл бұрын
Excellent explanation of LIME.
@youssefbenhachem993
@youssefbenhachem993 Жыл бұрын
It is just clearly explained ! Thanks a lot
@joaquinecc
@joaquinecc 2 ай бұрын
Amazing Explanation!!!. Thank u
@akshaybareja4697
@akshaybareja4697 2 жыл бұрын
Beautifully explained
@LittleBigAmbition
@LittleBigAmbition 2 жыл бұрын
Hi, amazing explanation. I'm wondering if you could elaborate how the size of proximity is decided upon? How we do know how "large" the neighborhood is for the newly fit linear model? Realistically, we could just choose a few close points and fit a linear model there, but that might not be the best fit? I hope my question makes sense.
@ayaeldeeb19
@ayaeldeeb19 5 ай бұрын
Really amazing!! It's very exciting and cool to conduct such research; it is also very explainable."
@SuperMaker.M
@SuperMaker.M 29 күн бұрын
Finally a channel with good content!
@Anirudh-cf3oc
@Anirudh-cf3oc Жыл бұрын
Thank you for the amazing explaination
@ODFG
@ODFG 3 жыл бұрын
Thanks for your video!! I'm doing my graduate master's degree to become a data scientist dealing with XAI. I gain many information.
@DeepFindr
@DeepFindr 3 жыл бұрын
Nice! Good luck on your journey :)
@shalombentenzingnamchyo9384
@shalombentenzingnamchyo9384 Жыл бұрын
wow 💯 Great explanation
@bryanparis7779
@bryanparis7779 Жыл бұрын
Does LIME uses Permutation or Perturbation (tweaking feature values) of the input of interest (x) we would like to explain?
@heejuneAhn
@heejuneAhn 7 ай бұрын
When the feature is not continuous, how do we sample the neighborhood? For example, binary features, Just a combination of features? or consider the binary features to be continuous ones?
@moawiaserdar4143
@moawiaserdar4143 2 жыл бұрын
Thank you for the amazing explanation! Have you by any chance encountered researches regarding XAI in industrial applications, such as threaded fastening?
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi! I think there is a lot of potential for XAI in the industry. Some years ago I also did a project on material sciences. A company produced products to damp vibration and squealing. Basically they wanted to know which material combinations lead to a certain behavior and why. But I have no publication for that, because of two reasons: - I used counterfactual explanations and had my own implementation but didn't really contribute to / extend current research - Most companies want to keep such advances secret to have a competitive advantage And I think these are the reasons why there is generally not too much available in that direction. There are some meta papers, like this one arxiv.org/abs/2106.07758 but it's difficult to find very specific applications. Best regards
@menensa
@menensa 3 жыл бұрын
Fantastic !!!
@durgadeviarulrajan4560
@durgadeviarulrajan4560 2 жыл бұрын
Hi thanks for this wonderful video. I have a question, the perturbed dataset created by LIME is like fake datasets right. How do that data points have predictions or target variables?? Whether it means, the black box model is trained again on these perturbed datapoints to get the predictions??
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi! The target variables of this fake dataset come from the "complex" black box model. This means we simply put these points into the Blackbox and use the predictions as labels. Then we fit a new simple model with this new dataset :)
@ramalaccX
@ramalaccX 2 жыл бұрын
Damn bro, this helped me a lot with my final thesis
@DeepFindr
@DeepFindr 2 жыл бұрын
That's great :) good luck with it!
@hasnainmamdani4534
@hasnainmamdani4534 2 жыл бұрын
Great explanation! Thanks! Quick question: I was wondering what is the reason behind providing LIME with training dataset (line 29), what does it do with it? I understood that testing dataset (line 32/33) is used to do perturbations and create a simpler model? Thanks!
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi! This is used to calculate feature statistics when the parameter discretizice_continuous is passed. Otherwise it's simply ignored.. You can have a look here to see how it is used in detail: github.com/marcotcr/lime/blob/master/lime/lime_tabular.py
@kalpaashhar6522
@kalpaashhar6522 3 жыл бұрын
Hey thanks for the clean explanation! I wanted to know if you have tried LIME with multiple class classification problem, aside from the binary classification already in the video? Thanks
@DeepFindr
@DeepFindr 3 жыл бұрын
Hi! I haven't tried it before, but maybe this website is useful for you: coderzcolumn.com/tutorials/machine-learning/how-to-use-lime-to-understand-sklearn-models-predictions#lime_tabular_ex3 They have an example for a multiclass classification case :) Thanks!
@kalpaashhar6522
@kalpaashhar6522 3 жыл бұрын
@@DeepFindr thank you!!
@borauyar
@borauyar 2 жыл бұрын
13:20 I believe "edu" has something to do with "atheism" :) Thanks for the explanations!
@DeepFindr
@DeepFindr 2 жыл бұрын
Haha yes might be ;-)
@sanjanasuresh5565
@sanjanasuresh5565 Жыл бұрын
Can Lime be used for unsupervised ML algorithms?
@muhammadlimangambo589
@muhammadlimangambo589 2 жыл бұрын
Thank you for the wonderful step by step explanation, it really goes a long way. However, implementing same explanation procedure on a Conv1D CNN model for binary classification throws an error message that "AttributeError: 'Sequential' object has no attribute 'predict_proba'". Please, any replacement for the "predict_proba' method?
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi, have you tried the recurrent Explainer as suggested here: github.com/marcotcr/lime/issues/426
@muhammadlimangambo589
@muhammadlimangambo589 2 жыл бұрын
No, just seeing it. I'll give it a try. Thank you for the timely response.
@nitinvats3165
@nitinvats3165 2 жыл бұрын
Really great video. I am trying to implement lime for one of our use cases and features contribution is changing on every run for the same input transaction. Is that the expected behavior? Example- For property price prediction- Property age is contributing 25% and while running the explainability again, without modifying anything contribution is changing to 28%. How can we control it?
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi! Thanks :) Mhh because the sampling of new data points includes some randomness, it might be the case that this affects the contribution. It's basically like each time a different dataset is used to calculate the contributions. You could try to set a random seed and always use the same one. You can read more about it here: github.com/marcotcr/lime/issues/119 Best regards :)
@nitinvats3165
@nitinvats3165 2 жыл бұрын
@@DeepFindr Thank you. This helps. I will try to set the random seed.
@heejuneAhn
@heejuneAhn 7 ай бұрын
Why do you use different z and z' for f(z) and g(z')? I cannot get it.
@MoMo-ib9ej
@MoMo-ib9ej Жыл бұрын
Du bist sehr hilfreich! Quick questions from a relatively non tech person: 1) How does this scale for models with millions of params eg could you even use this on an LLM? 2) Am I right in understanding that you need a mini real data set to train locally every time then?
@DeepFindr
@DeepFindr Жыл бұрын
Hehe thanks :) 1) I'm not sure if LIME is the right approach for LLMs. As these models mainly operate on numeric vectors it's difficult to fit a simple interpretable model on these. Also there are no real features as everything is very high-dimensional. One easy approach is to look at the attention weights. This allows you to understand which words the model used and where it "looked at" for some output. I found a nice visualization of that in this blog post: mohitmayank.medium.com/explainable-ai-language-models-b4b75f56bfe2 2) Yes for every prediction a small dataset is sampled to train the surrogate model
@heejuneAhn
@heejuneAhn 7 ай бұрын
LIME can explain how the Complex model behaviors about the interested sample point, but it cannot guarantee the prediction of the complex model around the sample is correct predictions. am I right? Also, we could use LIME to explain the incorrect prediction of the complex model. For example, we could take two samples one correct prediction and one incorrect one, then we could make a simple surrogate model abound the two samples so that we could see how the complex model predicts and what is wrong with the complex model. Am I right again?
@rafsanjany2936
@rafsanjany2936 Жыл бұрын
Hello there, i got a an error like "ufunc 'subtract' did not contain a loop with signature matching types (dtype('
@DeepFindr
@DeepFindr Жыл бұрын
I think something might be wrong with the columns in your dataframe. More specifically I would double check the column types and cast all float64 to float32 using the to_numeric function
@DanielWeikert
@DanielWeikert 3 жыл бұрын
So when we deal with classification. Is the Local Model for lime then a LogisticRegression (Linear Regression would only work for Regression problems right)? X would be the features from the nearest points to the one we want to explain. Would y be the original target (so stroke or no stroke in this case)? Thanks and great video.
@DeepFindr
@DeepFindr 3 жыл бұрын
Hi! Yes for a regression task a logistic regression would be fitted, for instance. X are the features of the input data point we want to explain. Out of those we would generate a neighborhood with similar features X'. y is the original target, yes, but it is not used by the algorithm, because at prediction time we don't have that information. In the code I pass y_test to the interpretml library to additionally show the actual labels. Thanks!
@DanielWeikert
@DanielWeikert 3 жыл бұрын
@@DeepFindr So we would not use samples from the training set which are close as neighbors but instead create artifical new ones? In order to get the Betas and therefore the importance how do we fit the Logistic Regression? My first understanding was using close training samples, fit the Log Reg on those and the training y's and then derive the beta/importance only from those. BR
@DeepFindr
@DeepFindr 3 жыл бұрын
@@DanielWeikert Hi, I guess my wording was a bit irritating here. Yes the training samples are used and weighted according to their proximity. However we do not take their (ground truth) labels y. Our labels come from the Blackbox model (the predictions on these data points), because we want to approximate it. But that also means we are not limited to the training data, we could also generate new data points by small perturpations / sampling from distributions, pipe them through the Blackbox and fit a simple model based on these labels. Hope that makes sense :)
@DanielWeikert
@DanielWeikert 3 жыл бұрын
@@DeepFindr Thanks a lot for your reply. Highly appreciated. What I still don't understand is how the blackbox model is fitted. So are the y values the original predictions on these training samples instead of the ground truth y_train?
@DeepFindr
@DeepFindr 3 жыл бұрын
@@DanielWeikert sure no problem :) The Blackbox model is fitted on X_train with the labels y_train. Now we have a specific data input to our blackbox model - for which the prediction is for example 0. In order to explain this prediction we want to build a simple model in the neighborhood of that point based on the decision boundary of the Blackbox. The simple model is fitted on sampled similar data points (for example coming from the train data X_train), let's call them Z_train. The labels for these samples come from the Blackbox model f, so we get y_train_simple = f(Z_train). The Blackbox model is only fitted once at an early point In time. For the explanations of the predictions we fit each time a new simple model Best
@randalllionelkharkrang4047
@randalllionelkharkrang4047 2 жыл бұрын
Thanks for this. Its funny that "ever_married" feature is inversely proportional to getting a stroke :)
@DeepFindr
@DeepFindr 2 жыл бұрын
:D true!
@sheetalrajpal4436
@sheetalrajpal4436 2 жыл бұрын
Concepts explained "PERFECTLY" !! Do we have slides of these videos?
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi :) thanks! I haven't uploaded them but you can send a mail to deepfindr@gmail.com and I will attach them :)
@sheetalrajpal4436
@sheetalrajpal4436 2 жыл бұрын
@@DeepFindr Thank you so much!
@bigbangize
@bigbangize 2 жыл бұрын
Hi! Can LIME be used for Unsupervised approaches?
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi! I think it's possible. For approximating the model you need to have labels to compare against. If you are able to construct these labels for an unsupervised approach it works. Such a thing could be the probability of being assigned to a cluster. With that information I think lime can be used. For SHAP you can use Isolation Forest as unsupervised model being explained by the Tree Explainer.
@fahimhasan4905
@fahimhasan4905 2 жыл бұрын
Can we use Lime for RNN? Or we need to work on Shap?
@DeepFindr
@DeepFindr 2 жыл бұрын
As it is model agnostic it should in principle work with any machine learning model, so also RNN :) However I have never tried to use it and also I think it is difficult to work with a sequence of data inputs. Here is an example for a LSTM: towardsdatascience.com/interpreting-an-lstm-through-lime-e294e6ed3a03
@mikehawk6690
@mikehawk6690 2 жыл бұрын
nice video
@maegancalvert59
@maegancalvert59 2 жыл бұрын
Wonderful explanation!!! Thank you!!!
@andreashorlbeck8749
@andreashorlbeck8749 Жыл бұрын
perfect!
@Lukaas_95
@Lukaas_95 2 жыл бұрын
Thank you very much for this excellent explanation. One short question: What is the difference between z and z'?
@DeepFindr
@DeepFindr 2 жыл бұрын
Thank you! z' is a perturbed sample and z is the original representation. Thanks for pointing this out, I somehow missed it when creating this video. Z is then the full sample (passed to the Blackbox) and z' contains only a fraction of the non-zero elements and goes to the surrogate model. The idea is to get simpler data points that make it easier to explain predictions.
@Lukaas_95
@Lukaas_95 2 жыл бұрын
@@DeepFindr Thank you for your very fast answer! So: Instance to be explained --> x Random perturbations based on x --> Z A sample of the random perturbations Z --> z' Am I right?...
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi, yes more or less. For the last relation I would maybe call it "simplified version" of z. So x is the original data point, x' it's simplified version. Therefore z is a perturbed sample and z' it's simplified version. For images for example they use superpixels as interpretable (simplified) version. For text data they use a (sampled) bag of words representation. But to get these simplified versions they sample again, as you said :)
@Lukaas_95
@Lukaas_95 2 жыл бұрын
@@DeepFindr Thank you! :-)
@parteekbhatia
@parteekbhatia 2 жыл бұрын
Hi, DeepFindr First of all sorry for hurting your sentiments as a developer. Actually, i have created the video for sharing among the closed group as part of a series of video sessions, and in these sessions, I properly cited your work and mention the source, But mistakenly I set the visibility of this video as public without noticing that it is not referencing any source. I feel sorry for this mistake. I have removed the video for the public, However, I have added the references and sources. And moreover, i will edit it and will include it in the video itself. I am a great fan of you and love the way you have explained XAI and in no way want to hurt my Guru. I again feel sorry for my unintended action and thanks for pointing and correcting me. Keep doing good work. Wish you all the best,
@DeepFindr
@DeepFindr 2 жыл бұрын
Hey! No worries, it's all fine :) At first I was a bit surprised, but then I thought it's not really a problem, as your goal is to share knowledge and that's what it's all about. You can keep everything public as you wish. Thanks for your kind words! Wish you all the best as well!
@heejuneAhn
@heejuneAhn 7 ай бұрын
I think in the last example, you cannot say the model is wrong or not. LIME just explain how it behaves near the sample. If you can explain so easily why do you use complex model. You only can say using the ground truth. Some features that you might think is not logical still might affect that specific local points.
@rajeshkalakoti2434
@rajeshkalakoti2434 2 жыл бұрын
could you please explain what is exactly perturbation ?
@DeepFindr
@DeepFindr 2 жыл бұрын
Hi! Perturbation means adding noise. For example if age = 40 some perturbed instances can be age = 38 or arge = 41. Does this help? :P
Explainable AI explained! | #4 SHAP
15:50
DeepFindr
Рет қаралды 74 М.
КАХА и Джин 2
00:36
К-Media
Рет қаралды 4,1 МЛН
Do you have a friend like this? 🤣#shorts
00:12
dednahype
Рет қаралды 50 МЛН
I Need Your Help..
00:33
Stokes Twins
Рет қаралды 146 МЛН
Understanding LIME | Explainable AI
14:14
aleixnieto
Рет қаралды 18 М.
Shapley Additive Explanations (SHAP)
11:52
KIE
Рет қаралды 59 М.
The mathematics behind Shapley Values
11:48
A Data Odyssey
Рет қаралды 19 М.
Explainable AI Cheat Sheet - Five Key Categories
14:09
Jay Alammar
Рет қаралды 41 М.
Which Phone Unlock Code Will You Choose? 🤔️
0:14
Game9bit
Рет қаралды 13 МЛН
iPhone 12 socket cleaning #fixit
0:30
Tamar DB (mt)
Рет қаралды 13 МЛН
Теперь это его телефон
0:21
Хорошие Новости
Рет қаралды 1,8 МЛН