text_plain_output_1.png image_output_1.png
slot = 1
for i in range(2, 102):
    slot += 1

slot = 1
for i in range(102, 202):
    slot += 1

# Distribution of target within each feature
# Phân bố target theo từng biến
def plot_feat_dist(df1, df2, label1, label2, feat):
    i = 0
    sns.set_style('whitegrid')
    fig, ax = plt.subplots(10, 10, figsize=(30, 30))
    
    for feat in feat:
        i += 1
        plt.subplot(10, 10, i)
        sns.distplot(df1[feat], hist=False, label=label1)
        sns.distplot(df2[feat], hist=False, label=label2)
        plt.xlabel(feat)
    plt.show()

train0 = train.loc[train.target == 0]
train1 = train.loc[train.target == 1]
feat = train.columns.values[2:102]

feat = train.columns.values[102:202]

def train_test_dist(agg):
    features = train.columns.values[2:202]
    sns.set_style('whitegrid')

train_test_dist('max')