<jupyter_start><jupyter_text>Aaaaand our results suck :| :|Actually, they are not that bad: the frame to frame detector can only detect anomalies from the status quo, so it should only detect when we toggle from finding an anomaly to normal, and vice versa. Let's use this to get our real y_pred.<jupyter_code>def toggle_predictions(spikes_pred):
    cur = False
    toggled = []
    for v in spikes_pred:
        if v:
            cur = not cur
        toggled.append(cur)
    return toggled
y_pred_toggled = toggle_predictions(y_pred)
from sklearn.metrics import classification_report
import pandas as pd
pd.DataFrame(classification_report(y_true, y_pred_toggled, output_dict=True)).T<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06564245810055866, 'fraction_numerical': 0.0, 'mean_word_length': 4.390977443609023, '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': '202674', 'license': 'MIT', 'n_tokens_mistral': 227, 'n_tokens_neox': 218, 'n_words': 77, 'path': 'Supervised/notebooks/Train_frame_to_frame.ipynb', 'repo_name': 'Kebniss/AutoDetect', 'size': '716'}