stumpy icon indicating copy to clipboard operation
stumpy copied to clipboard

Add MPdist Tutorial

Open seanlaw opened this issue 4 years ago • 9 comments

Now that mpdist has been implemented, it would be useful to have an mpdist tutorial

The paper is here

The supporting website is here

The goal of this tutorial would be to reproduce Figure 5 from the paper - An initial tutorial has been started here

seanlaw avatar Dec 07 '20 19:12 seanlaw

Here is the code for retrieving the data for Figure 5

%matplotlib inline

from scipy.io import loadmat
import pandas as pd
import matplotlib.pyplot as plt
from zipfile import ZipFile
from urllib.request import urlopen
import io
import ssl

context = ssl.SSLContext()  # Ignore SSL certificate verification for simplicity

plt.rcParams["figure.figsize"] = [20, 6]  # width, height
plt.rcParams['xtick.direction'] = 'out'

fzip = ZipFile(io.BytesIO(urlopen("https://sites.google.com/site/mpdistinfo/home/words_dendrogram.zip?attredirects=0&d=1").read()))
mat = fzip.extract("words_dendrogram/LisaBeth/MaryBethAnhLisa_data.mat")
data = loadmat(mat)

dfs = {}
for i in range(data['XSsY4'][0].shape[0]):
    name = data['XSsY4'][1][i][0]
    df = pd.DataFrame(data['XSsY4'][0][i].flatten(), columns=[name])
    dfs[name] = df

and then to plot the data:

fig, axs = plt.subplots(len(dfs), sharex=True, gridspec_kw={'hspace': 0})
plt.suptitle('Names', fontsize='30')

for i, (k, v) in enumerate(dfs.items()):
    ymax = v.max()
    axs[i].set_xlim(0, 300)
    axs[i].plot(v)
    axs[i].text(250, 0.99 * ymax, k, color="black", fontsize=20)

seanlaw avatar Dec 08 '20 21:12 seanlaw

It may also be useful to demonstrate how to combine mpdist with clustering (maybe hdbscan?)

seanlaw avatar Dec 15 '20 01:12 seanlaw

@seanlaw going to start taking a look at this today!

@davidrhallartificialeducation I'd first recommend going over all of the existing STUMPY tutorials. For consistency, we try to use the same headings and writing style where possible (I can help with this). Though, I recommend working on the code first and then coming back and annotating the notebook with more detail afterward.

Let me know if you have any questions, comments, or concerns.

seanlaw avatar Mar 01 '21 14:03 seanlaw

@seanlaw I think the wrong paper is linked here, it should be this.

asifmallik avatar Jun 04 '21 17:06 asifmallik

I think the wrong paper is linked here, it should be this.

Updated. Thank you @asifmallik!

seanlaw avatar Jun 04 '21 17:06 seanlaw

@seanlaw , I would like to work on this issue

asifmallik avatar Jun 04 '21 19:06 asifmallik

Now that mpdist has been implemented, it would be useful to have an mpdist tutorial

The paper is here

The supporting website is here

The goal of this tutorial would be to reproduce Figure 5 from the paper - An initial tutorial has been started here

Hi! is it possible to share the words_dendrogram.zip file somewhere? This website is down and the tutorial no longer works.

ksetdekov avatar Apr 19 '23 13:04 ksetdekov

Now that mpdist has been implemented, it would be useful to have an mpdist tutorial The paper is here The supporting website is here The goal of this tutorial would be to reproduce Figure 5 from the paper - An initial tutorial has been started here

Hi! is it possible to share the words_dendrogram.zip file somewhere? This website is down and the tutorial no longer works.

Please see response here

seanlaw avatar Apr 19 '23 13:04 seanlaw