Random Forests Flashcards
What is the syntax to import the scikit-learn library function RandomForestRegressor
from sklearn.ensemble import RandomForestRegressor
What is random_state used for?
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.
What is the fit() method used for?
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)
What is the predict() method used for?
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.