<jupyter_start><jupyter_text>Data Analysis<jupyter_code>data['BALANCE'].describe()
sns.distplot(data['BALANCE'])
plt.suptitle('Distribution of BALANCE')
data['BALANCE_FREQUENCY'].describe()
sns.distplot(data['BALANCE_FREQUENCY'])
plt.suptitle('Distribution of BALANCE_FREQUENCY')
data['PURCHASES'].describe()
sns.distplot(data['PURCHASES'])
plt.suptitle('Distribution of PURCHASES')
data['ONEOFF_PURCHASES'].describe()
sns.distplot(data['ONEOFF_PURCHASES'])
plt.suptitle('Distribution of ONEOFF_PURCHASES')
data['INSTALLMENTS_PURCHASES'].describe()
sns.distplot(data['INSTALLMENTS_PURCHASES'])
plt.suptitle('Distribution of INTSTALLMENTS_PURCHASES')
data['CASH_ADVANCE'].describe()
sns.distplot(data['CASH_ADVANCE'])
plt.suptitle('Distribution of CASH_ADVANCE')
data['CASH_ADVANCE_TRX'].describe()
sns.distplot(data['CASH_ADVANCE_TRX'])
plt.suptitle('Distribution of CASH_ADVANCE_TRX')
data['PURCHASES_TRX'].describe()
sns.distplot(data['PURCHASES_TRX'])
plt.suptitle('Distribution of PURCHASES_TRX')
data['CREDIT_LIMIT'].describe()
sns.distplot(data['CREDIT_LIMIT'])
plt.suptitle('Distribution of CREDIT_LIMIT')
data['PAYMENTS'].describe()
sns.distplot(data['PAYMENTS'])
plt.suptitle('Distribution of PAYMENTS')
data['MINIMUM_PAYMENTS'].describe()
sns.distplot(data['MINIMUM_PAYMENTS'])
plt.suptitle('Distribution of MINIMUM_PAYMENTS')
data['TENURE'].describe()<jupyter_output><empty_output><jupyter_text>quantitative vs quantitative<jupyter_code>data.columns
plt.figure(figsize=(15,10))
sns.regplot(x='BALANCE', y='PAYMENTS', data=data)
plt.show()
plt.figure(figsize=(15,10))
sns.regplot(x='PAYMENTS', y='MINIMUM_PAYMENTS', data=data)
plt.show()
# Inferencial statistics

# Hypothesis testing:
# 1. define null hypothesis and alternate hypothesis
# 2. Choose sample
# 3. Analyse evidence
# 4. Interpret results

# H0: There is no relationship between the explanatory and response 
# H1: There is a statistically significant relationship

# Bivariate statistical tools:
# Anova; chi-square; correlation coefficient
# Explanatory cathegorical and response quantitative: ANOVA
# Explanatory cathegorical and response cathegorical: Chi Square test
# Explanatory quantitative and response cathegorical: classify/bin explanatory variable and use Chi Square test
# Explanatory quantitative and response quantitative: Pearson correlation
print('Association between BALANCE and BALANCEFREQUENCY')
print(scipy.stats.pearsonr(data['BALANCE'], data['BALANCE_FREQUENCY']))
plt.figure(figsize=(15,10))
sns.regplot(x='ONEOFF_PURCHASES', y='PURCHASES', data=data)
plt.show()
print('Association between ONEOFF_PURCHASES and PURCHASES')
print(scipy.stats.pearsonr(data['ONEOFF_PURCHASES'], data['PURCHASES']))
print('Association between CASH_ADVANCE_FREQUENCY and CASH_ADVANCE_TRX')
print(scipy.stats.pearsonr(data['CASH_ADVANCE_FREQUENCY'], data['CASH_ADVANCE_TRX']))
print('Association between PURCHASES_FREQUENCY and PURCHASES_INSTALLMENTS_FREQUENCY')
print(scipy.stats.pearsonr(data['PURCHASES_FREQUENCY'], data['PURCHASES_INSTALLMENTS_FREQUENCY']))<jupyter_output>Association between PURCHASES_FREQUENCY and PURCHASES_INSTALLMENTS_FREQUENCY
(0.8623379116139297, 0.0)
{'fraction_non_alphanumeric': 0.12995245641838352, 'fraction_numerical': 0.011727416798732172, 'mean_word_length': 10.954545454545455, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '241242', 'license': 'MIT', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1130, 'n_words': 186, 'path': 'data_analysis.ipynb', 'repo_name': 'andreshugueth/credit_card_clustering', 'size': '3155'}