The Feature Selection page (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.
pages/2_feature_selection.py) is where you define what your model will learn from and how the data should be prepared before training. This page sits at the centre of the TryMLEasy workflow — the choices you make here directly shape the quality of every model result that follows. You will pick which columns serve as inputs (features), which column represents the output (target), apply optional preprocessing and dimensionality reduction, and decide how much data is reserved for testing.
Correlation Heatmap
As soon as the page loads, TryMLEasy automatically renders a correlation heatmap for all columns in your dataset. The heatmap is built withseaborn.heatmap() on top of dataset.corr() and is displayed at full width using matplotlib.
Use the heatmap to:
- Identify feature pairs that are strongly correlated with each other (multicollinearity), which can hurt model accuracy.
- Find which features are most correlated with your target column — good predictors tend to show a strong colour contrast in the target column or row.
- Decide which columns are worth including versus which can be dropped before training.
Selecting Features and Target
Below the heatmap, two selection widgets let you specify the ML inputs and output:- Feature columns — a
st.multiselectwidget listing every column in your dataset. Select one or more columns that will be used as input variables (X). - Target column — a
st.selectboxwidget (defaulting to the last column) that specifies the output variable (y) the model should learn to predict.
Preprocessing Step (Optional)
The preprocessing selectbox lets you choose a scaling or normalisation technique to apply to your feature matrix before it is passed to the model. The available options are:| Option | scikit-learn Class | Effect |
|---|---|---|
None | — | No transformation applied |
Standard Scaler | StandardScaler | Zero mean, unit variance |
MinMax Scaler | MinMaxScaler | Scales values to [0, 1] range |
Robust Scaler | RobustScaler | Scales using median and IQR; robust to outliers |
Normalization | Normalizer | Scales each sample to unit norm |
Pipeline that is built on the Traditional Model page.
The preprocessing step is applied only to Traditional ML models. When you choose the Neural Network path, this setting is not used — you should scale your data manually before uploading, or select features that are already on similar scales.
Decomposition Step (Optional)
The decomposition selectbox lets you reduce the dimensionality of your feature space before passing data to the model. The available options are:| Option | scikit-learn Class | Description |
|---|---|---|
None | — | No decomposition applied |
PCA | PCA | Principal Component Analysis — linear dimensionality reduction |
Kernal PCA | KernelPCA | Kernel-based non-linear dimensionality reduction |
FastICA | FastICA | Independent Component Analysis via FastICA algorithm |
Like preprocessing, the decomposition step is applied only to Traditional ML models. It is ignored when training neural networks.
Train/Test Split
A slider lets you control what fraction of your dataset is held out for evaluation:- Range: 1 – 50 (integer percentage)
- Default: 25 (i.e., 25% of data is used for testing)
sklearn.model_selection.train_test_split with test_size=test_ratio/100 to produce four arrays:
Proceeding to Model Selection
Once you have made valid selections (at least one feature, a non-overlapping target), click Next (Model Type Selection). TryMLEasy stores your configuration intost.session_state and navigates to the Model Selection page, where you choose between Traditional ML or Neural Networks.
The following values are saved into session state on click:
| Session State Key | Contents |
|---|---|
model_config['features'] | List of selected feature column names |
model_config['target'] | Name of the selected target column |
model_config['scaler_step'] | Selected preprocessing step (or 'None') |
model_config['decomp_step'] | Selected decomposition step (or 'None') |
train_test_data['xtrain'] | Training feature DataFrame |
train_test_data['xtest'] | Test feature DataFrame |
train_test_data['ytrain'] | Training target Series |
train_test_data['ytest'] | Test target Series |