➡️ Machine Learning from Scratch part 20: a random forest (simple explanation at the end) Same 500…
MachineLearningToGo
Visit on TikTok29K followers
43,500 views #machinelearning #randomforest #decisiontree
➡️ Machine Learning from Scratch part 20: a random forest (simple explanation at the end) Same 500 made-up bank customers as part 18 (income and missed payments; no real people). It learns from the first 400 and is tested on the last 100. How it works: Every tree gets its own sample of 400 customers, drawn with replacement, so about a third are left out. A standard random forest tries a random subset of features at each split (scikit-learn: the square root of their count); with our 2 features that is one. If that one cannot split the group any better, the branch ends. We grow 100 trees and every tree votes; more than 50 yes votes means a loan. Result on the 100 new customers: A single tree from our forest gets 78 right on average (65 to 86). The whole forest gets 84, more than both trees from part 18 (82 with two questions, 79 without a limit). At least one tree is wrong on 73 of the new customers, the vote only on 16. Part 18's two trees disagreed on the first new customer; the forest votes 85 to 15 against the loan, and that customer did not pay back. #machinelearning #randomforest #decisiontree #python #coding
Comments
Comments from the original post on TikTok
No comments yet
