TryMLEasy’s neural network path spans three dedicated pages that walk you from layer design all the way through to training metrics and loss curves — no Python required. The workflow is linear: first you configure your layers using an interactive table, then you verify the compiled architecture by reviewing the model summary, and finally you train the network with your chosen epochs and batch size. Each page stores its outputs in Streamlit session state so the model carries forward automatically.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.
Step 1 — Configure Layers
Page:pages/7_neural_network_configuration.py
The configuration page presents a dynamic st.data_editor table where each row represents one Dense layer in your network. You build the architecture by adding rows and filling in three columns for each layer:
| Column | Type | Constraints | Description |
|---|---|---|---|
Layer Name | Text | Required | A descriptive label for the layer (e.g., "Input Layer", "Hidden Layer") |
Neurons | Number | 2 – 100, required | The number of units in this Dense layer |
Activation Function | Selectbox | relu, sigmoid, tanh | The activation applied after the linear transformation |
st.session_state.nn_config and proceed to the architecture verification page.
You must manually enter the index value (0, 1, 2, …) for each row you add to the table. Rows without a valid index are not accepted by the editor and will be silently dropped when the configuration is saved. This is a known limitation of the current version — the TryMLEasy team is actively working on improving the layer editor UX.
Step 2 — Verify Architecture
Page:pages/8_neural_network_architecture.py
On this page, TryMLEasy takes the layer table from session state, constructs a tf.keras.Sequential model, and prints its full summary so you can confirm everything looks correct before training begins.
The model is built with two automatic additions that you do not need to configure manually:
- Input layer — a
tf.keras.layers.Inputlayer is prepended withshape=(num_features,), wherenum_featuresis the number of feature columns you selected on the Feature Selection page. - Output layer — a single
Dense(1)layer (no activation) is appended after your user-defined layers to produce a scalar prediction.
mse as a metric.
Here is the exact construction logic used internally:
model.summary() output is streamed directly to the page via st.text(), giving you a layer-by-layer view of parameter counts and output shapes. Review it carefully — if the architecture looks wrong (wrong number of layers, mismatched shapes), click Back (Neural Network Configuration) to edit the layer table and rebuild.
When the architecture looks correct, click Train Model to store the compiled model in st.session_state.keras_model and move to the training page.
Step 3 — Train the Network
Page:pages/9_train_neural_network.py
The training page is where you set the final hyperparameters and start the fitting process. Two st.number_input fields let you specify:
- Epochs — the number of full passes over the training data. The Train Neural Network button is disabled until both this and batch size are non-zero.
- Batch Size — how many samples are processed per gradient update.
matplotlib, plotting history.history['loss'] and history.history['val_loss'] against epoch number. This chart is the primary tool for diagnosing underfitting (both curves still decreasing) and overfitting (validation loss rising while training loss falls).
Tips for Good Results
How many neurons should each layer have?
How many neurons should each layer have?
For most tabular datasets, starting with 32–64 neurons in the first hidden layer and gradually reducing towards the output (e.g., 64 → 32 → 16) works well. This funnel shape encourages the network to learn increasingly abstract representations. Very small datasets may not need more than 16–32 neurons per layer — too many parameters relative to training samples leads to overfitting.
Which activation function should I use?
Which activation function should I use?
ReLU (
relu) is the safest default for hidden layers — it is computationally cheap, avoids the vanishing gradient problem, and works well across a wide range of tasks. Use Sigmoid (sigmoid) in the last hidden layer if you want outputs bounded between 0 and 1, or when working on binary-like regression targets. Tanh (tanh) is a reasonable alternative to sigmoid that centres outputs around zero, which can help with convergence in deeper networks.How many epochs should I train for?
How many epochs should I train for?
Watch the Training vs. Validation Loss graph after your first run. If both curves are still declining at the end, increase your epoch count. If the validation loss starts rising while training loss keeps falling, you are overfitting — stop training earlier (reduce epochs) or simplify your architecture (fewer neurons or layers). A good starting range is 50–200 epochs for small-to-medium tabular datasets.
Why is my loss not decreasing?
Why is my loss not decreasing?
A flat or erratic loss curve usually points to one of these causes:
- Features are not scaled. Neural networks are sensitive to feature scale. Go back to the Feature Selection page and choose Standard Scaler or MinMax Scaler in the preprocessing step — note that while the traditional model pipeline applies the scaler automatically, for neural networks you should ensure your data is scaled before uploading, or select a scaler and manually apply it to your dataset outside TryMLEasy.
- Too few neurons. If the network cannot express the underlying relationship, loss will stagnate. Try doubling the neuron count in each layer.
- Wrong activation function. Try switching to
relufor hidden layers if you are usingsigmoidortanhthroughout. - Learning rate or batch size mismatch. TryMLEasy uses the Adam optimizer’s default learning rate. Very large batch sizes can slow convergence — try a batch size between 16 and 64.