smftools.analysis.compute.ml_metrics#
Matrix-level helpers for binary classifier fitting and evaluation.
Inputs are feature matrices, labels, and metadata-derived parameters. No AnnData access or file I/O occurs here.
Functions
|
Construct a supported binary sklearn classifier pipeline. |
|
Evaluate a binary classifier from labels and positive-class scores. |
|
Fit and return a fresh copy of an estimator. |
|
Build a summary row dictionary, dropping keys with value |
|
Express PR AUC as fold improvement over the baseline positive frequency. |
|
Return a continuous positive-class score for a fitted binary classifier. |
- smftools.analysis.compute.ml_metrics.build_binary_classifier(model_name, random_state=42, **kwargs)#
Construct a supported binary sklearn classifier pipeline.
- smftools.analysis.compute.ml_metrics.fit_classifier(estimator, X_train, y_train)#
Fit and return a fresh copy of an estimator.
- smftools.analysis.compute.ml_metrics.predict_binary_scores(model, X)#
Return a continuous positive-class score for a fitted binary classifier.
- Return type:
- smftools.analysis.compute.ml_metrics.normalize_pr_auc(pr_auc, pos_freq)#
Express PR AUC as fold improvement over the baseline positive frequency.
- Return type:
- smftools.analysis.compute.ml_metrics.evaluate_binary_classifier(y_true, y_score, y_pred=None, prefix='test', target_eval_freq=None, random_state=42)#
Evaluate a binary classifier from labels and positive-class scores.
- Return type: