Flash Sale: Flat 70% + Addl. 25% Off on all Courses | Use Coupon DS25 in Checkout | Offer Expires In

  Enroll Now

Predicting Passenger Survival in Titanic Shipwreck

4 / 21
   

Titanic Machine Learning Project - Split into Train and Test Set

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

INSTRUCTIONS

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...