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

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ต.ค. 2024

ความคิดเห็น • 100

  • @xin2668
    @xin2668 ปีที่แล้ว +26

    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

      Glad it was helpful!

  • @jotsaroopsingh3154
    @jotsaroopsingh3154 หลายเดือนก่อน +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🤗

  • @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 :)

  • @johnturner8347
    @johnturner8347 ปีที่แล้ว +1

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

  • @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.

    • @misraturp
      @misraturp  ปีที่แล้ว +1

      You're very welcome!

  • @m.riddle824
    @m.riddle824 6 หลายเดือนก่อน +1

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

  • @horst1991
    @horst1991 ปีที่แล้ว +1

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

  • @bl4z3_kanazaki
    @bl4z3_kanazaki ปีที่แล้ว +1

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

    • @misraturp
      @misraturp  ปีที่แล้ว

      You're very welcome :)

  • @adnanemehdaoui5487
    @adnanemehdaoui5487 ปีที่แล้ว +5

    thanks and Ramadan mubarek for all mosslims people

    • @misraturp
      @misraturp  ปีที่แล้ว +2

      You're welcome and Ramadan Mubarek. :)

  • @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. ^^

  • @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

  • @babatundeayinla3273
    @babatundeayinla3273 2 ปีที่แล้ว

    Delivered in a friendly manner. Love it.

    • @misraturp
      @misraturp  ปีที่แล้ว

      Thank you kindly!

  • @dev77cmd
    @dev77cmd ปีที่แล้ว

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

    • @misraturp
      @misraturp  ปีที่แล้ว

      Glad it helped!

  • @franciscoortega104
    @franciscoortega104 หลายเดือนก่อน

    thanks Misra!! great video

  • @ahmtmhmtbyglu
    @ahmtmhmtbyglu 27 วันที่ผ่านมา

    Tebrikler Mısra Hanım

  • @tarblood
    @tarblood 2 ปีที่แล้ว

    Thanks Misra , you are expalining purely.

    • @misraturp
      @misraturp  2 ปีที่แล้ว +1

      You're very welcome!

  • @EB-ch1ih
    @EB-ch1ih 2 ปีที่แล้ว +1

    By far the best explanation, thank you so much!

  • @AlonAvramson
    @AlonAvramson 3 ปีที่แล้ว +1

    Thank you Misra! great example

    • @misraturp
      @misraturp  3 ปีที่แล้ว

      My pleasure!

  • @ATothFTW18
    @ATothFTW18 5 หลายเดือนก่อน

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

  • @ocraking
    @ocraking 6 หลายเดือนก่อน

    what an amazing video, thank you!!

  • @saymuslims
    @saymuslims 4 หลายเดือนก่อน

    Well explaination

  • @MisbahAli-cq6jv
    @MisbahAli-cq6jv ปีที่แล้ว

    best guide for beginners, keep it up

    • @misraturp
      @misraturp  ปีที่แล้ว

      Thanks, will do!

  • @0730pleomax
    @0730pleomax 3 ปีที่แล้ว

    Simple and clear!

  • @GregThatcher
    @GregThatcher 6 หลายเดือนก่อน

    Thanks!

    • @misraturp
      @misraturp  6 หลายเดือนก่อน

      Thank you!

  • @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

  • @thebropill4242
    @thebropill4242 ปีที่แล้ว +3

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

  • @StephenNewmanUK
    @StephenNewmanUK 2 ปีที่แล้ว

    Awesome video, thank you Misra

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      You're very welcome Stephen!

  • @andrewsemenenko8826
    @andrewsemenenko8826 2 ปีที่แล้ว

    Really great explanation, thank you!

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      You're very welcome :)

  • @mandadirohitreddy8086
    @mandadirohitreddy8086 ปีที่แล้ว

    Very good explanation mam I like it

    • @misraturp
      @misraturp  ปีที่แล้ว

      Great to hear!

  • @keshavgokhaledivine
    @keshavgokhaledivine 2 ปีที่แล้ว

    Thanks for the video.

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      You're very welcome :)

  • @souhamahmoudi7745
    @souhamahmoudi7745 ปีที่แล้ว

    Its really appreciated

  • @eliananavarro3434
    @eliananavarro3434 ปีที่แล้ว

    Excellent

  • @jmdiassibonatama4355
    @jmdiassibonatama4355 ปีที่แล้ว

    Worderfull. Thanks

    • @misraturp
      @misraturp  ปีที่แล้ว

      You're very welcome!

  • @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?

  • @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

  • @GunishaDutt
    @GunishaDutt 2 ปีที่แล้ว

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

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      Thank you :)

  • @AHDD142
    @AHDD142 ปีที่แล้ว

    Great love ya!

  • @faelo_devia
    @faelo_devia 2 ปีที่แล้ว

    I love you!

  • @isitpokharel491
    @isitpokharel491 10 หลายเดือนก่อน +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!

  • @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!

  • @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!

  • @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.

  • @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 2 ปีที่แล้ว

    Awesome video, where can I find the jupyter notebook?

    • @misraturp
      @misraturp  2 ปีที่แล้ว

      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

  • @ajaykushwaha-je6mw
    @ajaykushwaha-je6mw 2 ปีที่แล้ว

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

  • @chachii1143
    @chachii1143 ปีที่แล้ว

    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?

  • @nurkholis5489
    @nurkholis5489 2 ปีที่แล้ว

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

  • @baneous18
    @baneous18 ปีที่แล้ว

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

    • @misraturp
      @misraturp  ปีที่แล้ว

      Maybe your model is overfitting?

  • @mohammedtaherhabeeb3049
    @mohammedtaherhabeeb3049 ปีที่แล้ว

    how to implement it online

    • @beloaded3736
      @beloaded3736 ปีที่แล้ว

      what do you mean by online friend?

  • @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

    •  ปีที่แล้ว

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

    • @NeuralMars
      @NeuralMars ปีที่แล้ว +3

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

  • @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

  • @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!

  • @Gester2000
    @Gester2000 2 ปีที่แล้ว +2

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

  • @abhisheksinghyadav4970
    @abhisheksinghyadav4970 ปีที่แล้ว

    please explain eda first

  • @misraturp
    @misraturp  3 ปีที่แล้ว +3

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