bioneuralnet.metrics.evaluation
Functions
|
Evaluate macro F1-score over multiple runs. |
|
Evaluate weighted F1-score over multiple runs. |
|
Evaluate a single model (RF or XGB, classif or reg) over multiple runs, returning three tuples. |
|
Shortcut function: evaluate a RandomForest (classification or regression). |
|
Do one train/test split, train the specified model. |
|
Shortcut function: evaluate an XGBoost (classification or regression). |
|
Retrieves a global logger configured to write to 'bioneuralnet.log' at the project root. |
|
Plot grouped bar chart and save results to text file. |
|
Consolidate multiple metric grouped performances into one figure. |
Classes
|
PurePath subclass that can make system calls. |
|
Implementation of the scikit-learn API for XGBoost classification. |
|
Implementation of the scikit-learn API for XGBoost regression. |
- bioneuralnet.metrics.evaluation.evaluate_f1m(X: ndarray, y: ndarray, model_type: str = 'rf_classif', n_estimators: int = 100, runs: int = 5, seed: int = 119)[source]
Evaluate macro F1-score over multiple runs.
- bioneuralnet.metrics.evaluation.evaluate_f1w(X: ndarray, y: ndarray, model_type: str = 'rf_classif', n_estimators: int = 100, runs: int = 5, seed: int = 119)[source]
Evaluate weighted F1-score over multiple runs.
- bioneuralnet.metrics.evaluation.evaluate_model(X: ndarray, y: ndarray, model_type: str = 'rf_classif', n_estimators: int = 150, runs: int = 100, seed: int = 119)[source]
Evaluate a single model (RF or XGB, classif or reg) over multiple runs, returning three tuples. For classification:
(accuracy_mean, accuracy_std)
(f1_weighted_mean, f1_weighted_std)
(f1_macro_mean, f1_macro_std)
For regression:
(r2_mean, r2_std)
(None, None)
(None, None)
- bioneuralnet.metrics.evaluation.evaluate_rf(X: ndarray, y: ndarray, mode: str = 'classification', n_estimators: int = 150, runs: int = 100, seed: int = 119, return_all: bool = False)[source]
Shortcut function: evaluate a RandomForest (classification or regression).
- bioneuralnet.metrics.evaluation.evaluate_single_run(X: ndarray, y: ndarray, model_type: str = 'rf_classif', n_estimators: int = 100, test_size: float = 0.3, seed: int = 119)[source]
Do one train/test split, train the specified model.
Return: (accuracy, f1_weighted, f1_macro)
- bioneuralnet.metrics.evaluation.evaluate_xgb(X: ndarray, y: ndarray, mode: str = 'classification', n_estimators: int = 150, runs: int = 100, seed: int = 119, return_all: bool = False)[source]
Shortcut function: evaluate an XGBoost (classification or regression).
- bioneuralnet.metrics.evaluation.plot_grouped_performance(scores: dict[str, dict[str, tuple[float, float]]], title: str, ylabel: str = 'Score', filename: str | Path = None)[source]
Plot grouped bar chart and save results to text file.
- bioneuralnet.metrics.evaluation.plot_multiple_metrics(metrics: dict[str, dict[str, dict[str, tuple[float, float]]]], title_map: dict[str, str] = None, ylabel_map: dict[str, str] = None, filename: Path = None)[source]
Consolidate multiple metric grouped performances into one figure.
Adds numeric labels on top of each bar.