<commit_before>from __future__ import division
import numpy as np
from matplotlib import pyplot as plt

import models, pybasicbayes
from pymattutil.text import progprint_xrange

blah = models.collapsed_stickyhdphmm(2,10,50,pybasicbayes.distributions.ScalarGaussianNIX(0.,0.01,1.,4))
data, truestates = blah.generate(50)

plt.figure()
plt.plot(data)
plt.title('data')

plt.matshow(np.tile(truestates,(10,1)))
plt.title('true states')

blah = models.collapsed_stickyhdphmm(2,10,50,pybasicbayes.distributions.ScalarGaussianNIX(0.,0.01,1.,4))
blah.add_data(data)

for itr in progprint_xrange(100):
    blah.resample_model()

plt.matshow(np.tile(blah.states_list[-1].stateseq,(10,1)))
plt.title('after some resampling')

plt.show()
<commit_msg>sticky seems to be working okay<commit_after>from __future__ import division
import numpy as np
from matplotlib import pyplot as plt

import models, pybasicbayes
from pymattutil.text import progprint_xrange

blah = models.collapsed_stickyhdphmm(2,10,50,pybasicbayes.distributions.ScalarGaussianNIX(0.,0.01,2.,3))
data, truestates = blah.generate(50)

plt.figure()
plt.plot(data)
plt.title('data')

plt.matshow(np.tile(truestates,(10,1)))
plt.title('true states')

blah = models.collapsed_stickyhdphmm(2,10,50,pybasicbayes.distributions.ScalarGaussianNIX(0.,0.01,2.,3))
blah.add_data(data)

for itr in progprint_xrange(100):
    blah.resample_model()

plt.matshow(np.tile(blah.states_list[-1].stateseq,(10,1)))
plt.title('after some resampling')

plt.show()

{'fraction_non_alphanumeric': 0.13636363636363635, 'fraction_numerical': 0.045454545454545456, 'mean_word_length': 7.135869565217392, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5535128', 'n_tokens_mistral': 623, 'n_tokens_neox': 572, 'n_words': 95}