text_plain_output_1.png
from sklearn.linear_model import LogisticRegression

import pandas as pd

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
train = pd.read_csv('../input/train.csv')
test = pd.read_csv('../input/test.csv')

test_ID = test.PassengerId
train = train.drop(['PassengerId', 'Name', 'Ticket'], axis=1)
test = test.drop(['Name', 'Ticket'], axis=1)

train.drop('Cabin', axis=1, inplace=True)
test.drop('Cabin', axis=1, inplace=True)

train.dtypes

test.dtypes

from sklearn.linear_model import LogisticRegression
glm = LogisticRegression()

X_train = train.drop('Survived', axis=1)
Y_train = train['Survived']
X_test = test.drop('PassengerId', axis=1).copy()

glm.fit(X_train, Y_train)