<jupyter_start><jupyter_text>TSNE<jupyter_code>tsne_lab = []
tsne_feat = []
for img_path in glob(train_imgs + "*/"):
    for img in glob(img_path +"*.jpg")[:500]:
        img_name = img.split("/")[-1]
        img_class = class_map[img_path.split("/")[-2]]
        feat = predict_concept(img, model)
        tsne_lab.append(img_class)
        tsne_feat.append(feat)
from sklearn.manifold import TSNE
tsne = TSNE(n_components=2)
transform = tsne.fit_transform(tsne_feat)
import seaborn as sns
plt.figure(figsize=(12,12))
sns.scatterplot(x=transform[:,0], y=transform[:,1], hue=tsne_lab)
plt.savefig('tsne.png', dpi=100, bbox_inches='tight')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1661676646706587, 'fraction_numerical': 0.02245508982035928, 'mean_word_length': 5.081818181818182, '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': '391489', 'license': 'MIT', 'n_tokens_mistral': 278, 'n_tokens_neox': 265, 'n_words': 39, 'path': 'conceptsGenerator.ipynb', 'repo_name': 'hamna-moieez/Distracted-Driver-Detection-Using-Deep-Learning', 'size': '668'}