<jupyter_start><jupyter_text>```pythonCLASS_NAMES = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',               'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']```<jupyter_code>batch_1 = ['Ankle boot', 'T-shirt/top', 'T-shirt/top', 'Dress', 'T-shirt/top', 
           'Pullover', 'Sneaker', 'Pullover', 'Sandal', 'Sandal',
          'T-shirt/top', 'Ankle boot', 'Sandal', 'Sandal', 'Sneaker', 
           'Ankle boot', 'Trouser', 'T-shirt/top', 'Pullover', 'Pullover',
          'Dress', 'Trouser', 'Pullover', 'Bag', 'Pullover']
# Second 25 images from the train set
show_25_images(X_train[25:50])<jupyter_output><empty_output><jupyter_text>```pythonCLASS_NAMES = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat',               'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']```<jupyter_code>batch_2 = ['Coat', 'Pullover', 'Pullover', 'Pullover', 'Pullover',
          'Sandal', 'Dress', 'Shirt', 'Shirt', 'T-shirt/top',
          'Bag', 'Sandal', 'Pullover', 'Trouser', 'Shirt',
          'Shirt', 'Sneaker', 'Ankle boot', 'Sandal', 'Ankle boot',
          'Pullover', 'Sneaker', 'Dress', 'T-shirt/top', 'Dress']
# Third 25 images from the train set
show_25_images(X_train[50:75])
batch_3 = ['Dress', 'Dress', 'Sneaker', 'Pullover', 'Pullover',
          'T-shirt/top', 'Shirt', 'Bag', 'Dress', 'Dress',
          'Sandal', 'T-shirt/top', 'Sandal', 'Sandal', 'T-shirt/top',
          'Pullover', 'T-shirt/top', 'T-shirt/top', 'Coat', 'Trouser',
          'T-shirt/top', 'Trouser', 'Shirt', 'Dress', 'Trouser']
# Fourth 25 images from the train set
show_25_images(X_train[75:100])
batch_4 = ['Coat', 'Shirt', 'T-shirt/top', 'Trouser', 'Ankle boot',
          'Trouser', 'Dress', 'Sandal', 'Sneaker', 'Ankle boot',
          'Sneaker', 'Trouser', 'Sneaker', 'Ankle boot', 'Sneaker',
          'Sneaker', 'T-shirt/top', 'Pullover', 'Sneaker', 'Dress',
          'Shirt', 'Coat', 'Trouser', 'Trouser', 'Bag']
# Concat the four lists
final_batch = batch_1 + batch_2 + batch_3 + batch_4
import itertools
ab = itertools.chain(batch_1, batch_2, batch_3, batch_4)
list(ab)
# Define an encoding from the original classes to integers
# so that we can check for accuracy

encoding_dict = {'T-shirt/top': 0,
            'Trouser': 1,
            'Pullover': 2,
            'Dress': 3,
            'Coat': 4,
            'Sandal': 5,
            'Shirt': 6,
            'Sneaker': 7,
            'Bag': 8,
            'Ankle boot': 9}

# Define a handy function which will
# take a category and return its encoding
def return_encoding(category):
    return encoding_dict[category]
# Use the function to get all the encodings
# of the manual labels
manual_labels = np.array(list(map(return_encoding, final_batch)))
# Calculate the accuracy score
from sklearn.metrics import accuracy_score

print('The accuracy of the manual labels: {0:.2f}%'\
              .format(accuracy_score(y_train[:100], manual_labels)*100))<jupyter_output>The accuracy of the manual labels: 84.00%
{'fraction_non_alphanumeric': 0.1865771812080537, 'fraction_numerical': 0.019798657718120807, 'mean_word_length': 3.551145038167939, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '589323', 'license': 'MIT', 'n_tokens_mistral': 1133, 'n_tokens_neox': 1082, 'n_words': 267, 'path': 'notebooks/Annotation.ipynb', 'repo_name': 'sayakpaul/FloydHub-Deep-Learning-Projects-Structuring-Blog', 'size': '2980'}