<jupyter_start><jupyter_text>**Importing the dataset via Keras Api**<jupyter_code>df= keras.datasets.mnist.load_data()<jupyter_output>Downloading data from https://storage.googleapis.com/tensorflow/tf-keras-datasets/mnist.npz
11493376/11490434 [==============================] - 0s 0us/step<jupyter_text>**Splitting dataset into train and test**<jupyter_code>(X_train,y_train),(X_test,y_test)=df<jupyter_output><empty_output><jupyter_text>**Exploratory data analysis**<jupyter_code>print("Shape of each image in pixels",X_train[0].shape)
label=pd.Series(y_train)<jupyter_output><empty_output><jupyter_text>**Displaying digits from MNIST dataset**<jupyter_code>import random
fig,ax=plt.subplots(2,5,figsize=(15,7))
ax=ax.flatten()
for i in range(10):
    z=random.randint(0,60000)
    show=X_train[z].reshape(28,28)
    ax[i].imshow(show,cmap='binary')
    ax[i].set(title=f"Number:{y_train[z]}");<jupyter_output><empty_output><jupyter_text>**Total number of each digit**<jupyter_code>k=label.value_counts().sort_index()
df_new=pd.DataFrame(k,columns=['Number of Digits'])
df_new<jupyter_output><empty_output><jupyter_text>**Barplot showing the number of each digit**<jupyter_code># Print data histogram
plt.figure(figsize=(10,8))
a=sns.countplot(y_train,palette="flare");
a.set_xlabel("Digits 0-9",fontsize=15)
a.set_ylabel("Number of Digits in dataset",fontsize=15)<jupyter_output><empty_output><jupyter_text>**Pie plot**<jupyter_code>explode = (0, 0.3,0,0,0,0,0,0.2,0,0)
colors = ['#F66D44', '#FEAE65', '#E6F69D', '#AADEA7', '#64C2A6', '#2D87BB', '#58508D','#BC5090', '#FF6361', '#FFA600', ]
k.plot(kind='pie',figsize=(30,10),fontsize=17, colors=colors,explode=explode,shadow=True, wedgeprops = {"edgecolor" : "black",'linewidth': 2,'antialiased': True})
plt.xlabel("Digits 0-9",fontsize=17, weight='bold')
plt.ylabel("Number of Digits in dataset",fontsize=17,weight='bold')
plt.show()
df_new.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
UInt64Index: 10 entries, 0 to 9
Data columns (total 1 columns):
 #   Column            Non-Null Count  Dtype
---  ------            --------------  -----
 0   Number of Digits  10 non-null     int64
dtypes: int64(1)
memory usage: 160.0 bytes
{'fraction_non_alphanumeric': 0.19398907103825136, 'fraction_numerical': 0.05555555555555555, 'mean_word_length': 7.321969696969697, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '220011', 'license': 'MIT', 'n_tokens_mistral': 934, 'n_tokens_neox': 858, 'n_words': 126, 'path': 'Notebooks/EDA_MNIST.ipynb', 'repo_name': 'JahnaviDarbhamulla/Hand-Written-Digit-Classification-Recognition', 'size': '2196'}