text_plain_output_1.png
from sklearn import metrics

import pandas as pd

train = pd.read_csv('../input/emnist-balanced-train.csv', header=None)

test = pd.read_csv('../input/emnist-balanced-test.csv', header=None)

train_data = train.values[:, 1:]
train_labels = train.values[:, 0]
test_data = test.values[:, 1:]
test_labels = test.values[:, 0]

model = {}
y_pred = {}

for idx in ['perceptron', 'sgd', 'knn', 'nbayes', 'tree', 'forest', 'boosting']:
    model[idx].fit(train_data, train_labels)
    y_pred[idx] = model[idx].predict(test_data)
    print(idx, metrics.accuracy_score(test_labels, y_pred[idx]))