def train_model(folds, model):
scores = []<EOL>fit_model_time = <NUM_LIT:0>      <EOL>score_model_time = <NUM_LIT:0>    <EOL>for X_train, y_train, X_test, y_test in folds:<EOL><INDENT>start_time = time.time()<EOL>with ignore_warnings(category=ConvergenceWarning):  <EOL><INDENT>model.fit(X_train, y_train)<EOL><DEDENT>fit_model_time += time.time() - start_time<EOL>prediction_train_proba = model.predict_proba(X_train)[:, <NUM_LIT:1>]<EOL>prediction_train = (prediction_train_proba >= <NUM_LIT:0.5>).astype('<STR_LIT>')<EOL>start_time = time.time()<EOL>prediction_test_proba = model.predict_proba(X_test)[:, <NUM_LIT:1>]<EOL>score_model_time += time.time() - start_time<EOL>prediction_test = (prediction_test_proba >= <NUM_LIT:0.5>).astype('<STR_LIT>')<EOL>with warnings.catch_warnings():<EOL><INDENT>warnings.simplefilter("<STR_LIT:ignore>")<EOL>scores.append([<EOL>sklearn.metrics.matthews_corrcoef(y_test, prediction_test),<EOL>sklearn.metrics.matthews_corrcoef(y_train, prediction_train),<EOL>sklearn.metrics.roc_auc_score(y_test, prediction_test_proba),<EOL>sklearn.metrics.roc_auc_score(y_train, prediction_train_proba),<EOL>sklearn.metrics.brier_score_loss(y_test, prediction_test_proba),<EOL>sklearn.metrics.brier_score_loss(y_train, prediction_train_proba)<EOL>])<EOL><DEDENT><DEDENT>return np.mean(scores, axis=<NUM_LIT:0>), fit_model_time/len(folds), score_model_time/len(folds)<EOL>
Evaluation with:
  Matthews correlation coefficient: represents thresholding measures
  AUC: represents ranking measures
  Brier score: represents calibration measures