Skip to main content

Documentation 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.

After training a traditional ML model, TryMLEasy automatically evaluates it on the held-out test split and displays a set of evaluation metrics sourced from 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.
sklearn.metrics.accuracy_scoreAccuracy is the fraction of test samples that were classified correctly:
Accuracy = (Number of correct predictions) / (Total number of predictions)
  • 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.
Prefer F1 Score over Accuracy when your classes are imbalanced. If one target class appears far more frequently than others in your dataset, a model can achieve misleadingly high accuracy by over-predicting the majority class. F1 Score reflects whether the model performs well across all classes, not just the dominant one.
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.
F1 Score, Precision, and Recall are called with default parameters — no average argument is set. For binary classification this works correctly, but for multiclass targets scikit-learn will raise a ValueError because it requires an explicit average strategy (e.g., 'macro', 'weighted'). If your target column has more than two unique class labels, these three metrics may fail. In that case, rely on Accuracy as the primary metric.

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.
sklearn.metrics.mean_squared_errorMSE is the average of the squared differences between each predicted value and its corresponding true value:
MSE = (1/n) × Σ (y_true − y_pred)²
  • 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.
sklearn.metrics.explained_variance_scoreExplained Variance quantifies the proportion of the total variance in the target that is captured by the model’s predictions:
Explained Variance = 1 − Var(y_true − y_pred) / Var(y_true)
  • 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.
sklearn.metrics.max_errorMax Error reports the single largest absolute prediction error across all test samples:
Max Error = max(|y_true − y_pred|)
  • 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
How to read the plot:
PatternInterpretation
Points cluster tightly along the diagonalModel is making accurate predictions
Points fan out away from the diagonalPrediction error is large; model needs improvement
Systematic offset above or below the diagonalModel has a consistent bias (over- or under-predicting)
A few outlier points far from the diagonalHigh Max Error; possible outliers in the test set or edge cases the model hasn’t learned
This plot is rendered for both Classification and Regression model types — for regression it directly shows numeric prediction quality; for classification applied to numerically encoded labels it can help spot systematic misclassification patterns.

Build docs developers (and LLMs) love