Random Forest Regression

The following two tabs change content below.
I am a technology enthusiast and always up for challenges. Recently I have started getting hands dirty in machine learning using python and aspiring to gather everything I can.

Latest posts by Renuka Joshi (see all)

What comes to mind when we think of a forest after knowing about a tree ? In previous article we learned about decision tree regression and now will learn about random forest regression.

Random Forest Regression:

It uses ensemble learning. It either takes multiple algorithms or one algorithm multiple times and calculates predictions by taking average of predictions of algorithms. Random forest regression takes an input parameter to tell the number of decision trees.

 

  • We imported RandomForestRegressor.
  • Created regressor object with 1000 estimators. It is like creating 1000 decision trees for random forest.
  • fit X and y in regressor.

After fitting data in RandomForestRegressor, we simply predicted value of y_pred and it came to be 193113 which is a quite close prediction to actual value 190000.

 

References:

Share Button

Renuka Joshi

I am a technology enthusiast and always up for challenges. Recently I have started getting hands dirty in machine learning using python and aspiring to gather everything I can.

2 thoughts on “Random Forest Regression

Leave a Reply

Your email address will not be published. Required fields are marked *