Skip to content

Commit

Permalink
Random Forest Done
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnoitanuj committed Nov 5, 2018
1 parent 585f2d6 commit 77333c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@
y = dataset.iloc[:, 2].values


from sklearn.tree import DecisionTreeRegressor
regressor = DecisionTreeRegressor(random_state=0)
from sklearn.ensemble import RandomForestRegressor
regressor = RandomForestRegressor(n_estimators=300, random_state=0)
regressor.fit(X,y)

#Predicting the results
y_pred = regressor.predict(6.5)
print(y_pred)

#Visualizing the predictions
X_grid = np.arange(min(X),max(X), 0.01)
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ Ensemble Learning: Take multiple algorithms or an algo multiple times to make a
3) Choose the number Ntree of tree you want to build and repeat steps 1 & 2
4) For a new data point, make each one of your Ntree trees predict the value of Y to for the data point in question, and assign the new data point the average across all of the predicted Y values

Random Forest is a team of Decision Trees
Random Forest is a team of Decision Trees.
#### Note: The number of steps does not depend on the number of tress. The average of decision of each tree is noted.

0 comments on commit 77333c3

Please sign in to comment.