Neural Network Lab

Machine Learning Prediction

Train a small neural network on your customer data, watch it learn, and find out honestly whether it beats a regression you could explain.

👨‍🏫 Professor Mode: Guided Learning Experience

New to neural networks? Professor Mode walks you through training one, judging it against a regression on customers it never saw, and spotting when it memorizes.

QUICK START: Choose Your Path

OVERVIEW & WHAT THIS TOOL SOLVES

When an AI vendor claims their deep learning model predicts customer churn or spend better than your analyst's regression, you need to know whether that gain is real signal—such as a curved diminishing-returns pattern or an interaction—or just memorization of training noise. The Neural Network Lab trains a feed-forward multilayer perceptron (MLP) side-by-side with a linear/logistic regression baseline on the exact same train/holdout split, auditing out-of-sample lift with paired bootstrap confidence intervals. New to what a network actually is? Start with the Neural Network Playground, then come back here to put one to work on a real customer file.

🎯 Questions It Answers

  • Does a neural network genuinely outperform a standard linear or logistic regression on unseen holdout customers?
  • How many hidden units, epochs, and L2 weight-decay regularization keep the network from overfitting small customer files?
  • Which features and non-linear response curves did the network learn compared to the flat slopes of a regression?

📂 What Data You Need

  • Customer Dataset: Preset marketing case study or uploaded CSV with numeric/categorical predictors and a continuous or binary target
  • Network Architecture: Hidden layer size (2 to 16 ReLU units), learning rate, L2 penalty (λ), and training epochs
  • Holdout Protocol: Seeded train/holdout split so both models are judged on the exact same untouched customers

💡 What You'll Discover

  • Head-to-Head Holdout Verdict: Paired bootstrap 95% CI on the holdout performance gap (RMSE or Log-Loss/AUC)
  • Epoch Learning Curves: Training vs. validation loss across epochs with automatic best-validation checkpointing
  • Glass-Box Inspection: Permutation feature importance, partial-dependence response curves, and live network diagram
🔍 Key Nuances & Common Traps to Watch For
  • Training Fit Means Nothing for Neural Nets: A wide network with enough epochs will almost always beat regression on the training rows by memorizing quirks. Only a positive holdout delta whose 95% bootstrap CI excludes zero justifies deploying the network.
  • When Linear/Logistic Regression Wins: When the true customer relationship is mostly additive and monotonic—or when sample size is small (n < 300)—regression matches or beats a neural network while remaining immediately interpretable.
  • Why L2 Weight Decay and Early Stopping Matter: Penalizing large weights (λ > 0) and restoring the epoch with the lowest validation loss prevent the ReLU hinges from chasing outlier customers.
📐 Under the Hood: Model Equations & Variable Definitions

1. Feed-Forward Hidden Layer (ReLU) & Output Prediction

\[ h_j = \text{ReLU}\!\left(\mathbf{w}_j^\top \mathbf{x} + b_j\right) = \max\!\left(0,\; \sum_{p=1}^{P} w_{jp} x_p + b_j\right), \qquad \hat{y} = g\!\left(v_0 + \sum_{j=1}^{H} v_j h_j\right) \]

💬 Read it in plain English: Each hidden unit j computes a weighted sum of standardized inputs x and passes it through a ReLU hinge max(0, z) to bend the response surface, then the output layer combines all H hinges via link function g(·) (identity for continuous spend, logistic sigmoid for binary churn).

x (x1…xP)
Standardized Predictor VectorYOUR DATA ⓘ
Customer input features z-scored using training-set mean and SD.
H, hj
Hidden Units & ReLU ActivationsESTIMATED ⓘ
Number of hidden neurons H and the non-negative activation output of hidden unit j.
wj, bj
Hidden-Layer Weights & BiasESTIMATED ⓘ
Learned input-to-hidden slopes w_{jp} and threshold intercept b_j for unit j.
vj, v0
Output-Layer Weights & BiasESTIMATED ⓘ
Learned weights combining the H hidden activations into the final score.
ŷ
Model PredictionOUTPUT ⓘ
Predicted continuous outcome (when g is identity) or predicted probability P(y=1) (when g is sigmoid).

