60 - How to use Random Forest in Python?

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 มิ.ย. 2024
  • This video explains the implementation of Random Forest in Python using data imported from a csv file. Image segmentation using feature engineering and Random Forest will be covered in the upcoming videos.
    The code from this video is available at: github.com/bnsreenu/python_fo...
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    This is the best random forest tutorial on TH-cam, thank you.

  • @rominamir8057
    @rominamir8057 4 ปีที่แล้ว +7

    great job on explaining, and I loved that you used an actual real dataset!

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

    This is a beautiful explanation, man! Thanks! It's my first exposure to actual implementation of ML, and I honestly couldn't have asked for a better walkthrough. Thanks! :)

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

    The fact you use real datasets likely to be used in real life for this script is amazing - thank you. Keep it up

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

    This was excellent. Most tutorials on these stop somewhere in the middle, and never get to the feature importances, which are the entire point of these models. Not sure why, but thanks for being comprehensive.

  • @davisongudo372
    @davisongudo372 4 ปีที่แล้ว +4

    You are precise and to the point, and cover what a learner needs.

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

      Thank you for your kind feedback.

    • @cdhanunjay5497
      @cdhanunjay5497 4 ปีที่แล้ว

      I am getting accuracy of 1 when i did the same using the iris data set

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

      @@cdhanunjay5497 That is highly accurate :)

  • @aiz_i564
    @aiz_i564 16 วันที่ผ่านมา

    Thank you so much! Very clear explanation and straight to the point! Thanks a ton, Sir!

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

    Thank you for your explanations and detail. This was very helpful in learning a Random Forest with Python.

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

    thank you so much, I couldn't get it from others but you have explained it so good . Because you can explain it to beginners and I highly appreciate it

  • @f.r8120
    @f.r8120 ปีที่แล้ว

    Straight to the point! I got it at first go. Thank you so much for the tutorial.

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

    Easy to understand and detailed ,no bla bla bla and codin with out explanation ! Awsome

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

    Nice Intuition!!! Looking forward for more ML concepts.
    Thanks,

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

    Thankyou very much, great insights based on real problem. Best wishes.

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

    Great video! Very helpful and explained it very well! Thank You

  • @sridharvishwanath7391
    @sridharvishwanath7391 4 ปีที่แล้ว

    Perfect!! Thanks for posting the video!! Very clear explanation. I liked your presentation skills!! Keep it up!

  • @shivd5235
    @shivd5235 4 ปีที่แล้ว

    excellent job! this really helped me to understand random forest and how to apply it.. much appreciated!

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

    Thank you sir , good implementation of code in python

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

    I do not comment usually on youtube videos but this tutorial is exceptional. Great explanation.

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

    you are the best please keep it up ! love your teaching High quality content very well explained please create more!! Respect from GREECE !

  • @Abhishek-ek9gw
    @Abhishek-ek9gw 2 ปีที่แล้ว

    Great sir, Thank you so much for this..❤

  • @PyCode.academe
    @PyCode.academe 3 ปีที่แล้ว +1

    Great explaining, thanks a lot, please keep recording videos about ml!!!

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

      Keep watching my channel, you will discover 100s of ML related videos :)

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

    ¡Thanks Sreeni! Your contents helped me to give that extra mile on my Ph.D. research, kind regards!

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

      Thank you very much for your generous donation. I am glad you found my videos to be useful towards your doctorate. This is exactly the reason why I started my channel - to help students and researchers.

  • @Myers-ft6vm
    @Myers-ft6vm 2 ปีที่แล้ว

    This is great. Thank you much.

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

    wonderfully explained, sir. I have a question. Is there any way that I can print the prediction in terms of probabilities instead of 1 and 2, similar to light GBM or XGBoost?

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

    Hi, very nice video! do you have any video which helps to find optimal threshold/cut-off for continuous variables such as age, time. Thanks!

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

    yes i found it very very very useful...thank you very much

  • @srivathsansanthanam639
    @srivathsansanthanam639 10 หลายเดือนก่อน +1

    I really need you to help me Sreeni.
    How to find feature importances in image classification problem and determine which GABOR was most impactful?
    Thanks a ton for making these videos.
    You shud know that your videos have impacted a lot of ppl including me. Even "I" could code and do ML coz of you.

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

      May be you will find this video useful: th-cam.com/video/_5t8ZtRybT8/w-d-xo.html

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

      Omg. Thanks a lot for your prompt response.
      Btw I tried both Boruta and feature importances. Feature importances is showing me the most important pixels (some 76670th pixel) in the descending order when I expect it to show the filter to which that pixel belonged to.
      I think I am going wrong in some matrix dimension. Would be helpful if u could help me out.
      Really thanks a lot for this .

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

      Wow... Issue sorted after logical thinking.
      Added all the pixel wise importances filter wise
      The filter which has the highest magnitude is most important.

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

    @DigitalSreeni when I run this code with my dataset then it shows: "ValueError: Input contains NaN, infinity or a value too large for dtype('float32')." how can I handle this error do you have any source where I can get the solutions and also why I face this problem. I know you are a busy person but it is appreciable if you help me out with this problem.

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

    Very good explanation

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

      Thanks and welcome

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

      This helped me for my project... thanks

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

    I have a question please, i am working on my raster dataset for prediction like ANN, RF and CNN, i have converted the rasters into numeric and then train and test the data and got very good accuracy. Now i need to convert my test data into raster again as final prediction map but i don't know how to do this, please guide me thanks.

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

      Same issue here. Would like to get some guidance. Thanks.

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

    Hi sir, could u plz tell me how to use random forest algorithm for continuous target variable..

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

    Thanks for ur explanations, I just wondering. What is the impact of Random_state parameter in the algorithm! What is the difference between 20 or any integer and zero or None!!
    Thanks in advance

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

      Random_state fixes the random numbers that gets used in the code so you get repeatable results. Otherwise, you end up with different results each time you run the code. The exact seed doesn't matter, but it needs to be the same to generate same random numbers. In reality, random number generators are not random, they use a seed to generate numbers and if the seed is kept constant you will get same random numbers each time.

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

    20:20: In newer sklearn versions (0.22 +) default n_estimators = 100.

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

    Thank You so much, Sir, for this video. I have one request for you. Can you please make a video using random forest regression and multivariate regression for the raster dataset, considering the Landsat ETM land use data, ASTER DEM (Elevation data), road network data, etc as independent variables and GDP data as the dependent variable for a region or country or city and please show us how the results changes with these two different regression models. Thank You in advance, Sir.

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

      I keep sharing your videos in our research community, particularly those who are working on GIS, hydrology, earth science, atmospheric science domain. It would be a great help for them if you make a video on this problem.

  • @GATE-DA-CSE-RaviKantGupta
    @GATE-DA-CSE-RaviKantGupta ปีที่แล้ว

    Explained well, please consider imbalance case

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

      I’ve recorded videos on working with imbalanced data. Please check them out.

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

    U are the best

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

    i love you more than i love myself

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

    well commented code in github double like

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

    Thanks

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

      Thank you vey much.

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

    Hi I follow your steps and redo a model, yet I got accuracy = 1 and I don't know how to fix it >< May you give me some advices? or I can email if you need the details thanks!

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

    Great. I wish to perform this model using STATA. Can you please provide any links? thanks!

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

      I am sorry, I have no clue what STATA is!!!

  • @aparajuusharani7638
    @aparajuusharani7638 4 ปีที่แล้ว

    How can we visualise the decision trees in the random forest

    • @DigitalSreeni
      @DigitalSreeni  4 ปีที่แล้ว

      You can do that using export_graphviz. Here is good explanation on how to do it..
      towardsdatascience.com/how-to-visualize-a-decision-tree-from-a-random-forest-in-python-using-scikit-learn-38ad2d75f21c

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

    how to tune ccp_alpha value?

  • @MuhammadHassan-lg1ti
    @MuhammadHassan-lg1ti 3 ปีที่แล้ว

    how to use gabor features in random forest?

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

    can you give us the dataset link please !!

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

    SIR WHAT IS ESTIMATOR=10 IN THIS PROGRAM

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

    Can you do video on k fold cross validation

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

      Sure. I will add it to my list. Thanks for the suggestion.

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

    While creating Y, it comes valueError: invalid literal for int() with base 10
    How to solve this error sir?

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

      You seem to be converting strings to integer. Please verify where this is happening and fix it. I recommend looking at data types for all variables to find the culprit.

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

      @@DigitalSreeni yes sir I was trying the same
      In this session you were converting good and bad words, in the same way I tried to convert it into integers using different dataset.
      In my dataset it is divided into 7 kinds ,where as in your dataset it was 2 kinds

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

      What changes should I do sir?
      Is there any other methods?

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

      @@akzzz7706 do you get the solution because I also got struck to this problem which you currently facing.

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

      @@hasanshaikh2014 No bro , I tried another method , it's showing valueError: could not convert string to float

  • @anjanyrisqiati8836
    @anjanyrisqiati8836 4 ปีที่แล้ว

    Can we get your data for learning?

    • @DigitalSreeni
      @DigitalSreeni  4 ปีที่แล้ว

      Yes, of course. You can find it on my github page: github.com/bnsreenu/python_for_microscopists

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

    No need to convert categorical to numeric as all tree-based models can natively handle categorical variables