<jupyter_start><jupyter_text>Classification metrics for FPS-adjusted renditions Data is generated with testing/test_var_fps_classification.py script<jupyter_code>import pandas as pd
import numpy as np
from sklearn.metrics import classification_report
pd.options.display.width = 0
pd.set_option('display.max_columns', None)
from IPython.display import display
# load data
df = pd.read_csv('test_fps_renditions_nm.csv')
df.set_index(['master_filename', 'rendition_type'], inplace=True)
df.sort_index(inplace=True)
# estimate classification metrics
df['ground_truth'] = np.where(df['is_correct'], 'Correct', 'Tamper')
df['prediction'] = np.where(df['score']<0.9, 'Correct', 'Tamper')
print('Non-framerate adjusted renditions:')
df_non_fps = df.query('not rendition_type.str.contains("fps")')
print(classification_report(df_non_fps['ground_truth'], df_non_fps['prediction']))
print('All FPS-adjusted renditions report:')
df_fps = df.query('rendition_type.str.contains("fps")')
df_fps
print(classification_report(df_fps['ground_truth'], df_fps['prediction']))
print('FPS-adjusted 30-60 FPS renditions report:')
df_fps = df.query('rendition_type.str.contains("30-60fps") or rendition_type.str.contains("60-30fps")')
print(classification_report(df_fps['ground_truth'], df_fps['prediction']))
print('Non-divisible FPS-adjusted renditions report:')
df_fps = df.query('not rendition_type.str.contains("30-60fps") and not rendition_type.str.contains("60-30fps")')
print(classification_report(df_fps['ground_truth'], df_fps['prediction']))<jupyter_output>Non-divisible FPS-adjusted renditions report:
              precision    recall  f1-score   support

     Correct       0.90      0.89      0.90       113
      Tamper       0.89      0.90      0.90       113

    accuracy                           0.90       226
   macro avg       0.90      0.90      0.90       226
weighted avg       0.90      0.90      0.90       226
{'fraction_non_alphanumeric': 0.12852664576802508, 'fraction_numerical': 0.04075235109717868, 'mean_word_length': 4.4714285714285715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '34207', 'license': 'MIT', 'n_tokens_mistral': 692, 'n_tokens_neox': 634, 'n_words': 121, 'path': 'feature_engineering/notebooks/Fps_renditions.ipynb', 'repo_name': 'oscar-davids/verification-classifier', 'size': '1914'}