Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  Enroll Now

Titanic Machine Learning Project - Split into Train and Test Set

Now you need to divide the dataset into train and test set.


Import the Pandas library as pd as follows:

import pandas as << your code goes here >>

Add the following function as is:

def load_titanic_data(filename, titanic_path=TITANIC_PATH):
    csv_path = os.path.join(titanic_path, filename)
    return pd.read_csv(csv_path)

Split the data into train and test set by calling the function we created in step 2:

train_data = << your code comes here >>("train.csv")
test_data = << your code comes here >>("test.csv")

No hints are availble for this assesment

Answer is not availble for this assesment

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

Loading comments...