<commit_before>import hypertools as hyp
import scipy.io as sio
import numpy as np

data = sio.loadmat('test_data.mat')
data1 = data['spiral']
data2 = data['randwalk']
hyp.plot([data1, data2])

hyp.plot(hyp.align([data1, data2]))

# A random rotation matrix
rot = np.array([[-0.89433495, -0.44719485, -0.01348182],
       [-0.43426149,  0.87492975, -0.21427761],
       [-0.10761949,  0.18578133,  0.97667976]])
# creating new spiral with some noise
data_rot = np.dot(data1, rot) + np.random.randn(data1.shape[0], data1.shape[1])*0.05
# before hyperalignment
hyp.plot([data1, data_rot])
# After hyperalignment
hyp.plot(hyp.align([data1, data_rot]))<commit_msg>update align example<commit_after>import hypertools as hyp
import scipy.io as sio
import numpy as np

data = sio.loadmat('test_data.mat')
data1 = data['spiral']
data2 = data['randwalk']
hyp.plot([data1, data2])

hyp.plot(hyp.util.align([data1, data2]))

# A random rotation matrix
rot = np.array([[-0.89433495, -0.44719485, -0.01348182],
       [-0.43426149,  0.87492975, -0.21427761],
       [-0.10761949,  0.18578133,  0.97667976]])
# creating new spiral with some noise
data_rot = np.dot(data1, rot) + np.random.randn(data1.shape[0], data1.shape[1])*0.05
# before hyperalignment
hyp.plot([data1, data_rot])
# After hyperalignment
hyp.plot(hyp.util.align([data1, data_rot]))
{'fraction_non_alphanumeric': 0.1647940074906367, 'fraction_numerical': 0.1453183520599251, 'mean_word_length': 4.685106382978724, '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': '6263083', 'n_tokens_mistral': 629, 'n_tokens_neox': 524, 'n_words': 111}