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

import tensorflow as tf

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

model = tf.keras.Sequential([tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(64, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10, activation='softmax')])
model.compile(metrics=['acc'], optimizer='adam', loss='sparse_categorical_crossentropy')

model.summary()

history = model.fit(X_train, Y_train, validation_data=(X_test, Y_test), epochs=100)

df_test = pd.read_csv('../input/test.csv')

X_testing = df_test.values
X_testing = X_testing.reshape(X_testing.shape[0], 28, 28)
X_testing = X_testing / 255.0

pred = model.predict(X_testing)

pred = pred.argmax(axis=1)

pred[0:19]