MCPcopy Create free account
hub / github.com/Riley702/enhanced_benchmark_tool / plot_threshold_metrics

Function plot_threshold_metrics

src/visualizations.py:68–84  ·  view source on GitHub ↗

Plots accuracy, precision, recall, and F1-score against different thresholds. Args: threshold_df (pd.DataFrame): DataFrame containing threshold evaluation metrics.

(threshold_df)

Source from the content-addressed store, hash-verified

66
67
68def plot_threshold_metrics(threshold_df):
69 """
70 Plots accuracy, precision, recall, and F1-score against different thresholds.
71
72 Args:
73 threshold_df (pd.DataFrame): DataFrame containing threshold evaluation metrics.
74 """
75 plt.figure(figsize=(10, 6))
76 for metric in ["accuracy", "precision", "recall", "f1_score"]:
77 plt.plot(threshold_df["threshold"], threshold_df[metric], marker="o", label=metric)
78
79 plt.xlabel("Threshold")
80 plt.ylabel("Score")
81 plt.title("Model Performance Across Different Thresholds")
82 plt.legend()
83 plt.grid(linestyle="--", alpha=0.7)
84 plt.show()
85
86
87def plot_residuals(y_true, y_pred):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected