You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contrib/machine-learning/random-forest.md
+6-31Lines changed: 6 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -2,31 +2,6 @@
2
2
3
3
Random Forest is a versatile machine learning algorithm capable of performing both regression and classification tasks. It is an ensemble method that operates by constructing a multitude of decision trees during training and outputting the average prediction of the individual trees (for regression) or the mode of the classes (for classification).
4
4
5
-
6
-
-[Random Forest](#random-forest)
7
-
-[Introduction](#introduction)
8
-
-[How Random Forest Works](#how-random-forest-works)
9
-
-[1. Bootstrap Sampling:](#1-bootstrap-sampling)
10
-
-[2. Decision Trees:](#2-decision-trees)
11
-
-[3. Feature Selection:](#3-feature-selection)
12
-
-[4. Voting/Averaging:](#4-votingaveraging)
13
-
-[Detailed Working Mechanism](#detailed-working-mechanism)
14
-
-[Step 3: Aggregation:](#step-3-aggregation)
15
-
-[Advantages and Disadvantages](#advantages-and-disadvantages)
Random Forest is an ensemble learning method used for classification and regression tasks. It is built from multiple decision trees and combines their outputs to improve the model's accuracy and control over-fitting.
32
7
@@ -41,9 +16,9 @@ Random Forest is an ensemble learning method used for classification and regress
41
16
For classification, the mode of the classes predicted by individual trees is taken (majority vote).
42
17
For regression, the average of the outputs of the individual trees is taken.
43
18
### Detailed Working Mechanism
44
-
*#### Step 1: Bootstrap Sampling:
19
+
#### Step 1: Bootstrap Sampling:
45
20
Each tree is trained on a random sample of the original data, drawn with replacement (bootstrap sample). This means some data points may appear multiple times in a sample while others may not appear at all.
46
-
*#### Step 2: Tree Construction:
21
+
#### Step 2: Tree Construction:
47
22
Each node in the tree is split using the best split among a random subset of the features. This process adds an additional layer of randomness, contributing to the robustness of the model.
48
23
#### Step 3: Aggregation:
49
24
For classification tasks, the final prediction is based on the majority vote from all the trees. For regression tasks, the final prediction is the average of all the tree predictions.
@@ -73,7 +48,7 @@ Hyperparameter tuning can significantly improve the performance of a Random Fore
73
48
#### Classification Example
74
49
Below is a simple example of using Random Forest for a classification task with the Iris dataset.
0 commit comments