# Algorithms Flashcards

1
Q

How are decisions trees created?

A

The process of creating a decision tree begins with selecting the attribute that will be used to make the first decision. This attribute is chosen based on its ability to effectively split the data into distinct groups. The data is then split into subgroups based on the value of the attribute, and the process is repeated on each subgroup until all of the data is classified

2
Q

What is Gini impurity?

A

A measure of the purity of a group of items. It is often used in decision trees for classification tasks to determine the most effective way to split the data into distinct groups.

Gini impurity = 1 - Σp^2 where p is the proportion of items in the group that belong to a particular class

3
Q

How does random forest work?

A

a large number of decision trees are trained on a random subset of the data, and the predictions of each tree are combined to make the final prediction. The random subset of the data used to train each tree is chosen by sampling with replacement from the original data, and each tree is trained on a different subset of the data. This process is repeated a large number of times, and the resulting forest of decision trees is used to make predictions