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.

The Traditional Model page (pages/4_traditional_model.py) is where TryMLEasy assembles a scikit-learn Pipeline, fits it to your training data, and displays a full suite of evaluation metrics and charts. The pipeline automatically incorporates any preprocessing and decomposition steps you selected during Feature Selection, chaining them together with your chosen model in the correct order — all without writing a single line of code.

Choosing a Model Type

At the top of the page, a selectbox asks you to choose between Classification and Regression. This choice determines which sub-models are listed in the second selectbox below it:
  • Choose Classification if your target column contains discrete class labels (e.g., categories, binary flags, or integer class IDs).
  • Choose Regression if your target column contains continuous numeric values (e.g., prices, scores, measurements).
The model list updates immediately when you switch between the two types.

Classification Models

When Classification is selected, TryMLEasy offers the following six scikit-learn models:

Logistic Regression

A linear model that predicts class probabilities using the logistic function. Works well for linearly separable data and serves as a strong baseline.

Decision Tree Classifier

Learns axis-aligned decision boundaries by recursively splitting the feature space. Easy to interpret but can overfit without pruning.

Gaussian Naive Bayes

A probabilistic classifier that assumes features follow a Gaussian distribution and are conditionally independent given the class label.

Support Vector Classification

Finds the maximum-margin hyperplane separating classes. Effective in high-dimensional spaces; uses an RBF kernel by default.

K-Nearest Neighbors

Classifies each sample by majority vote among its k nearest neighbours. Non-parametric and simple, but can be slow on large datasets.

Stochastic Gradient Descent Classifier

Implements linear classifiers (SVM, logistic regression) fitted with Stochastic Gradient Descent. Scales efficiently to very large datasets.

Regression Models

When Regression is selected, the following four models are available:

Linear Regression

Fits a linear relationship between features and target using Ordinary Least Squares. The standard starting point for continuous prediction tasks.

Support Vector Regressor

Extends SVM concepts to regression by finding a function that deviates from target values by at most epsilon (ε-insensitive loss).

Ridge Regression

Linear regression with L2 regularisation. Penalises large coefficients to reduce overfitting, especially useful when features are correlated.

Least Angle Regression

A stepwise regression algorithm (LARS) that is computationally efficient and suitable for high-dimensional datasets with sparse solutions.
The regression model dropdown in the UI displays “Rigde Regression” (a typo in the source) instead of “Ridge Regression”. This is a known spelling error in the current version of TryMLEasy. Select that option in the dropdown to use scikit-learn’s Ridge class.

How Training Works

When you click Train Model on {model_name}, TryMLEasy dynamically constructs a scikit-learn Pipeline from the steps you configured earlier. The pipeline is assembled in this order:
  1. Scaler (if you selected one on the Feature Selection page)
  2. Decomposition (if you selected one on the Feature Selection page)
  3. Model (the one you just chose)
Here is an example showing how the pipeline is built internally:
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
from sklearn.linear_model import LogisticRegression

# Example: StandardScaler → PCA → Logistic Regression
ml_pipe = [
    ('Standard Scaler', StandardScaler()),
    ('PCA', PCA()),
    ('Logistic Regression', LogisticRegression())
]
model = Pipeline(ml_pipe)
model.fit(X_train, y_train)
Steps for None are simply omitted from the list, so if you chose no scaler or decomposer the pipeline contains only the model itself. After fitting, TryMLEasy prints a diagram of the full pipeline directly on the page using scikit-learn’s set_config(display="diagram").

Evaluation Results

After training completes, TryMLEasy presents a full set of results without any extra clicks. Model Score model.score(X_test, y_test) is printed first. For classifiers this is accuracy; for regressors this is the R² coefficient of determination. Per-Metric Breakdown
The following metrics are computed between y_hat (predictions on the test set) and y_test:
MetricFunction
Accuracyaccuracy_score(y_hat, y_test)
F1 Scoref1_score(y_hat, y_test)
Precisionprecision_score(y_hat, y_test)
Recallrecall_score(y_hat, y_test)
Predicted vs. True Scatter Plot A matplotlib scatter plot is rendered showing predicted values on the x-axis and true values on the y-axis. A perfect model would place all points along the diagonal reference line (drawn in blue). Deviations from this line reveal where the model under- or over-predicts.
fig = plt.figure(figsize=(12, 12))
plt.scatter(y_hat, y_test, c='crimson')
plt.plot([max_val, min_val], [max_val, min_val], 'b-')  # ideal diagonal
plt.xlabel("Predicted Values")
plt.ylabel("True Values")
st.pyplot(fig)
If you select a Classification model but your target column contains continuous numeric data, the classification metrics (F1, Precision, Recall) will likely fail. TryMLEasy will display the warning "Metric Calculation Error !! Probably Because Classification used on Discrete Data !!" followed by the recommendation to switch to a Regression model. If you see this, go back to the Model Selection page and choose Regression instead.
For datasets with many correlated features, try combining Standard Scaler with PCA in your Feature Selection preprocessing steps. This removes multicollinearity, reduces dimensionality, and often leads to faster training and better generalisation — especially with distance-based models like K-Nearest Neighbors or Support Vector Classification.

Build docs developers (and LLMs) love