Created
December 21, 2018 10:47
-
-
Save notha99y/06cb086f38c562b16aea063d678abf6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scipy.cluster.hierarchy import linkage | |
from scipy.cluster.hierarchy import dendrogram | |
sample_train,sample_val, gt_train, gt_val = train_test_split(train_df, | |
train_df['Survived'], | |
test_size=0.05, | |
random_state=99) | |
sample_val_processed = simple_preprocessing(sample_val, train = False) | |
sample_val_processed = scaler.fit_transform(sample_val_processed) | |
mergings = linkage(sample_val_processed, method='complete') | |
fig = plt.figure(figsize = (16,10)) | |
dendrogram(mergings, | |
labels=np.array(sample_val['Name']), | |
leaf_rotation=90, | |
leaf_font_size=10) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment