df['pred'] = (df['oof'] >= 0.5) * 1
    print(classification_report(df['gold'].values, df['pred'].values))
    from sklearn.metrics import roc_auc_score

    roc_auc_score(df['gold'].values, df['oof'].values)
    thresholds = np.arange(0, 1, 0.001)
    fscores = [
        f1_score(df['gold'].values, (df['oof'] >= t) * 1) for t in thresholds
    ]
    idx = np.argmax(fscores)
    print(thresholds[idx], fscores[idx])


if __name__ == "__main__":
    start = time.perf_counter()
    make_print_to_file(path=config.SAVE_DIR)
    # df_train = pd.read_csv(config.TRAIN_FILE, header=None, sep='\t')
    # df_val = pd.read_csv(config.VAL_FILE, sep='\t')
    # df_train.columns = ['tweet_id', 'user_id', 'tweet', 'label']
    # run(df_train, df_val)
    print(config.SEED)
    run_fold(0)
    run_fold(1)
    run_fold(2)
    run_fold(3)
    run_fold(4)
    # #
    run_result()

    test_prediction(kfold=config.KFOLD)
    end = time.perf_counter()
    df['pred'] = (df['oof'] >= 0.5) * 1
    print(classification_report(df['gold'].values, df['pred'].values))
    from sklearn.metrics import roc_auc_score

    roc_auc_score(df['gold'].values, df['oof'].values)
    thresholds = np.arange(0, 1, 0.001)
    fscores = [
        f1_score(df['gold'].values, (df['oof'] >= t) * 1) for t in thresholds
    ]
    idx = np.argmax(fscores)
    print(thresholds[idx], fscores[idx])


if __name__ == "__main__":
    start = time.perf_counter()
    make_print_to_file(path='.')
    # df_train = pd.read_csv(config.TRAIN_FILE, header=None, sep='\t')
    # df_val = pd.read_csv(config.VAL_FILE, sep='\t')
    # df_train.columns = ['tweet_id', 'user_id', 'tweet', 'label']
    # run(df_train, df_val)
    print(config.SEED)
    # run_fold(0)
    # run_fold(1)
    # run_fold(2)
    # run_fold(3)
    # run_fold(4)
    # run_result()
    test_prediction(kfold=config.KFOLD)
    end = time.perf_counter()
    time_cost = str((end - start) / 60)
    print("time-cost:", time_cost)