Project - Predicting Titanic Passenger Survival using Machine Learning and Python

21 / 21

Titanic Machine Learning Project - Train a RandomForest Classifier

The score we got with the SVC classifier was not that good. So now we will train and predict the dataset using a RandomForest classifier.


Import RandomForestClassifier from sklearn:

from sklearn.ensemble import << your code goes here >>

Train and evaluate the RandomForestClassfier:

forest_clf = << your code goes here >>(n_estimators=100, random_state=42)
forest_scores = cross_val_score(forest_clf, X_train, y_train, cv=10)
Get Hint See Answer

Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...