<jupyter_start><jupyter_text><a href="https://colab.research.google.com/github/SatyaRay003/Bank-Note-Authenticity-Predictor/blob/main/Exploratory_Data_Analysis(EDA).ipynb " target="_parent">  Exploratory Data Analysis (EDA) of UCI Bank Note Authentication Dataset --- Objective:  In this Notebook we will perform different `Exploratory Data Analysis(EDA)` and `Data Visualization` techniques to analyze different aspects of all the features of Bank Note Authentication Dataset.- Statistical Analysis- Single Variate Analysis- Multivariate Analysis Data Set Information:  Data were extracted from images that were taken from genuine and forged banknote-like specimens. For digitization, an industrial camera usually used for print inspection was used. The final images have `400x 400 pixels`. Due to the object lens and distance to the investigated object gray-scale pictures with a resolution of about `660 dpi` were gained. `Wavelet Transform tool` were used to extract features from images. Attribute  Information:  1. variance of Wavelet Transformed image (continuous)2. skewness of Wavelet Transformed image (continuous)3. curtosis of Wavelet Transformed image (continuous)4. entropy of image (continuous)5. class (integer)<jupyter_code># import all the necessary libraries

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline

import seaborn as sns
import plotly.figure_factory as ff
import plotly.express as px
import warnings
# Read the Dataset & load into pandas dataframe

df = pd.read_csv('./Data/BankNote_Authentication.csv')
# Check the Shape of the dataset

print(f'The Dataset contains Rows: {df.shape[0]}, Columns: {df.shape[1]}')
# Basic Information about the Dataset

df.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 1372 entries, 0 to 1371
Data columns (total 5 columns):
 #   Column    Non-Null Count  Dtype  
---  ------    --------------  -----  
 0   variance  1372 non-null   float64
 1   skewness  1372 non-null   float64
 2   curtosis  1372 non-null   float64
 3   entropy   1372 non-null   float64
 4   class     1372 non-null   int64  
dtypes: float64(4), int64(1)
memory usage: 53.7 KB<jupyter_text>Statistical Analysis:<jupyter_code># Statistical Analysis

df.describe().T.style.background_gradient(cmap='Pastel2')
df.groupby('class').describe().T.style.background_gradient(cmap='Pastel2')

plt.figure(figsize=(12, 8))
sns.heatmap(df.corr(), annot=True);<jupyter_output><empty_output><jupyter_text>Insights: >>>The target attribute has highest correlation (-0.72) with the feature, Variance.>The Skewness & Curtosis are also highly negatively correlated (-0.79).>> Multi Variate Analysis:<jupyter_code>sns.pairplot(df, hue='class', markers=["o", "^"], palette=['mediumspringgreen', 'blueviolet']);
fig = px.scatter_3d(df, x='variance', y='skewness', z='curtosis',
              color='class')
fig.show()<jupyter_output><empty_output><jupyter_text>![newplot2.png](attachment:newplot2.png) Single Variate Analysis:<jupyter_code>x0 = np.array(df[df['class']==0]['variance'])
x1 = np.array(df[df['class']==1]['variance'])

group_labels = ['Fake Notes', 'Original Notes']
colors = ['tomato', 'blueviolet']

fig = ff.create_distplot([x0, x1], group_labels, bin_size=.5,
                         curve_type='normal', colors=colors)

fig.update_layout(title_text='Distplot & Normal Distribution of Variance')
fig.show()<jupyter_output><empty_output><jupyter_text>![newplot1.png](attachment:newplot1.png)<jupyter_code>sns.jointplot(data=df, x='variance', y='skewness', hue='class', kind='kde', height=8, palette=['#ff4766', '#cb10e8']);
plt.figure(figsize=(12, 8))

plt.pie(df['class'].value_counts(), labels=['Fake Bank Note', 'Original Bank Note'], 
        autopct='%1.2f%%', labeldistance=1.1, colors=['#c4f8fe', '#ffadad'],textprops={'fontsize':15});


# draw circle
centre_circle = plt.Circle((0, 0), 0.45, fc='white')
fig = plt.gcf()
  
# Adding Circle in Pie chart
fig.gca().add_artist(centre_circle);

plt.title('\nPercentage of Fake & Original Bank Note in the Data Set\n', size=20);<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1317263209155101, 'fraction_numerical': 0.029705381056732406, 'mean_word_length': 5.388802488335926, 'pattern_counts': {'":': 0, '<': 22, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '403094', 'license': 'MIT', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1303, 'n_words': 367, 'path': 'Exploratory_Data_Analysis(EDA).ipynb', 'repo_name': 'SatyaRay003/Bank-Note-Authenticity-Predictor', 'size': '4107'}