text_plain_output_2.png text_plain_output_1.png
from sklearn.model_selection import train_test_split

from sklearn.model_selection import train_test_split

from sklearn.preprocessing import  StandardScaler

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

nRowsRead = 1000
df = pd.read_csv('../input/cusersmarildownloadsgermancsv/german.csv', delimiter=';', encoding='ISO-8859-2', nrows=nRowsRead)
df.dataframeName = 'german.csv'
nRow, nCol = df.shape

y = df['Creditability']
X = df.iloc[:, :-1]

label = y
train = X
(print('train shape: ', train.shape), print('label shape: ', label.shape))

x_train, x_test, y_train, y_test = train_test_split(train, label, test_size=0.3, random_state=42)

from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
x_train = scaler.fit_transform(x_train)
x_test = scaler.transform(x_test)

x_train = x_train.reshape(-1, 10, 10, 1)
x_test = x_test.reshape(-1, 10, 10, 1)

batch_size = 128
epochs = 8
learning_rate = 0.01
activation = 'relu'
Fully_connected_layer_nodes = 86
input_shape = (10, 10, 1)

img_rows = 10
img_cols = 10
if K.image_data_format() == 'channels_first':
    x_train = x_train.reshape(x_train.shape[0], 1, img_rows, img_cols)
    x_test = x_test.reshape(x_test.shape[0], 1, img_rows, img_cols)
    input_shape = (1, img_rows, img_cols)
else:
    x_train = x_train.reshape(x_train.shape[0], img_rows, img_cols, 1)
    x_test = x_test.reshape(x_test.shape[0], img_rows, img_cols, 1)
    input_shape = (img_rows, img_cols, 1)

print('x_train shape: ', x_train.shape)
print('y_train shape: ', y_train.shape)
print('x_test shape: ', x_test.shape)
print('y_test shape: ', y_test.shape)
print('input_shape: ', input_shape)