<jupyter_start><jupyter_text>Correlations to target<jupyter_code>df.corr()['h1n1_vaccine'].sort_values(ascending=False)
plt.figure(figsize=(20,20))
sns.heatmap(df.corr(), annot=True)
df.columns
behavioral_cols = ['behavioral_antiviral_meds',
       'behavioral_avoidance', 'behavioral_face_mask', 'behavioral_wash_hands',
       'behavioral_large_gatherings', 'behavioral_outside_home',
       'behavioral_touch_face']

plt.figure(figsize=(10,6))
sns.heatmap(df[behavioral_cols].corr(), annot=True);<jupyter_output><empty_output><jupyter_text>Feature Engineering<jupyter_code>df_interact = df[['h1n1_vaccine']].copy()
df_interact['behavioral_outside_gatherings'] = df['behavioral_outside_home'] * df['behavioral_large_gatherings']
df_interact.corr()['h1n1_vaccine']<jupyter_output><empty_output><jupyter_text>Categorical Features<jupyter_code>cat_features = ['age_group', 'education', 'race', 'sex', 'income_poverty',
                'marital_status', 'rent_or_own', 'employment_status', 'census_msa']
# Unstack idea from: https://stackoverflow.com/questions/48238305/bar-plot-with-groupby
fig, ax = plt.subplots(3, 3, figsize=(30,25))
for i, feature in enumerate(cat_features):
    df.groupby(feature)['h1n1_vaccine'].value_counts(normalize=True).unstack(0).plot.barh(ax=ax[i//3][i%3])
df.groupby('hhs_geo_region')['h1n1_vaccine'].value_counts(normalize=True).unstack(0).plot.barh(figsize=(15,6));
df.groupby('employment_industry')['h1n1_vaccine'].value_counts(normalize=True).unstack(0).plot.barh(figsize=(15,6));
df.groupby('employment_occupation')['h1n1_vaccine'].value_counts(normalize=True).unstack(0).plot.barh(figsize=(15,6))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16897173782321107, 'fraction_numerical': 0.03006614552014432, 'mean_word_length': 10.555555555555555, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '98941', 'license': 'MIT', 'n_tokens_mistral': 693, 'n_tokens_neox': 635, 'n_words': 52, 'path': 'Code/02_EDA.ipynb', 'repo_name': 'ericBayless/H1N1-Vaccine-Classification', 'size': '1663'}