Monday, 25 September 2017

How to use Hierarchical algorithm under Connectivity model of clustering ?



Methods of hierarchical linking algorithm
1. Min
2. Max
3. Ward's method
4. Group average

USE CASE
1. Text mining in NLP (Natural language processing) 
    For example : using Stanford NLP
2. Social network linking (LinkedIn,  FB)

EXAMPLE
from scipy.cluster import hierarchy
import matplotlib.pyplot as plt
import numpy as np

# Define your sample data set
ytdist = np.array([662., 877., 255., 412., 996., 295., 468., 268., 400., 754., 564., 138., 219., 869., 669.])

# Make Hierarchical linkage with data and  
# Single linkage (uses Min method)
# Possible values: single (uses Min) / complete (uses Max) / average
Z = hierarchy.linkage(ytdist, 'single')

# Plot and show the Dendogram showing the linkage
dn =
hierarchy.dendrogram(Z)

# plt.show()


No comments:

Post a Comment

Note: only a member of this blog may post a comment.