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 matplotlib.pyplot as plt

import matplotlib.pyplot as plt

import matplotlib.pyplot as plt

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)

fig = plt.figure(figsize=(21, 22))
label_index = y_train[:25].to_list()
for i in range(25):
    plt.subplot(5, 5, 1 + i)
    plt.title('Image Belongs to the label: ' + ' ' + str(label_index[i]), fontname='Times New Roman', fontweight='bold')
    plt.imshow(x_train[i, :, :, 0], cmap=plt.get_cmap('gray'))
plt.show()