Login using Social Account
     Continue with GoogleLogin using your credentials
Now let's train a Random Forest
model the same way we trained the Decision Tree
model and see how it performs.
Import the RandomForestRegressor
class from Scikit-learn
from sklearn.ensemble import <<your code goes here>>
Now let's train the model with our training data
forest_reg = RandomForestRegressor(n_estimators=30, random_state=42)
forest_reg.<<your code goes here>>(housing_prepared, housing_labels)
Now we will predict using out model
housing_predictions = forest_reg.<<your code goes here>>(housing_prepared)
Finally, we will evaluate our model
forest_mse = mean_squared_error(housing_labels, housing_predictions)
forest_rmse = np.sqrt(forest_mse)
forest_rmse
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...