Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Training Systems using Python Statistical Modeling

You're reading from  Training Systems using Python Statistical Modeling

Product type Book
Published in May 2019
Publisher Packt
ISBN-13 9781838823733
Pages 290 pages
Edition 1st Edition
Languages
Author (1):
Curtis Miller Curtis Miller
Profile icon Curtis Miller
Toc

Random forests

In this section, we will extend decision trees to random forests, which are an example of an approach to machine learning called ensemble learning. We also see how we can train these models when applying them to the Titanic dataset.

In ensemble learning, we train multiple classifiers for our dataset. For random forests, we train decision trees on random subsets of the dataset. The classifier is fed a data point that we want to predict the class for. The data point is fed to each classifier that's trained on the dataset. Each classifier then makes a prediction. The predictions are then aggregated in some way to form a final prediction. This diagram shows the steps to do this:

For random forests, the class that was predicted the most often is the final prediction. Let's get right into the action by following these steps:

  1. First, let's load in the Titanic...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime