Interpretable Machine Learning with LIME - How LIME works? 10 Min. Tutorial with Python Code

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024
  • This is a step by step tutorial with python code that explains the details behind Interpretable Machine Learning with LIME (Local Interpretable Model-Agnostic Explanations).
    The python code and slides can be found in the blog section of my website:
    arteagac.githu...

Комментарии • 38

  • @RegsaGC
    @RegsaGC 3 года назад +5

    This is such a good video. Actually illustrates the theory behind it. No use of libraries to do all the important work, yet it is still so short and easy to understand.

  • @GarveRagnara
    @GarveRagnara 4 года назад +7

    Best explanation of Lime on the internet!

  • @VALedu11
    @VALedu11 4 года назад +2

    This is the exact explanation that I needed. Thank you very much for this. Your video has cleared much of my understanding of LIME

  • @saqibcs
    @saqibcs 2 года назад

    Wow... Splendid .. love from 🇨🇦🇮🇳

  • @akashkewar
    @akashkewar 3 года назад

    Amazing work, especially the coding part. Keep it up Cristian.

  • @AA-tm3ew
    @AA-tm3ew 3 года назад

    Best explanation of lime...thank you

  • @raghvendrasingh116
    @raghvendrasingh116 4 года назад +1

    This is amazing! this video solved a lot of doubts i had :)

  • @DouglasLuan
    @DouglasLuan 4 года назад

    Excellent, Cristian. Muchas gracias and I wish you great success!

  • @naveen3046
    @naveen3046 4 года назад

    Very very informative excellent explanation

  • @reeshabhkumarranjan1474
    @reeshabhkumarranjan1474 3 года назад

    Thank you for explaining it so amazingly! Subscribed!

  • @OmerBoehm
    @OmerBoehm 4 года назад

    Many thanks for the explanations and the code walk through , it helped a lot !

  • @hamzalebbar9105
    @hamzalebbar9105 3 года назад

    Thank you for this clear explanation. Perfecto

  • @martinlearning1121
    @martinlearning1121 3 года назад

    quite well explained! congrats

  • @GChief117
    @GChief117 3 года назад

    Dude, you just got a subscriber😎

  • @neverlandisfar9194
    @neverlandisfar9194 3 года назад

    Thank You! This is really helpful!

  • @francescfolch6513
    @francescfolch6513 Год назад

    Muy buen video. La explicacion de los coeficientes es lo que podria ampliarse, dibujando el vector (-1.37, -0.6) centrado en el punto en cuestión, que debe ser perpendicular a la tangente a la frontera en dicho punto

  • @upa240
    @upa240 2 года назад

    Can you please explain why you choose y_linmodel = y_linmodel < 0.5 instead of the other way?
    I thought predictions greater than 0.5 should be assigned to class 1.

  • @fawadmahdi
    @fawadmahdi 4 года назад

    very good video and explanation

  • @장재은-b6i
    @장재은-b6i 4 года назад +2

    Thanks for useful lecture!
    However, what should I do if the dataset has categorical feature?

    • @cristianarteaga
      @cristianarteaga  4 года назад

      Hello! Thanks for your comment. With categorical features it is even easier. To create perturbations you simply create a random vector of zeroes and ones instead of sampling from the mean and std. dev. of your features. Let's say you have a binary categorical feature called "gender" (1: female, 0: male). The LIME random perturbation for the feature "gender" will use 0 to represent that you perturb your feature (flip it to the opposite value) and 1 represents you don't perturb it. You can clearly see this concept on another tutorial where I apply to LIME explanations of image classifications (ruclips.net/video/ENa-w65P1xM/видео.html). You can assume that each superpixel in the image is a binary categorical feature that is turned on and off with random perturbations and then it is evaluated how the presence of absence of these features affect the predictions. This exact concept of turning on and off categorical features applies to your question.

    • @장재은-b6i
      @장재은-b6i 4 года назад

      Cristian Arteaga thank you very much.
      your explanation is so useful.
      I have one more question.
      If i discretize continuous feature, the process is same with categrical feature?

    • @cristianarteaga
      @cristianarteaga  4 года назад

      That is correct! When you discretize a continuous feature you generate LIME perturbations using the same process used for categorical features. A discretized feature is just a feature converted to categorical using percentiles.

  • @장영달-v2y
    @장영달-v2y 3 года назад

    wonderful video!

  • @ovegedion1790
    @ovegedion1790 3 года назад

    great video! thanks!

  • @jorjiang1
    @jorjiang1 4 года назад +1

    hi, really great explanation with the code, i have two question:
    1. i suspect lime probably would not work well with predictions with high confidence (far away from decision boundary), is the correct??? i have tried in your notebook, instead of the blue dot near the decision boundary i have change it to the middle of the positive blob, and the linear model predicted everything on the map to be positive and the coefficient are both negligible, as if it's telling me: "nothing needs to be explained, everything in the world is a positive class".
    2. would it make more sense in that case (nothing could be explained locally) we slowly increase the kernel size and get a relative more globe explanation, as long as the data in the kernel range is relative leaner separable, which we can informed by the performance of linear model

    • @cristianarteaga
      @cristianarteaga  4 года назад

      Hello. Thanks for your comment. Sorry for the late reply. 1) Your interpretation for areas far from the decision boundary makes sense. In fact, due to issues like the one you mention, LIME may not perform well for certain continuous features. For that reason, the python library LIME uses discretization by default for continuous variables (see github.com/marcotcr/lime/issues/68). 2) I am not sure whether it is a good idea to increase the kernel size to a point where a more "global" explanation is obtained. I think sticking to a "local" scope is better because the linear surrogate model you are estimating may not behave very well when you move very far from the surrounding area of the point you want to explain.

  • @melalastro
    @melalastro 4 года назад

    Pruebo uno por uno? Las nuevas predicciones? O con ver una vez ya está?

    • @cristianarteaga
      @cristianarteaga  4 года назад

      Hola @melalastro. No estoy seguro si entiendo bien tu pregunta pero si te refieres al nuevo dataset de perturbaciones que se genera, entonces si necesitas predecir la clase para cada una de las perturbaciones. Recuerda que la idea general detras de LIME es ver como se comportan las predicciones de tu modelo de machine learning en el vecindario de la instancia que quieres explicar. Por tanto, el vecindario que creas con perturbaciones requiere evaluar la predicion de cada perturbacion. Si tienes dudas adicionales puedes comunicarte por este medio.

    • @melalastro
      @melalastro 4 года назад

      @@cristianarteaga gracias por contestar, me refiero a la localidad, si tengo 200 registros para entrenar, miro algunos para darle interpretabikidad al modelo, o solo lo uso para cada nueva predicción?

    • @cristianarteaga
      @cristianarteaga  4 года назад +1

      Entiendo tu pregunta. Dado que LIME es un methodo para explicaciones locales (un registro al tiempo), para poder darle una interpretacion global al modelo (usando todos tus registros) tienes que recurrir a estrategias adicionales. Por ejemplo :
      1. Una estrategia es usar Submodular-Pick LIME (SP-LIME) que es mencionada en el paper original de LIME (section 4). SP-LIME busca seleccionar una muestra representativa de tus registros para asi observar un comportamiento general del modelo.
      2.Otra estrategia es agregar las explicaciones individuales para producir una explicacion global como se sugiere en este paper: arxiv.org/pdf/1907.03039.pdf

    • @melalastro
      @melalastro 4 года назад +1

      @@cristianarteaga muchas gracias!!!

    • @melalastro
      @melalastro 4 года назад

      @@cristianarteaga muy bueno todo! mil gracias

  • @arkmishra7070
    @arkmishra7070 3 года назад

    Can you please share the git link of the code

    • @cristianarteaga
      @cristianarteaga  3 года назад

      Sure! github.com/arteagac/arteagac.github.io/blob/master/blog/lime.ipynb

  • @JuneRacoon
    @JuneRacoon 3 года назад

    The talking is just super fast, i agree that it's one of the best explanations of the topic out here but slowing down while speaking would really help. I had to listen multiple times to all sentences to finally get it.

    • @cristianarteaga
      @cristianarteaga  3 года назад +1

      Thank you for the feedback. I will have it in mind for future videos. :)

    • @datakristen8500
      @datakristen8500 2 года назад +1

      You can also adjust the speed of the playback.

    • @JuneRacoon
      @JuneRacoon 2 года назад

      @@datakristen8500 that's true and how I did it but then some words are stretched out and the speech doesn't feel natural and it can be hard to listen to it.