Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
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 Explore popular techniques for modeling your data in Python

Arrow left icon
Product type Paperback
Published in May 2019
Publisher Packt
ISBN-13 9781838823733
Length 290 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Curtis Miller Curtis Miller
Author Profile Icon Curtis Miller
Curtis Miller
Arrow right icon
View More author details
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 $19.99/month. Cancel anytime
Banner background image