<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Logistic - Explore the Data
Raw Data
You are provided with the following data
Step1:  Dual Variable Exploration
Step2:  Explore the impact of ownership  with default
Explore the impact of age with defualt
Explore the impact of  income with default
Step3:  Explore the impact of  years with default
Three Variable Exploration
<ASSISTANT_TASK:>
Python Code:
#Load the libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
#Default Variables
%matplotlib inline
plt.rcParams['figure.figsize'] = (16,9)
plt.rcParams['font.size'] = 18
plt.style.use('fivethirtyeight')
pd.set_option('display.float_format', lambda x: '%.2f' % x)
#Load the dataset
df = pd.read_csv("data/loan_data_clean.csv")
df.head()
Explanation: Logistic - Explore the Data
Raw Data
You are provided with the following data: loan_data.csv
This is the historical data that the bank has provided. It has the following columns
Application Attributes:
- years: Number of years the applicant has been employed
- ownership: Whether the applicant owns a house or not
- income:  Annual income of the applicant
- age: Age of the applicant  
Behavioural Attributes:
- grade:  Credit grade of the applicant
Outcome Variable:
- amount : Amount of Loan provided to the applicant
- interest: Interest rate charged for the applicant
- default : Whether the applicant has defaulted or not 
Let us build some intuition around the Loan Data
Frame the Problem
What are the features
What are the target
Load the Refine Data
End of explanation
# Create a crosstab of default and grade
# Create a crosstab of default and grade - percentage by default type
# Create a crosstab of default and grade - percentage by all type
# Create a crosstab of default and grade - percentage by default type
Explanation: Dual Variable Exploration
End of explanation
# Create the transformed income variable
Explanation: Explore the impact of ownership  with default
Explore the impact of age with defualt
Explore the impact of  income with default
End of explanation
#Plot age, years and default
Explanation: Explore the impact of  years with default
Three Variable Exploration
End of explanation
<END_TASK>