Simplified K-Means Clustering (K=3)

Game Objective:

Place the three Centroids (C1, C2, C3) correctly on the map.

Then, run the K-Means Algorithm by clicking Iterate. The goal is to reach the lowest possible Inertia in the fewest steps.

The initial placement is critical!

Controls

Centroids needed: 3

Steps: 0

Inertia: N/A

Data Visualization

Status: Click to place Centroid 1...

Neural Network Trainer

Train a neural network to classify data! Observe how adding a Hidden Layer allows the network to solve non-linear problems like XOR.

How to Play & Learn:

  • Goal: The network tries to paint the background Blue for Blue points (1) and Red for Red points (0).
  • The Problem: A "Single Neuron" can only draw a straight line. Try using it on the XOR or Circle dataset - it will fail!
  • The Solution: Switch to "Hidden Layer". This adds neurons that can bend the line, allowing the network to solve complex shapes.
  • Watch the Loss: The "Loss" number tells you the error. Watch it go down as the network learns (Epochs increase).
Epochs: 0
Loss (MSE): 0.000

Decision Boundary

Blue Area = Predict 1 | Red Area = Predict 0

k-Nearest Neighbors (k-NN)

k-NN is a method used to predict the value of a new data point based on the values of its 'k' nearest neighbors. It is a simple and effective way to make predictions without needing to learn a complex model. For example, if you have a list of fruits and you want to predict if a new fruit is a banana or an apple, you would look at the fruits that are closest to the new fruit and see if the majority are bananas or apples.


How it Works:

1. When you label a point, it acts as a reference point.

2. Every unlabeled (grey) point looks at its "5 nearest labeled neighbors" (k=5).

3. It takes the "majority vote" (e.g., 3 Blue, 2 Red = Predict Blue).

4. Your goal: Achieve 100% accuracy with minimum number of clicks.


Labels Given: 0
Remaining: 0
Accuracy: 0%
Status: Start Labeling Data

A* Pathfinding Heuristic Challenge

Goal: Select the best heuristic to find the shortest path from Start (Green) to Goal (Red). Then, analyze the trade-off between path length and the number of cells explored.

What This Game Teaches:

  • A* Algorithm: It is a smart way to find the shortest path between two points in a graph. It uses two parts: one part tells us how far we are from the starting point, and the other part tells us how far we are from the goal.
  • Cost Function (f(n)): The balance between Actual Cost (g(n)) and Heuristic Cost (h(n)).
  • g(n) (Actual Cost): The distance traveled from the start point to the current cell.
  • h(n) (Heuristic): The estimated distance from the current cell to the goal. A good heuristic guides the search efficiently.
  • Heuristic Comparison:
    • Manhattan: Only counts horizontal/vertical steps. Faster exploration, guaranteed shortest path on a grid without diagonal movement.
    • Euclidean: Straight-line distance. Often less efficient on a grid but common in robotics.
    • Zero (Dijkstra's): Ignores h(n). Guaranteed shortest path, but explores the largest number of cells (slowest).
Path Length: 0
Cells Explored: 0
Heuristic: Manhattan

The Clustering Challenge

Clustering is a fundamental task in Unsupervised Machine Learning, where the goal is to group similar data points together without prior knowledge of the groups.


The Goal: Find K and Place Centroids

  1. Guess the right K value: Look at the scatter plot on the right and determine the likely number of distinct clusters (the true K value is hidden).
  2. Set the initial Centroids: Click on the map to place K centroids close to the visual center of the clusters you see.
  3. Run K-Means: Press the "Run K-Means" button. K-Means will iteratively refine the centroid positions to minimize the total squared distance (Inertia).

Understanding K-Means

  1. Assignment (E-Step): Each data point is assigned to the nearest centroid.
  2. Update (M-Step): Each centroid is moved to the mean (average) location of all the points assigned to it.

Placed: 0

True K: ? | Inertia: N/A

Status: Choose K and Click to place Centroids.

Logic Gate Builder

Select the correct Logic Gate (AND, OR, or XOR) that matches the target Truth Table outputs.

Logic Gates (AND, OR, XOR) are the fundamental operations of digital circuits and the core functions that a single perceptron or neuron must learn to model.

How Gates Work:

Inputs (A, B) must be True (1) or False (0).

The gate produces a single Output (Q).

AND: Q=1 only if both A and B are 1.

OR: Q=1 if either A or B (or both) is 1.

XOR: Q=1 if A or B is 1, but NOT both.

Challenge: Match the Target Output.
A B Current (Q) Target (Q)

Reinforcement Learning (Q-Learning)

Reinforcement Learning involves an agent learning to make decisions by performing actions and receiving rewards or penalties. Watch the agent explore the grid (randomly at first) and learn the safest path to the Goal (Green) while avoiding Pits (Red).

Hyperparameters

Episode: 0
Last Reward: 0
Goal (+10) Pit (-10) Agent

Status: Ready to Learn