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

Function plot_actual_vs_predicted

src/visualizations.py:107–122  ·  view source on GitHub ↗

Plots actual vs predicted values for regression. Args: y_true (array-like): True values. y_pred (array-like): Predicted values.

(y_true, y_pred)

Source from the content-addressed store, hash-verified

105
106
107def plot_actual_vs_predicted(y_true, y_pred):
108 """
109 Plots actual vs predicted values for regression.
110
111 Args:
112 y_true (array-like): True values.
113 y_pred (array-like): Predicted values.
114 """
115 plt.figure(figsize=(8, 8))
116 plt.scatter(y_true, y_pred, color="darkblue", alpha=0.6)
117 plt.plot([min(y_true), max(y_true)], [min(y_true), max(y_true)], linestyle="--", color="red")
118 plt.xlabel("Actual Values")
119 plt.ylabel("Predicted Values")
120 plt.title("Actual vs Predicted Values")
121 plt.grid(alpha=0.5)
122 plt.show()
123
124
125def plot_class_distribution(y):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected