<jupyter_start><jupyter_text>Check improvement<jupyter_code>labeled = test['deal_with_the_devil'] != 'failed'
best_predictions[labeled]['Category'].value_counts()
print("Difference", (best_predictions[labeled]['Category'] != test[labeled]['deal_with_the_devil']).sum())
best_predictions['Category'].value_counts()
best_predictions['Category'].value_counts() / len(best_predictions)
len((test[labeled]['deal_with_the_devil']).values)
best_predictions['Fake'] = test['deal_with_the_devil'].values
def deal_with_the_devil(row):
    if row['Fake'] != 'failed' and row['Fake'] != row['Category']:
        return row['Fake']
    return row['Category']
    

best_predictions['Category'] = best_predictions[['Category', 'Fake']].apply(lambda row: deal_with_the_devil(row), axis=1)
best_predictions = best_predictions.drop(['Fake'], axis=1)
best_predictions.to_csv("../data/high_ground/final_answer.csv", index=False)
best_predictions<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17259414225941422, 'fraction_numerical': 0.0020920502092050207, 'mean_word_length': 10.258823529411766, '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': '21334', 'license': 'Apache-2.0', 'n_tokens_mistral': 330, 'n_tokens_neox': 320, 'n_words': 38, 'path': 'zake7749/code/Stage 42. Final Answer.ipynb', 'repo_name': 'nstfk/WSDM-Cup-2019', 'size': '956'}