text_plain_output_1.png
import numpy as np

import pandas as pd

import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC, LinearSVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.neighbors import KNeighborsClassifier
from sklearn.naive_bayes import GaussianNB
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')
full = pd.concat([train, test], join='outer')

full['family'] = full.Parch + full.SibSp

import numpy as np
full['singlton'] = np.where(full.family == 1, 1, 0)
full['small'] = np.where(np.logical_and(full.family > 1, full.family < 5), 1, 0)
full['large'] = np.where(full.family > 4, 1, 0)

full['Fare'].fillna(full.Fare.mean(), inplace=True)

full.Age.isnull().sum()

rand = np.random.randint(full.Age.mean() - full.Age.std(), full.Age.mean() + full.Age.std(), full.Age.isnull().sum())

full.loc[full.Age.isnull(), 'Age'] = rand

full.info()