Neural Networks (Supervised Learning)

Supervised learning — someone must have looked and labeled things beforehand. That person is usually underpaid.

Neural Networks (Supervised Learning)

AnalogyDefinition
Imagine Sharlock Helmes had to learn the craft of deduction - methodically, systematically, with the precision of a Swiss clockwork. A mentor shows him hundreds of pieces of evidence, each labeled as either 'genuine clue' or 'red herring'. Through this guided training, Sharlock develops an intuitive understanding of what makes evidence reliable. His arch-nemesis, Dr. Moriarty, constantly tries to mislead him with false clues. This is exactly how supervised learning works: algorithms learn from labeled examples to make accurate predictions about new, unknown data.

This interactive demonstration shows supervised learning in action. You provide labeled examples (clues vs. red herrings), and the neural network learns to classify new evidence. The system uses backpropagation to adjust weights and improve its decision-making over time.

Important Parameters
  • Learning Rate:Controls how quickly the network adapts to new information. Higher values learn faster but may overshoot optimal solutions.
  • Training Speed:Determines how many learning steps per second are executed during automatic training. Adjust to observe learning patterns at different speeds.
  • Evidence Types:Three categories: Clues (genuine evidence), Red Herrings (misleading clues), and Uncertain (unlabeled data for testing predictions).
Visualization Elements

The demo offers multiple ways to understand how the neural network makes decisions and learns from your data.

  • Data Points:Blue circles represent clues, red circles are red herrings, and gray circles show uncertain evidence with prediction borders.
  • Decision Boundary:The colored regions show where the network would classify evidence as clues (blue) or red herrings (red), with opacity indicating confidence.
  • Neural Network:Visual representation of the 2-3-1 network architecture showing nodes, connections, and real-time weight updates during training.
Tips for Effective Training
  • Start with some clear examples in each category to establish basic patterns.
  • Add uncertain points to test the network's predictions on unlabeled data.
  • Watch the accuracy indicator - it should improve as you add more diverse training examples.
  • Experiment with different learning rates to see how they affect convergence speed and stability.

Interactive Sharlock Helmes Training Ground

Help Sharlock Helmes learn to distinguish genuine clues from red herrings by training a neural network. Click on the canvas to add data points and watch how the network learns from your examples. The visualization below shows how Sharlock's artificial neural network processes evidence: input neurons receive coordinates, hidden neurons analyze patterns, and the output neuron determines whether a piece of evidence is a clue or a red herring from Dr. Moriarty.

What you see on the investigation field

Here Sharlock Helmes learns to tell real clues from red herrings — not from fixed rules, but from known examples. Here is what the picture shows.

What you see
A square investigation field with points in two classes: blue clues and red herrings. The background is filled as a coloured area and splits the field into two regions — one blue, one red. Where blue turns into red, the dividing line runs. Next to it, a small diagram shows the neural network that makes this split.
What happens
From a few points with a known answer the model draws a first rough border. With every training step the coloured area shifts, until the line cleanly separates the blue points from the red ones. The more examples you give, the sharper and better-fitting the transition between the colours becomes.
What you can do
Pick an evidence type at the top and click to place new points on the field. Train in single steps or automatically, adjust the learning rate and speed, or load a ready-made case from Sharlock's case file. Reset clears the field.
What to watch for
Supervised learning means drawing a rule from known examples that come with an answer. Watch that the final border also sorts new, not-yet-placed points correctly — not just the ones it learned from.

Sharlock's Detection Laboratory

🔍
Click to add evidence points. Use arrow keys for navigation.
Click to add evidence points, spacebar to change type, enter to train
Genuine Clues Red Herrings Uncertain Evidence
Decision Boundary

Evidence Collection

Learning Rate: 0.80

How big each learning step is. Low = stable but slow; high = fast but may overshoot the optimum.

Training Speed: 2 Steps/Second

Controls how fast the neural network training animation runs

Sharlock's Neural Deduction Network

Supervised Learning Explained

TheoryPseudo-CodeStep by StepFlow Diagram

Learning with a Teacher

Supervised Learning is like learning with a teacher: The model receives labeled training data - examples with the correct answer. It learns to map inputs (features) to outputs (labels) by recognizing patterns in the training data.

Training occurs iteratively: The model makes predictions, compares them with the true labels, calculates the error, and adjusts its parameters to minimize the error. This process repeats until the model makes good predictions.

Classification vs. Regression

Classification: Predicting categories (e.g. spam/not-spam, cat/dog). Regression: Predicting continuous values (e.g. house prices, temperature).

Advantages

  • Precise predictions: Very accurate with good training data
  • Well understood: Established methods and best practices
  • Measurable performance: Clear metrics (Accuracy, F1-Score, etc.)
  • Broad applicability: Works for many problem types

Challenges

Requires many labeled data - labeling is expensive and time-consuming. Overfitting (too good adaptation to training data) and underfitting (too simple models) are common problems. Data quality is crucial.

Practical Applications

Image and speech recognition, spam filters, medical diagnosis, credit risk assessment, stock price prediction, recommendation systems, and autonomous driving.

Try the demo! Train a model and see how it learns from examples.

Supervised Learning Quiz

Question 1 / 6
Not completed

What is the main goal of supervised learning?

Select all that apply
Answer Key: 1) B · 2) C · 3) C · 4) B · 5) B · 6) B