Implement a RandomForestClassifier to train a model and make predictions based on the given dataset. The code will use n_estimators=10 and random_state=15 to ensure reproducibility. After training, the model should predict the results on the test data, and the accuracy score will be calculated for performance evaluation.
Steps:
Train the model using RandomForestClassifier.
Fit the model on x_train and y_train data.
Predict the labels for x_test.
Print the accuracy score comparing y_test and the predicted labels y_pred.
Tasks:
Implement the RandomForestClassifier code.
Validate the model by calculating the accuracy score.
Ensure reproducibility with random_state=15.
Implement a RandomForestClassifier to train a model and make predictions based on the given dataset. The code will use n_estimators=10 and random_state=15 to ensure reproducibility. After training, the model should predict the results on the test data, and the accuracy score will be calculated for performance evaluation.
Steps:
Train the model using RandomForestClassifier. Fit the model on x_train and y_train data. Predict the labels for x_test. Print the accuracy score comparing y_test and the predicted labels y_pred.
Tasks:
Implement the RandomForestClassifier code. Validate the model by calculating the accuracy score. Ensure reproducibility with random_state=15.