How to Implement Decision Trees in Python (Train, Test, Evaluate, Explain)

Поділитися
Вставка
  • Опубліковано 2 лют 2025

КОМЕНТАРІ • 104

  • @xin2668
    @xin2668 2 роки тому +30

    Can't believe this is free! it is much well explained comparing to what my lectures and tutor's did! Definitely recommended and Subscribed! Thank you so much!

    • @misraturp
      @misraturp  2 роки тому +2

      Glad it was helpful!

  • @johnturner8347
    @johnturner8347 Рік тому +2

    Walked away from my course learning material not understanding this and gained so much more from this video. Thanks!

  • @dk1685
    @dk1685 2 роки тому +10

    Hi. I am studying this at the moment and your explanation is superb. You include what is relevant and what is useful without unnecessary deviation into obscurities or irrelevancies. Your explanation is perfect, Misra. Thankyou.

    • @misraturp
      @misraturp  2 роки тому +1

      You're very welcome :)

  • @jotsaroopsingh3154
    @jotsaroopsingh3154 5 місяців тому +1

    you literally saved me , i have a project on cerrvical cancer prediction ML model and couldn't understand how to implement in code and how things come to be , you answered all the whys . Thank u soo much for this helpful video🤗

  • @Moiez101
    @Moiez101 Рік тому +5

    Misra, thank you for this great "code-along". It really helped get a hands-on experience for the concepts that I'm learning.

  • @horst1991
    @horst1991 Рік тому +1

    thank you Misra, you help me with my master thesis :)

  • @rajamoorthy1969
    @rajamoorthy1969 Рік тому

    Amazing explanation Misra. That unique smile on your face adds to the way you explain the complex things. I have subscribed to your channel. Thanks

  • @m.riddle824
    @m.riddle824 10 місяців тому +1

    Thank you so much!! Straight forward and easy to understand :)

  • @bl4z3_kanazaki
    @bl4z3_kanazaki 2 роки тому +1

    thank you so muchhh Mrs!!! I found this video for hours...

    • @misraturp
      @misraturp  2 роки тому

      You're very welcome :)

  • @ZzZzZiggy
    @ZzZzZiggy 2 роки тому +1

    Wonderfully explained! Quite new to the data science and ML world and it's all so very exciting!

    • @misraturp
      @misraturp  2 роки тому +1

      Welcome to the AI world!

    • @ZzZzZiggy
      @ZzZzZiggy 2 роки тому

      @@misraturp Thank you! It's, uh... it's also a bit overwhelming. ^^

  • @GregThatcher
    @GregThatcher 10 місяців тому

    Thanks!

  • @Blu3Mj0ln1r
    @Blu3Mj0ln1r Рік тому

    A huge thank you for your effort! I understood it easily and was able to do my assignment!!!

  • @misraturp
    @misraturp  3 роки тому +3

    👉 Get real world data science experience by doing hands-on work
    www.misraturp.com/hods

  • @babatundeayinla3273
    @babatundeayinla3273 2 роки тому

    Delivered in a friendly manner. Love it.

  • @franciscoortega104
    @franciscoortega104 5 місяців тому

    thanks Misra!! great video

  • @adnanemehdaoui5487
    @adnanemehdaoui5487 Рік тому +5

    thanks and Ramadan mubarek for all mosslims people

    • @misraturp
      @misraturp  Рік тому +2

      You're welcome and Ramadan Mubarek. :)

  • @EB-ch1ih
    @EB-ch1ih 2 роки тому +1

    By far the best explanation, thank you so much!

  • @ATothFTW18
    @ATothFTW18 9 місяців тому

    This is really a fantastic explanation. Such a great teacher! What tests are helpful in determining underfitting or overfitting?

  • @tarblood
    @tarblood 2 роки тому

    Thanks Misra , you are expalining purely.

    • @misraturp
      @misraturp  2 роки тому +1

      You're very welcome!

  • @isitpokharel491
    @isitpokharel491 Рік тому +1

    Quick question! 😊 Does the train_test_split function automatically remove the target variable from X_test, or should it be removed manually?
    I followed along with your video and encountered something interesting. When I didn't specify max_depth and ran the model, I got an accuracy score of 100%. I'm a bit confused and wondering whether it's related to the target variable being present in the test set. Any insights or explanations would be greatly appreciated!

  • @ocraking
    @ocraking 10 місяців тому

    what an amazing video, thank you!!

  • @MisbahAli-cq6jv
    @MisbahAli-cq6jv Рік тому

    best guide for beginners, keep it up

  • @ahmtmhmtbyglu
    @ahmtmhmtbyglu 4 місяці тому

    Tebrikler Mısra Hanım

  • @AlonAvramson
    @AlonAvramson 3 роки тому +1

    Thank you Misra! great example

  • @thebropill4242
    @thebropill4242 2 роки тому +3

    How did you fo the code for feature importance i could not see line 21 properly

  • @jakobs4338
    @jakobs4338 2 роки тому +3

    Is this actually a clustering algorithm only? How does the algorithm know what we are looking for as a target prediction, Misra? How is it possible that 'target' is a column of the 'data' but not included in the dataframe which again is based on 'data' from sklearn library?

    • @codewithkiki
      @codewithkiki 2 роки тому

      it seperates data in two sets then compares according to the input set and gives output on the basis we provided the input

  • @ankushfreefire8910
    @ankushfreefire8910 Рік тому

    thank you a lot and ramadan kareem

    • @misraturp
      @misraturp  Рік тому

      You're very welcome and happy Ramadan!

    • @pythonholic
      @pythonholic Рік тому

      @@misraturp aww you're so nice thank you

  • @LV426TravelAdvisor
    @LV426TravelAdvisor 3 роки тому

    Awesome video, thank you Misra

    • @misraturp
      @misraturp  2 роки тому

      You're very welcome Stephen!

  • @jakobs4338
    @jakobs4338 2 роки тому +2

    Dear Misra, how could I conduct a multi-class prediction? Respectively what parameters would need to be changed to do so?

  • @andrewsemenenko8826
    @andrewsemenenko8826 2 роки тому

    Really great explanation, thank you!

    • @misraturp
      @misraturp  2 роки тому

      You're very welcome :)

  • @0730pleomax
    @0730pleomax 3 роки тому

    Simple and clear!

  • @GunishaDutt
    @GunishaDutt 2 роки тому

    Great video! subscribed to your channel. Good luck :)

  • @mandadirohitreddy8086
    @mandadirohitreddy8086 2 роки тому

    Very good explanation mam I like it

  • @saymuslims
    @saymuslims 8 місяців тому

    Well explaination

  • @keshavgokhaledivine
    @keshavgokhaledivine 2 роки тому

    Thanks for the video.

    • @misraturp
      @misraturp  2 роки тому

      You're very welcome :)

  • @Sahilsharma-sk5vr
    @Sahilsharma-sk5vr 2 місяці тому

    thanks Guruji

  • @sonoflight04
    @sonoflight04 3 дні тому

    Thanks .

  • @souhamahmoudi7745
    @souhamahmoudi7745 2 роки тому

    Its really appreciated

  • @jmdiassibonatama4355
    @jmdiassibonatama4355 2 роки тому

    Worderfull. Thanks

  • @SouravPriyamAdhya
    @SouravPriyamAdhya Рік тому

    Hey! Such an informative video. I just want to learn one thing, that is how do I enter a new list (consisting of only the features) and get my output as whether it is malignant or benign? Thanks a lot.

    • @SouravPriyamAdhya
      @SouravPriyamAdhya Рік тому

      Also, it would be nice if you can link the jupyter notebook with this video.

    • @misraturp
      @misraturp  Рік тому

      Here it is: github.com/misraturp/Decision-Tree-Implementation

    • @SouravPriyamAdhya
      @SouravPriyamAdhya Рік тому

      @@misraturp Thanks a lot! All the best for your work!

  • @PapiJack
    @PapiJack 2 роки тому +2

    Hello Misra, thanks for the excellent video. Any way you can make the Jupyter notebook available? Thanks.

    • @misraturp
      @misraturp  2 роки тому +1

      It's been a while since I made this video so I don't have the code anymore unfortunately. :/

    • @PapiJack
      @PapiJack 2 роки тому +1

      @@misraturp No worries. Thanks for replying 😃

    • @misraturp
      @misraturp  2 роки тому

      @@PapiJack Of course!

  • @AHDD142
    @AHDD142 Рік тому

    Great love ya!

  • @eliananavarro3434
    @eliananavarro3434 2 роки тому

    Excellent

  • @alifiaz7792
    @alifiaz7792 3 роки тому

    Thank you for the explanation. The feature importance plot depicts overall how important each feature is in distinguishing the two classes. Can we plot feature importance plot per class, one for malignant class and other for benign that shows feature importance score w.r.t each class, rather than whole?

    • @misraturp
      @misraturp  3 роки тому +1

      Hey Ali, you are very welcome! That should be possible. I don't know off the top of my head how to do that but scikit-learn documentation should have this information.

  • @chachii1143
    @chachii1143 2 роки тому

    Hello, can you please help me. I'm using this decision tree model as a recommender system but my model can only recommend only one output. How can i recommend multiple outputs using only one sample data?

  • @KamiK4ze
    @KamiK4ze 2 роки тому

    Decision trees use supervised learning right? I don't understand at which point we tell the algorithm which is the correct data and which isn't (is the dataset already labelled)? Wouldn't we need to give the data and say this data = cancerous and give the other data and say this data = benign etc

  • @ricardodiaz8964
    @ricardodiaz8964 3 роки тому

    Awesome video, where can I find the jupyter notebook?

    • @misraturp
      @misraturp  3 роки тому

      Hey Ricardo, I'm not hosting the code anywhere, sorry :/ But everything I use in this video can easily be found on the scikit-learn documentationscikit-learn.org/stable/modules/tree.html

  • @maximilianschutte9531
    @maximilianschutte9531 2 роки тому

    is it possible to traverse a decision tree based on user input and give a prediction? thx

  • @laproff8290
    @laproff8290 2 роки тому

    Hello guys, I’m not a student but have a question that I was hoping someone could help me with. Is there a minimum amount of data required per variable your testing when proceeding with this form of machine learning? Any guidance would be much appreciated

  • @faelo_devia
    @faelo_devia 2 роки тому

    I love you!

  • @nurkholis5489
    @nurkholis5489 2 роки тому

    Miss can u show me how to use Information_gain source code in Dtree using sklearn library?? 🙂

  • @baneous18
    @baneous18 2 роки тому

    Why am i getting accuracy score of 1?(i am using my own dataset after feature selection)

    • @misraturp
      @misraturp  2 роки тому

      Maybe your model is overfitting?

  • @ajaykushwaha-je6mw
    @ajaykushwaha-je6mw 2 роки тому

    Video is good but it must have been best with hyperparameter with crossvalidation.

  • @kanthikiran4021
    @kanthikiran4021 2 роки тому

    In feature importances sort values are not appearing

    • @misraturp
      @misraturp  2 роки тому

      Is the sort values function returning an error then?

    • @pwan3971
      @pwan3971 2 роки тому

      @@misraturp actually, we can't see the code of the sort_values function, not sure what are the parameters you provided inside.
      so far though great video, but would appreciate if you can help share .sort_values parameters inside at 18:03 onwards

    •  2 роки тому

      @@misraturp now i am stuck on the rest of the sort-value

    • @NeuralMars
      @NeuralMars 2 роки тому +3

      ​@ in sort_values write this in the code: .sort_values(0, ascending=False) that's all !

  • @suryaaravindh
    @suryaaravindh 2 місяці тому

    Could you provide ML for 5o days?🙂

  • @mohammedtaherhabeeb3049
    @mohammedtaherhabeeb3049 Рік тому

    how to implement it online

    • @beloaded3736
      @beloaded3736 Рік тому

      what do you mean by online friend?

  • @vojhugs5365
    @vojhugs5365 2 роки тому

    can you send to me your jupyter notebook you used?

    • @misraturp
      @misraturp  2 роки тому

      Hey Voj, I do not have the code for this video anymore but you can find all the code on the scikit learn documentation for decision trees. scikit-learn.org/stable/modules/tree.html

  • @Gester2000
    @Gester2000 3 роки тому +2

    Best and clear explanation By the way I have a crush on you🙂🤣😂

  • @muhammad4575
    @muhammad4575 2 роки тому

    can u drop the code

    • @misraturp
      @misraturp  2 роки тому

      This video does not have accompanying code but you can find everything I used on the official scikitlearn Decision Trees documentation!

  • @MZeeshan-i6r
    @MZeeshan-i6r Місяць тому

    Tomorrow is my lab exam and I'm wondering how beautiful u r.

  • @abhisheksinghyadav4970
    @abhisheksinghyadav4970 Рік тому

    please explain eda first