<jupyter_start><jupyter_text>Data analysis<jupyter_code>loaded = glo.load_data_file(results['data_fname'])
if isinstance(loaded, np.ndarray):
    ss = data.SSNullResample(loaded)
    tst_data = ss.sample(loaded.shape[0]/2, seed=29)
    X, Y = tst_data.xy()
elif isinstance(loaded, tst.TSTData):
    X, Y  = loaded.xy()
    
# plot samples of the data
inds = np.array([0, 1, 3])
plt.figure(figsize=(12, 10))
n_imgs = 6
n_cols = 3
for i in range(n_imgs): 
    plt.subplot(n_imgs/n_cols, n_cols, i+1)
    show_loc_img(X[i], vmin=0, vmax=np.max(X[i]))
    plt.gca().get_xaxis().set_visible(False)
    plt.gca().get_yaxis().set_visible(False)
    plt.gca().set_frame_on(False)


mean_x = np.mean(X, 0)
mean_y = np.mean(Y, 0)

plt.figure(figsize=(8, 4))
plt.subplot(1, 2, 1)
show_loc_img(mean_x, vmax=0.5)
plt.title('positive emotion')

plt.subplot(1, 2, 2)
show_loc_img(mean_y, vmax=0.5)
plt.title('negative emotion')
# classify each location according to the distance to X (0) or Y (1)
centroids = np.vstack((mean_x, mean_y))
#def nearest_centroid(centroids, locs):
D = util.dist_matrix(locs0, centroids)


show_loc_img(mean_x - mean_y, vmin=0, vmax=0.1)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16440677966101694, 'fraction_numerical': 0.029661016949152543, 'mean_word_length': 5.056410256410256, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '193974', 'license': 'MIT', 'n_tokens_mistral': 540, 'n_tokens_neox': 513, 'n_words': 96, 'path': 'ipynb/exp5_face_results.ipynb', 'repo_name': 'cocoaaa/interpretable-test', 'size': '1180'}