Titanic_0_1

#import numpy as np #import pandas as pd #Print you can execute arbitrary python code #train = pd.read_csv(“../input/train.csv”, dtype={“Age”: np.float64}, ) #test = pd.read_csv(“../input/test.csv”, dtype={“Age”: np.float64}, ) #Print to standard output, and see the results in the “log” section below after running your script #print(“nnTop of the training data:”) #print(train.head()) #print(“nnSummary statistics of training data”) #print(train.describe()) #Any files you save will be available in the output tab below #train.to_csv(‘copy_of_the_training_data.csv’, index=False) import numpy as np import pandas as pd from sklearn.cross_validation import KFold def read_data(titanic_file): # Load the csv file data = pd.read_csv(titanic_file, dtype={“Age”: np.float64}, ) # print the data description print (“tOknData description…”) print (data.describe()) # Data description # average the ‘Age’ column data[“Age”] = data[“Age”].fillna(data[“Age”].median()) data[“Fare”] = data[“Fare”].fillna(data[“Fare”].median()) # Replace all the occurences of male with the number 0.…


Link to Full Article: Titanic_0_1