After training a traditional ML model, TryMLEasy automatically evaluates it on the held-out test split and displays a set of evaluation metrics sourced fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Gurneet1928/TryMLEasy/llms.txt
Use this file to discover all available pages before exploring further.
sklearn.metrics. The metrics shown are determined by the model type you selected: Classification metrics are shown for classification models, and Regression metrics are shown for regression models. In addition to the numeric scores, a Predicted vs. True scatter plot is rendered for every model type.
Classification Metrics
The following four metrics are computed when you train a Classification model. All receive the array of predicted labels (y_hat) and the true test labels (ytest) as inputs.
- Accuracy
- F1 Score
- Precision
- Recall
sklearn.metrics.accuracy_scoreAccuracy is the fraction of test samples that were classified correctly:- Range: 0 to 1 (higher is better)
- Best for: Datasets where classes are roughly balanced in size. When one class is much more frequent than others, a model that always predicts the majority class can achieve high accuracy while being practically useless.
If a Classification model is accidentally applied to a continuous target column, metric calculation will raise an error. TryMLEasy will display the warning: “Metric Calculation Error !! Probably Because Classification used on Discrete Data !!” followed by a recommendation to switch to a Regression model instead.
Regression Metrics
The following three metrics are computed when you train a Regression model. All receive the predicted values (y_hat) and the true test values (ytest) as inputs.
Mean Squared Error
Mean Squared Error
sklearn.metrics.mean_squared_errorMSE is the average of the squared differences between each predicted value and its corresponding true value:- Range: 0 to ∞ (lower is better; 0 = perfect predictions)
- Units: Squared units of the target variable. Take the square root (RMSE) mentally to interpret the error in original units.
- Sensitivity: Squaring amplifies large individual errors, making MSE sensitive to outlier predictions.
Explained Variance
Explained Variance
sklearn.metrics.explained_variance_scoreExplained Variance quantifies the proportion of the total variance in the target that is captured by the model’s predictions:- Range: 0 to 1 (higher is better; 1 = model explains all variance in the target)
- Interpretation: A score of 0.85 means the model accounts for 85% of the variability in the target values. A score near 0 means the model is no better than predicting the mean.
- Difference from R²: Explained Variance does not penalise for a systematic bias in predictions (a constant offset), whereas R² does.
Max Error
Max Error
sklearn.metrics.max_errorMax Error reports the single largest absolute prediction error across all test samples:- Range: 0 to ∞ (lower is better; 0 = no prediction was ever wrong)
- Use case: A worst-case guarantee metric. Useful when the cost of a single large prediction error is disproportionately high — for example, predicting structural loads, financial risk limits, or safety-critical quantities. A model with low MSE but high Max Error may still fail unacceptably in edge cases.
Predicted vs. True Plot
After metrics are displayed, TryMLEasy renders a scatter plot comparing predicted and true values for the test set:- X-axis: Predicted values (
y_hat) - Y-axis: True values (
ytest) - Reference line: A blue diagonal line from
(min, min)to(max, max)representing perfect predictions (predicted = true) - Data points: Plotted in crimson
| Pattern | Interpretation |
|---|---|
| Points cluster tightly along the diagonal | Model is making accurate predictions |
| Points fan out away from the diagonal | Prediction error is large; model needs improvement |
| Systematic offset above or below the diagonal | Model has a consistent bias (over- or under-predicting) |
| A few outlier points far from the diagonal | High Max Error; possible outliers in the test set or edge cases the model hasn’t learned |