Plotting time-series graphs in scipy's dendrogram
Project description
Scipy’s dendrogram for agglomerative clustering requires extensive customizations to make it more informative. This package wraps scipy’s dendrogram with two customizations:
Timeseries graph at the side
Distance labels and cluster split points
Installation
pip install dendrogram_ts
Example
Plot by Maximum Clusters
from dendrogram_ts import maxclust_draw
plt.style.use('seaborn-whitegrid')
plt.figure(figsize=(8,5));
maxclust_draw(df, 'ward', 'euclidean', max_cluster=10, ts_hspace=2)
Plot by Color Threshold
from dendrogram_ts import colorclust_draw
import matplotlib as mpl
mpl.rcParams['lines.linewidth'] = 1
plt.style.use('seaborn-white')
plt.figure(figsize=(12,10))
colorclust_draw(df, method='ward', metric='euclidean', color_threshold=5200, ts_hspace=1)
Plot All Clusters
from dendrogram_ts import allclust_draw
plt.style.use('seaborn-whitegrid')
plt.figure(figsize=(12,10))
allclust_draw(df, 'ward', 'euclidean', ts_hspace=5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for dendrogram_ts-0.1.0-beta.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44a06cd827e429ddf4c969c4b17144cd4988a6302c9267769fc6033a3a3a67c4 |
|
MD5 | 29c5f7f1f4a7f8c99735110d19e3653d |
|
BLAKE2b-256 | cdf37255bc43db178363430089fbbdf12ed958c15812e31af240cdaccd9e372f |