<jupyter_start><jupyter_text>Load precomputed stat. features and labels<jupyter_code>assert Path('data/train').exists() and\
       Path('data/dev').exists() and\
       Path('data/val').exists(), 'Download precomputed features'

with open('configs/included_features.json', 'r') as config:
    included_features = json.load(config)
    
save_path = Path('data')
*_, val_x = get_stat_features(path=save_path, included_features=included_features)
*_, (_, val_y) = get_data(dataset_path=Config.dataset_path, protocol_paths=Config.protocols_paths)<jupyter_output>0%|          | 0/3 [00:00<?, ?it/s]<jupyter_text>Load pretrained models<jupyter_code>assert Path('pretrained_models/random_forest_train_dev').exists() and\
       Path('pretrained_models/cat_boost_train_dev').exists() and\
       Path('pretrained_models/light_gbm_train_dev').exists(), 'Download pretrained models'

rf = load('pretrained_models/random_forest_train_dev')
cb = load('pretrained_models/cat_boost_train_dev')
lgbm = load('pretrained_models/light_gbm_train_dev')<jupyter_output><empty_output><jupyter_text>Evaluate EER on the validation set<jupyter_code>for clf, clf_name in zip([rf, cb, lgbm], ['Random forest', 'CatBoost', 'Light GBM']):
    pred_proba = clf.predict_proba(val_x).T[1]
    eer, threshold = calc_eer(val_y, pred_proba)
    print(f'{clf_name}\nValidation EER: {round(eer, 2)}\nThreshold: {round(threshold, 2)}\n')<jupyter_output>Random forest
Validation EER: 9.55
Threshold: 0.37

CatBoost
Validation EER: 4.21
Threshold: 0.34

Light GBM
Validation EER: 3.93
Threshold: 0.34
{'fraction_non_alphanumeric': 0.13773222293401666, 'fraction_numerical': 0.017937219730941704, 'mean_word_length': 6.509615384615385, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 11, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '375670', 'license': 'MIT', 'n_tokens_mistral': 580, 'n_tokens_neox': 552, 'n_words': 95, 'path': 'model_testing.ipynb', 'repo_name': 'IDRnD/antispoofing-features', 'size': '1561'}