<jupyter_start><jupyter_text>Exploratory Analysis notebook<jupyter_code>import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt
%matplotlib inline
import bay12_solution_eposts as solution<jupyter_output><empty_output><jupyter_text>Load data**NOTE!** This loading function assumes the following directory structure:```/    data/        train/        test/    notebooks/        0_exploratory_analysis.ipynb    src/        bay12_solution_eposts/            __init__.py            prepare.py            ...```You may set `path_data="your/path/to/data"` if you have a different structure.<jupyter_code>post, thread = solution.prepare.load_dfs('train')
post.head()
thread.head()<jupyter_output><empty_output><jupyter_text>Look at label statistics on the train set<jupyter_code>lbl_stats = thread.groupby(['thread_label', 'thread_label_id']).thread_replies.agg(['count', 'sum'])
lbl_stats.columns = ['threads', 'posts']
# Adding 1 for each initial post (because it's sum of replies)
lbl_stats['posts'] += lbl_stats.threads
lbl_stats['avg posts per thread'] = (lbl_stats['posts'] / lbl_stats['threads']).astype(int)
lbl_stats
print(lbl_stats.index.tolist())<jupyter_output>[('bastard', 0), ('beginners-mafia', 1), ('byor', 2), ('classic', 3), ('closed-setup', 4), ('cybrid', 5), ('kotm', 6), ('non-mafia-game', 7), ('other', 8), ('paranormal', 9), ('supernatural', 10), ('vanilla', 11), ('vengeful', 12)]
{'fraction_non_alphanumeric': 0.15852795470629866, 'fraction_numerical': 0.01556970983722576, 'mean_word_length': 5.2844444444444445, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '422892', 'license': 'Apache-2.0', 'n_tokens_mistral': 496, 'n_tokens_neox': 474, 'n_words': 111, 'path': 'notebooks/0_exploratory_analysis.ipynb', 'repo_name': 'NowanIlfideme/kaggle_ni_mafia_gametype', 'size': '1413'}