text_plain_output_1.png
from sklearn.linear_model import SGDClassifier

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train_df = pd.read_csv('../input/train.csv')

model_cols = ['Pclass', 'Sex', 'Age', 'SibSp', 'Parch', 'Fare', 'Cabin', 'Embarked']

train_x = pd.get_dummies(train_df[model_cols], columns=['Pclass', 'Sex', 'SibSp', 'Cabin', 'Embarked'])
train_y = train_df['Survived']

from sklearn.linear_model import SGDClassifier
clf = SGDClassifier(loss='log')
clf.fit(train_x, train_y)