2. L2-Penalized Training Objective & Paired Holdout Difference

\[ \mathcal{L}_{\text{reg}}(\boldsymbol{\theta}) = \frac{1}{N_{\text{train}}}\sum_{i=1}^{N_{\text{train}}} \ell(y_i, \hat{y}_i) + \frac{\lambda}{2}\sum w^2, \qquad \Delta_{\text{holdout}} = \text{Loss}_{\text{Baseline}}^{\text{holdout}} - \text{Loss}_{\text{NN}}^{\text{holdout}} \]

💬 Read it in plain English: Training minimizes average prediction error plus an L2 weight-decay penalty λ that shrinks extreme weights, and the model is judged by Δ_holdout—how much error the neural net cuts on unseen holdout rows compared to regression.

ℓ(yi, ŷi)
Observation Loss FunctionESTIMATED ⓘ
Squared error (y − ŷ)² for regression tasks or binary cross-entropy (log-loss) for classification.
λ
L2 Weight-Decay PenaltyYOUR DATA ⓘ
Regularization strength penalizing squared network weights to curb overfitting.
Δholdout
Paired Holdout Performance GainINFERENCE ⓘ
Out-of-sample error reduction vs. baseline regression, evaluated with a paired bootstrap 95% CI.

Step 1DATA SOURCE

Start with a case: each one was generated from a known formula, so at the end you can check what the network found against the truth. Or bring a customer file of your own.

📚

Use a Case Study

Five cases: a coffee subscription deciding who gets a save offer, a catalog mailer told to "use AI", a software trial with a network far too big for its data, a streaming service choosing which plan to lead with, and a mattress brand asking what more social spend would buy.

📤

Upload Your Data

Drag & Drop raw data file (.csv, .tsv, .txt)

One row per customer: an outcome column (yes/no, a category with 3 to 8 levels, or a number) and the columns to predict it from. Numbers can be on any scale; text columns become 0/1 columns automatically. Leave out IDs, dates, free text, and anything recorded after the outcome. At least 150 rows.

No file uploaded.

INPUTS & SETTINGS

Step 2Tell the model what to predict, and from what

Pick the outcome, then tick the columns to predict it from. Both models (the network and the regression) use exactly the same columns and the same customers, so the comparison is fair.

Predictors

No data loaded.

Step 3Set up the network, the split and the baseline

The defaults are a sensible small network. Change one thing at a time and train again, so you can see what that one change did.

How the customers are divided

The network learns from the training rows. The validation rows only decide when to stop. The holdout rows are kept back until training is over, and every number in the results comes from them.

The network

Training

The baseline to beat

The regression gives every chosen column one straight-line effect of its own.

    Up to four. A squared term lets the regression curve; a product lets one input's effect depend on another's.

    Advanced

    🤔 Try this:

    1. Load Ridgeline Roasters and train. Note the network's log loss and the logistic regression's, and read the verdict.
    2. Add two terms to the baseline: emails_per_month squared, and save_offer × lifecycle_stage. The network does not need to train again.
    3. Now who wins? Look at what the network's emails curve looked like, and ask why those two terms were the right ones to add.

    Step 4TRAINING

    Press Train and watch both curves. The network only ever learns from the training customers; the validation line shows how it is doing on customers it is not learning from. That second line is the one that matters.

    Load a case or upload a file to begin.

    Parameters per training row:–
    Estimated training time:–

    Loss on the training and validation customers, epoch by epoch

    Down is good: each line is the average penalty for the network's predictions, where a confident miss costs a lot. The solid line is the customers it learns from, the dashed line the validation customers it does not. The marker shows the epoch where the dashed line was lowest.

    📊 How to Read This Chart
    • The training line almost always keeps falling: the network is getting better at the customers it is memorizing.
    • When the dashed line turns up while the solid one keeps falling, the network has started learning the training customers' noise. Everything after that point makes it worse on new customers.
    • The gap between the two lines at the best epoch is normal. A gap that keeps widening is the warning.