Skip to Content
Practical Data Analysis Cookbook
book

Practical Data Analysis Cookbook

by Tomasz Drabas
April 2016
Beginner to intermediate content levelBeginner to intermediate
384 pages
8h 36m
English
Packt Publishing
Content preview from Practical Data Analysis Cookbook

Applying the Random Forest model to a regression analysis

Random Forest, similar to decision trees, can also be applied to solving regression problems. We used them previously to classify calls (refer to the Predicting subscribers with random tree forests recipe in Chapter 3, Classification Techniques). Here, we will use Random Forest to predict the output of a power plant.

Getting ready

To execute this, you will need pandas, NumPy, and Scikit. No other prerequisites are required.

How to do it…

The Random Forests are part of the ensemble types of models. This example borrows the code-shell that we presented in Chapter 3, Classification Techniques (the regression_randomForest.py file):

import sys sys.path.append('..') # the rest of the imports import ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Data Analysis Cookbook

Python Data Analysis Cookbook

Ivan Idris
Practical Simulations for Machine Learning

Practical Simulations for Machine Learning

Paris Buttfield-Addison, Mars Buttfield-Addison, Tim Nugent, Jon Manning

Publisher Resources

ISBN: 9781783551668Supplemental Content