Random Forests Flashcards

1
Q

What is the syntax to import the scikit-learn library function RandomForestRegressor

A

from sklearn.ensemble import RandomForestRegressor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is random_state used for?

A

random_state ensures that splits that you generate are reproducible and deterministic.

It is a seed to the random number generator that ensures the random numbers are generated in the same order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the fit() method used for?

A

Fitting is equal to training the data to the model. Then, after it is trained, the model can be used to make predictions, usually with a .predict() method call.

Syntax:
my_model.fit(features, target)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the predict() method used for?

A

Python predict() function enables us to predict the labels of the data values on the basis of the trained model.

Syntax:
my_model.predict(features)

The predict() function accepts only a single argument which is usually the data to be tested.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly