text_plain_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.linear_model import LogisticRegression

from sklearn.model_selection import train_test_split

import pandas as pd

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

import pandas as pd
data = pd.read_csv('../input/train.csv')
labels = data['target'].values
data = data.drop(['id', 'target'], axis=1).values

from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(data, labels, test_size=0.2)

from sklearn.linear_model import LogisticRegression
clf = LogisticRegression(solver='saga', multi_class='multinomial')
clf.fit(X_train, y_train)

def evaluate(pred, labels):
    return sum(pred == labels) / len(pred)

pred = clf.predict(X_test)

from sklearn.ensemble import RandomForestClassifier
rfc = RandomForestClassifier(n_jobs=-1, n_estimators=5)
rfc.fit(X_train, y_train)

pred = rfc.predict(X_test)

unknown = pd.read_csv('../input/test.csv')
ids = unknown['id']
unknown = unknown.drop(['id'], axis=1).values
pred = rfc.predict(unknown)

out = pd.DataFrame(columns=['Id', 'Prediction'])
out['Id'] = ids
out['Prediction'] = pred
print(out.info())
out.head(10)