<jupyter_start><jupyter_text>Fair Face EDA  Import Libraries<jupyter_code>import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import missingno as msno<jupyter_output><empty_output><jupyter_text>Load Data<jupyter_code>train_data1=pd.read_csv("/content/drive/MyDrive/fairface_resampling/fairface_original_train.csv")
train_data=train_data1.copy()
train_data.head()
train_data.shape
test_data1=pd.read_csv("/content/drive/MyDrive/fairface_resampling/fairface_original_test.csv")
test_data=test_data1.copy()
test_data.head()
test_data.shape<jupyter_output><empty_output><jupyter_text>Summary Statistics<jupyter_code>train_data.describe()
test_data.describe()
train_data.info()
test_data.info()<jupyter_output><class 'pandas.core.frame.DataFrame'>
RangeIndex: 10954 entries, 0 to 10953
Data columns (total 5 columns):
 #   Column        Non-Null Count  Dtype 
---  ------        --------------  ----- 
 0   file          10954 non-null  object
 1   age           10954 non-null  object
 2   gender        10954 non-null  object
 3   race          10954 non-null  object
 4   service_test  10954 non-null  bool  
dtypes: bool(1), object(4)
memory usage: 353.1+ KB<jupyter_text>Check for Missing Values<jupyter_code>train_data.isnull().sum()
plt.figure(figsize=(10,10))
msno.bar(train_data, color='teal');
test_data.isnull().sum()
plt.figure(figsize=(10,10))
msno.bar(test_data, color='teal');<jupyter_output><empty_output><jupyter_text>Check for Duplicate Values<jupyter_code>train_data.duplicated().any()
test_data.duplicated().any()<jupyter_output><empty_output><jupyter_text>Check Distribution<jupyter_code>plt.figure(figsize=(10,10))
chart=sns.countplot(x ='age', data = train_data)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45);
train_data['age'].value_counts()
plt.figure(figsize=(10,10))
chart=sns.countplot(x ='gender', data = train_data)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45);
train_data['gender'].value_counts()
plt.figure(figsize=(10,10))
chart=sns.countplot(x ='race', data = train_data)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45);
train_data['race'].value_counts()
plt.figure(figsize=(10,10))
chart=sns.countplot(x ='age', data = train_data)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45);
test_data['age'].value_counts()
plt.figure(figsize=(10,10))
chart=sns.countplot(x ='gender', data = test_data)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45);
test_data['gender'].value_counts()
plt.figure(figsize=(10,10))
chart=sns.countplot(x ='race', data = test_data)
chart.set_xticklabels(chart.get_xticklabels(), rotation=45);
test_data['race'].value_counts()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14865363334562892, 'fraction_numerical': 0.03541128734784212, 'mean_word_length': 6.906705539358601, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '69954', 'license': 'Unlicense', 'n_tokens_mistral': 1072, 'n_tokens_neox': 990, 'n_words': 146, 'path': 'sourcecode/EDA/fairface_eda.ipynb', 'repo_name': 'VinitaSilaparasetty/msc-data-science-dissertation', 'size': '2711'}