<jupyter_start><jupyter_text>TEST<jupyter_code>submit_df = pd.read_csv("../input/grasp-and-lift-eeg-detection/sample_submission.csv")
submit_df.shape
test_predicted_df = pd.read_csv("../input/window-prediction-to-frame-predictions/test_frame_prediction.csv") 
test_predicted_df[-10:]
test_diff = set(submit_df.id) - set(test_predicted_df.id)  
len(test_diff)
list(test_diff)[:10]
rows = []
for id_ in test_diff:
    row = {col: 0 for col in target_columns} 
    row["id"] = id_
    rows.append(row)
len(rows)
test_predicted_df.shape
test_predicted_df = test_predicted_df.append(rows, ignore_index=True)
test_predicted_df.shape
test_predicted_df[-10:]
extracted = test_predicted_df["id"].str.extract(ID_PATTERN)
extracted[:10]
for col in extracted.columns:
    test_predicted_df[col] = extracted[col].astype("int")
test_predicted_df = test_predicted_df.sort_values(by=["subject", "series", "frame"], axis=0)
test_predicted_df[:10]
extracted = submit_df["id"].str.extract(ID_PATTERN)
for col in extracted.columns:
    submit_df[col] = extracted[col].astype("int")
del extracted
gc.collect()
submit_df = submit_df.sort_values(by=["subject", "series", "frame"], axis=0)
test_predicted_df.shape[0] - submit_df.shape[0]
[(id1, id2) for id1, id2 in zip(submit_df.id, test_predicted_df.id) if id1 != id2]
submit_df[target_columns] = test_predicted_df[target_columns]
submit_df[:10]
submit_df.drop(columns=["subject", "series", "frame"], inplace=True)
submit_df.columns
submit_df.to_csv("test_submission.csv", index=None)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14915693904020752, 'fraction_numerical': 0.014915693904020753, 'mean_word_length': 7.524861878453039, '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': '571352', 'license': 'MIT', 'n_tokens_mistral': 603, 'n_tokens_neox': 587, 'n_words': 87, 'path': 'result/vgg_pretrained/window_750_stride_75_lr2e-4/prediction/frame-prediction-to-submit.ipynb', 'repo_name': 'yatszhash/kaggle-grasp-and-lift-eeg-detection', 'size': '1542'}