← Back to Perceptron Lab
Work through the problems yourself
Botie's workshop
How would you turn the information in a problem into an answer? Choose a workshop and build the calculation with Botie. Follow the values through the pieces you connect, then find out whether your construction still works when the data changes.
The explanation and coding exercises are there whenever you need them. Every workshop is open, so you can return to an earlier idea or investigate a new one.
The labels below record what you have tried and tested. Changing a construction keeps those earlier results in your history.
Getting started
Introductory Mathematics
- What do the weekly records tell us?Statistics & Probability Primer
- One price list, a whole page of purchasesLinear Algebra Primer
- How fast was the traveller moving?Calculus Primer
- Update the two possible causes of an alarmWhat Does an Alarm Tell Us?
- Compare possible germination rulesWhich Rule Could Have Produced These Observations?
Python and NumPy
- Convert the greenhouse thermometersGiving Measurements a Place
- Keep each greenhouse's averageWhich Direction Are We Adding?
- Prepare the greenhouse target sheetPreparing the Arrays We Need
- Retrieve the requested morningsChoose the Readings Without Losing Their Place
- Recover the greenhouse columns from a logger streamPut the Same Readings Into the Right Arrangement
- Compare greenhouse readings with their targetsOne Reference for Many Rows
- Find the greenhouse alertsAsk Each Row a Question
- Order the inspection report without losing its namesSummarise a Report Without Losing the Question
- Inspect every error before summarising the reportOne Calculation for a Whole Report
- Apply a rule to the greenhouse feature tableTurn Several Measurements Into Several Predictions
- Check the largest recovery errorWhen Two Calculations Almost Agree
- Replay a recorded greenhouse sampleCan We Repeat the Same Experiment?
- Reuse the training reference on another reportGive a Reusable Calculation a Clear Contract
- Recompute scores from a restored reportKeep Enough of a Calculation to Run It Again
SQL
- Keep four assets distinctWhat Does One Row Actually Describe?
- List equipment categories by siteWhich Columns Answer the Question?
- Find visits that satisfy both requirementsWhich Inspection Records Need Our Attention?
- Choose a repeatable shortlistWhich Two Visits Took the Longest?
- Keep missing duration separate from zeroWas the Visit Instant, or Is Its Duration Missing?
- Label the reading without replacing itWhat Should Botie Label Each Reading?
- Total recorded time for loose findingsHow Much Inspection Time Did We Actually Record?
- Place each duration with its assetHow Much Work Belongs to Each Asset?
- Count repeated loose findingsWhich Assets Keep Returning with the Same Finding?
- Locate each active asset’s inspection visitsWhich Site Does Each Inspection Belong To?
- Keep assets with no loose findingsWhich Assets Have No Matching Inspection?
- Count each event stream before combining itWhy Did Joining Readings Double the Inspection Total?
- Let the inspection records supply their own benchmarkWhich Inspections Took Longer Than the Usual Visit?
- Keep pumps awaiting a completed visitWhich Pumps Still Have No Completed Visit?
- Combine reports into unfinished assignmentsWhich Pumps Appear on Either List but Are Still Unfinished?
- Keep open estimates out of completed totalsCan We Read the Query in the Order We Explain the Job?
- Trace the bounded supply networkHow Far Does the Failed Supply Line Reach?
- Keep the latest complete record for each pumpKeep Every Reading While Looking at Its Neighbours
- Move a frame through each pump’s readingsWhich Readings Belong in This Rolling Total?
- Restore the missing days to Botie’s reportWhere Did the Quiet Day Go?
- Search the prefix that the technician actually typedWhy Did a Pump Search Return the Wrong Equipment?
- Extract measurements without guessing their typeIs That Temperature a Number or Just Text?
- Reconstruct Botie’s historical decision inputsWhat Could the Model Have Known at That Moment?
- Inspect equipment fields before accepting a recordWhat Does One Equipment Record Promise?
- Reject impossible maintenance jobsCan a Job Refer to a Pump We Have Never Recorded?
- Find conflicting current-site copiesWhy Must a Pump Move Be Edited on Every Job?
- Close one job without changing its neighboursChange the Requested Jobs Without Rewriting the Rest
- Publish both sides of a stock transferMove Spare Parts Without Losing Half the Transfer
- Keep a stale edit from replacing a newer jobWhat If Someone Changes the Job While Botie Is Reading It?
- Find the asset region in a composite orderingFind One Pump’s Readings Without Checking Every Pump
- Compare measured work only for matching answersWhy Does a Short Query Repeat So Much Work?
- Match a search inside the trusted tenant scopeLet a Search Value Stay a Value
- Find readings that need repair before feature buildingWhich Sensor Records Should Reach the Training Table?
- Checkpoint a versioned maintenance-reading batchPick Up New Changes Without Losing Late Readings
NoSQL
- Keep every inspection for a pumpWhich Records Does the Technician Need Together?
- Give the lookup its complete identityWhich P1 Did the Lookup Mean?
- Check the deadline before returning the copyHow Long Should Botie Trust the Saved Reading?
- Inspect the field inside the sensorCan One Record Describe the Pump and Its Sensor?
- Resolve a shared contact for this pumpShould Every Pump Keep a Copy of the Supplier’s Phone Number?
- Find high temperatures without borrowing another sensor’s valueDid the High Value Belong to the Temperature Sensor?
- Apply a narrow edit to the reviewed versionCan Botie Save a Change Without Erasing Somebody Else’s?
- Retain the threshold after narrowing by siteCan We Find North’s Hot Pumps Without Reading Every Document?
- Total the urgent visits, not every visit on their pumpsHow Much Urgent Work Was Hidden Inside the Pump Documents?
- Find the maintenance key that concentrates trafficWhy Is One Storage Key Doing All the Work?
- Read the observations around P7’s faultKeep One Asset’s History Together Without Growing Forever
- Preserve the technician’s observed repair revisionWhy Did the Repair Disappear When Botie Read It Back?
- Reserve maintenance kits without accepting a stale decisionTwo Technicians Cannot Both Reserve the Last Kit
- Merge the disconnected teams’ inspection contributionsHow Can Two Offline Teams Keep Both Inspection Counts?
- Repair the maintenance dashboard from current job imagesWhy Does the Dashboard Still Count a Job That Was Closed?
- Read the two sensor formats through a declared adapterThe New Sensor Sends a Different Document
- Restore stock to a supported point before the bad importThe Bad Update Reached Every Replica. What Can We Restore?
- Hand the model a compatible, timely feature vectorA Fast Feature Lookup Still Has to Mean the Right Thing
Graph Databases
- Follow the dependency in the requested directionWhich Equipment Depends on This Supply?
- Detect repeated source-qualified keysAre These Two Pumps Actually the Same Pump?
- Follow the bound inspection to its technicianWho Inspected This Pump?
- Count completed inspection identitiesHow Many Inspections Were Actually Completed?
- Preserve assets with no qualifying inspectionKeep the Pumps That Have No Completed Inspection
- Traverse the dependency cycle within a stated depthFollow a Dependency Without Following It Forever
- Choose the route by travel timeThe Route with Fewer Stops Takes Longer
- Audit identity before installing the constraintWhich Rules Must Every Asset Write Preserve?
- Check approval against the graph snapshotThe Graph Changed While the Approval Was Waiting
- Stage new resolvable relationshipsA Replayed Import Must Not Create Another Relationship
- Compare two explicit candidate-access strategiesWhy Did One More Hop Make the Query So Expensive?
- Resolve resource dependencies from RDF recordsCan Two Teams Describe the Same Resource?
- Select the evidence available for this decisionWhere Did This Maintenance Claim Come From?
- Collect evidence through permitted routesWhich Connected Records Can the Assistant Use?
Start with a Prediction
Data Preparation
- Audit repeated greenhouse eventsWhat Does One Row Represent?
- Fill a greenhouse report from its training referenceWhen a Measurement Is Missing
- Move the zero pointCentring on the Mean
- Give the ruler a useful unitThe Standard Score
- Make the two rulers agreeFeature Scaling
- Measure the missing featurePolynomial Features
- Describe the cloud along its main directionPrincipal Component Analysis
- Represent the greenhouse roof materialsCategories Without an Invented Ranking
- Give the greenhouse clock two coordinatesWhen the End Is Beside the Beginning
- Reconstruct the prediction-time reportWhat Could We Know at Prediction Time?
- Keep the rare sensor failures visibleWhen the Important Class Is Rare
Classical Machine Learning
- Compare people on a common scaleWhat Near Means
- When does warmer help the process?Multiple & Polynomial Regression
- Take a useful step downhillFitting by Walking
- Which coefficient can disappear?Ridge & Lasso
- Ask a few neighboursk-Nearest Neighbours
- Classify a specimen with two questionsDecision Trees
- Which digit do the scores support?More Than Two Classes
- Combine the sensor's cluesNaive Bayes
- Measure the boundary's margin violationsSupport Vector Machines and Margins
- Let the estimators share the loadBagging
- Grow trees with different viewsRandom Forests
- Repair what the first model missedGradient Boosting
- Recalculate the group centresk-Means Clustering
- Find the nearest bridge between groupsHierarchical Clustering
- Find the points that can grow a groupDensity-Based Clustering
- Separate the inner and outer groupsThe Kernel Trick
- Keep the kernel coefficients in checkKernel Ridge Regression
- Centre the comparisonsKernel Principal Components
- Predict the next letter's categoryMarkov Chains
- Put the tray image on a known scaleImages as Arrays
- Select the bright seed pixelsImage Thresholding
- Remove the tray's isolated speckCleaning Masks With Morphology
- Count connected seed regionsConnected Components
- Find where the light changesFilters and Edges
- Locate the reference patternTemplate Matching
- Count edges instead of brightnessHistogram of Oriented Gradients
- Is the closest match convincing?Keypoints and Descriptors
- Put the camera views togetherImage Alignment
- Give a window two checks to passHaar Cascades
Choosing and Checking a Model
- Measure the greenhouse baselineWhat Must a Model Improve On?
- Compare the two greenhouse error curvesWould More Examples Help?
- Audit the held-out greenhousesHave We Really Held Out a New Example?
- Keep preparation tied to the training dataPipelines
- Choose a setting without peekingSearching for a Setting
- Does the model depend on height?Which Feature Mattered
- Turn failure probabilities into inspection decisionsWhen Should a Probability Become an Action?
- Audit one group of failure probabilitiesDoes Eighty Percent Mean Eighty Percent?
- Compare the greenhouse population mixWhat Changed After the Model Was Fitted?
- Recalculate a resampled greenhouse meanHow Much Does Our Estimate Depend on This Sample?
Evaluating and Improving Models
- Diagnose Botie’s temperature predictionsWhat Are the Errors Trying to Tell Us?
- Make the inspection queue measurableWhich Alerts Deserve an Inspection?
- Give every shift its own error reportBetter for Which Cases?
- Keep repairs and regressions in the same reportDid the Revision Help on the Same Cases?
- Separate choosing from checkingWho Checks the Model-Choosing Process?
- Flag the records Botie needs to inspectIs the Model Wrong, or Is the Record Wrong?
- Route uncertain inspections without losing themWhen Should the Model Ask for Help?
- Keep an adapter bug out of the next releaseShould This Change the Prediction?
- Decide whether the greenhouse revision can enter a trialRepair the Night-Shift Model Without Breaking the Day Shift
Probabilistic Models and Uncertainty
- Average over possible damagePlanning for More Than One Possible Outcome
- Update a failure probabilityUpdating an Unknown Failure Rate
- Combine thermometer readingsCombining Measurements With Different Reliability
- Update the hidden pump conditionTracking a State We Cannot Observe Directly
- Predict a residual temperaturePredicting Between Measurements With Uncertainty
Neural Networks
- Build a light-pattern detectorA Neuron
- Give two neurons different jobsA Dense Layer and the Forward Pass
- Keep each picture togetherThe Shape Guarantee
- Measure the prediction errorsLoss Functions
- Follow the effect backwardsBackpropagation
- Teach the weight from one mistakeTraining a Small Network
- Keep the average signal steadyDropout
- Normalise within each exampleNormalisation Layers
- Repair a noisy memoryHopfield Networks
- Pass a pattern through hidden unitsRestricted Boltzmann Machines
- Move a prototype towards an observationSelf-Organising Maps
- Stop a useful weight growing foreverHebbian Principal Components
- Carry something into the next stepRecurrent Layers
- Build a detector with a neighbourhoodRadial Basis Networks
- Let the layer make a correctionResidual Connections
Optimisation and Training
- Update a weight from a batchLearning From a Few Records at a Time
- Carry an update direction forwardRemembering the Direction of Earlier Updates
- Scale a corrected Adam directionGiving Different Weights Different Step Scales
- Check a local derivativeChecking a Model Before a Long Training Run
- Select the saved checkpointDeciding When a Training Run Has Done Enough
Computer Vision with Neural Networks
- Use the same detector everywhereConvolution
- Keep the strongest local signalPooling
- Assemble the picture inspectorConvolutional Networks
- Bring the missing detail backU-Net
- Give the picture a small addressA Vector for a Picture
- Make a useful difference countLearning the Metric Itself
- Find the matching pictureSearching a Collection of Pictures
- Reflect a labelled seed imageImage Augmentation
- Apply a new head to fixed leaf featuresTransfer Learning
- Measure the overlap of two seed rectanglesBounding Boxes and Overlap
- Keep distinct seed detectionsNon-Maximum Suppression
Natural Language Processing
- Give Botie a vocabularyWhat a Token Is
- Count what actually goes on the wireBytes and Characters
- What happens to two spaces?Splitting on Spaces
- Notice the punctuation in another scriptUnicode Word Boundaries
- Keep the contraction convention straightPenn Treebank Rules
- Separate the punctuation before translationMoses Rules
- Keep the word, number and punctuation apartThe Pattern Language Models Use
- Try the longest piece firstMaximum Matching
- Find the cheaper complete routeThe Word Lattice
- Recover the boundaries behind the charactersSegmenting With a Hidden Model
- Turn boundary probabilities into piecesLearning Boundaries From Examples
- Let Botie see adjacent pairsN-Grams
- Apply the merge the vocabulary learnedByte Pair Encoding
- Use a continuation pieceWordPiece
- Compare complete subword pathsThe Unigram Language Model
- Make the space visibleSentencePiece
- Choose the piece that covers more new groundGreedy Coverage
- Keep the IDs and embeddings togetherMoving a Vocabulary
- Look for reusable word partsMorfessor
- Turn an analysis into a surface wordFinite-State Morphology
- Fit characters into a small tableHashing Characters
- Group the bytes before processingPatching Without a Vocabulary
- Pick the nearest stored prototypeCodebook Quantisation
- Snap each coordinate to a levelFinite Scalar Quantisation
- Give the word more than an addressA Vector for a Word
- Compare direction without rewarding lengthDistance and Similarity
- Compress a table of word useLatent Semantic Analysis
- Ask whether the pair is surprisingPointwise Mutual Information
- Accumulate the context cluesRandom Indexing
- Retrieve and combine the word vectorsThe Embedding Layer
- Learn from the nearby wordsWord2vec
- Build a word from shared fragmentsFastText
- Fit the log of a co-occurrence countGloVe
- Tell two identical tokens apartPositional Encoding
- Let the query choose what contributesAttention
- Keep the padding out of the summaryPooling a Text
- Give a document its own memoryParagraph Vectors
Large Language Models
Generative Models
Adapting and Evaluating Modern Models
Time Series and Forecasting
- Measure the persistence forecast's errorsWhat Would We Predict Before Fitting Anything?
- Build a trailing-mean forecastBuilding Inputs From Earlier Days
- Measure change across matching cycle positionsSeparating Repetition From Change
- Update Botie's demand estimateUpdating a Forecast Without Starting Over
- Apply fitted lag contributionsLearning From a Series' Own Past
- Compare two forecasts on the same daysTesting a Forecast as Time Moves Forward
Reinforcement Learning
- Learn what an action was worthReinforcement Learning
- Update the tried schedule's estimated rewardTrying an Action Before Knowing Its Value
- Compare the states each action may lead toDescribing What an Action Changes
- Combine the rewards from one episodeValuing Rewards That Arrive Later
- Compare immediate rewards and future statesPlanning One Step, Then the Remaining Journey
- Correct a visited action's valueLearning Action Values From Experience
Recommendations and Ranking
- Rank the guide shelfRecommending Something Before Knowing the Reader
- Match topic directionsMatching a Reader’s Interests to Guide Descriptions
- Predict a reader’s ratingLearning From Readers With Similar Preferences
- Score all candidate guidesCompressing a Sparse Table of Preferences
- Measure usefulness in the visible listChecking the List a Reader Actually Sees
Anomaly Detection
- Score new pressure readingsFinding Unusual Readings Without Letting Them Set the Reference
- Compare a point with its local surroundingsJudging a Reading Against Its Neighbours
- Score isolation pathsFinding Readings That Are Easy to Separate
- Decide which reconstructed records need reviewDetecting Patterns a Model Cannot Reconstruct
Graphs and Relational Learning
- Count the network’s connectionsRecording Which Things Are Connected
- Advance a probability distributionFollowing Probability Through a Network
- Read neighbouring pumpsLetting a Node Read Its Neighbours’ Measurements
- Pass measurements through one graph layerLearning From a Node and Its Neighbours Together
- Score a possible connectionScoring Connections We Have Not Observed
Causal Inference and Experiments
- Compare the observed group mixturesSeparating a Useful Prediction From a Causal Claim
- Compare randomly assigned groupsMaking a Fair Comparison by Assignment
- Standardise the schedule comparisonComparing Treatments in the Same Population
- Calculate an inverse-probability contrastReweighting Records Without Inventing Missing Evidence
Deploying and Maintaining Models
- Reproduce the saved predictorSaving the Whole Prediction Procedure
- Validate an incoming numerical batchChecking What Arrives at the Model
- Predict a batch in orderKeeping a Prediction Consistent Across Requests
- Compare a candidate with the current versionKnowing Which Model Produced an Answer
- Measure the error we can now observeChecking the Model After It Meets New Data
Agents
- Give Botie a next step it can justifyWhat Makes This an Agent?
- Give the maintenance request a clear structureHow Do We Give an Agent a Job It Can Follow?
- Separate the record check from the asset lookupCan Another Program Use Botie’s Answer?
- Decide whether the inspection may proceedWhen May Botie Turn a Suggestion into an Action?
- Choose the excerpts Botie can actually useWhich Records Should Botie Bring into the Conversation?
- Control the next step of the maintenance assistantWhat Should Botie Do After a Tool Replies?
- Choose how much control Botie needsDoes Botie Need to Choose the Next Step?
- Keep invented citations out of Botie’s answerGive Botie a Typed Job with Pydantic AI
- Stop Botie’s repeated manual lookupPut Limits Around a LangChain Agent
- Restore the request before merging the manual updateResume Botie’s Work with LangGraph
- Keep approval attached to the reviewed inspectionAsk Before Botie Creates the Inspection Job
- Route the lookup to the intended manual serviceConnect Botie to Tools with MCP
- Keep the manual from granting new toolsWhat If the Manual Starts Giving Botie Orders?
- Check the caller against the stored assetWhose Pump Is Botie Allowed to Inspect?
- Send only the maintenance lookup fieldsHow Much of the Maintenance Record Does Botie Need?
- Keep the draft tied to the requested pumpCan We Safely Use the Answer Botie Returned?
- Recover the inspection request without duplicating itDid Botie Create the Inspection, or Did the Reply Get Lost?
- Reserve the next maintenance lookupsCan Two of Botie’s Calls Spend the Same Remaining Budget?
Prompting, Evaluation and Iteration
- Choose the demonstrations Botie will seeWhich Examples Should We Put in the Prompt?
- Follow the technician’s requestWhy Did Botie Take So Long?
- Keep the missing evaluations visibleCan We Find the Run Behind This Score?
- Test what Botie did, not only what he saidWhat Would Count as Doing the Job?
- Find the call that reached the wrong pumpWhat Can We Test Without Calling a Model?
- Give disputed answers a place to goWho Checks the Model That Checks Botie?
- Give each failure somewhere useful to goWhere Did the Answer First Go Wrong?
- Make the prompt experiment answer one questionDid the New Examples Cause the Improvement?
- Decide whether the next shift can use this versionIs This Version Ready for the Next Shift?
- Count the attack attempts without losing ordinary workCan We Make Botie Cross the Boundary?
- Pause the release and account for its unfinished workWhat Happens When the New Shift Finds a Failure?
- Carry the repaired agent into a fresh shiftRepair Botie’s Maintenance Assistant
Agent Guardrails and Secure Development
- Put a control before each effectWhat Should Botie Be Unable to Do?
- Keep the repair inside its reviewed scopeCan Botie Fix the Bug Without Rewriting the Rules?
- Audit the parser test environmentWhere Should Botie Run Code He Has Just Written?
- Keep release evidence attached to its buildAre We Releasing the Code We Actually Checked?
- Keep an MCP capability attached to its reviewWhat Did We Actually Trust When We Connected the MCP Server?
- Keep a credential at its intended serviceA Valid Token for Which Service?
- Keep approval attached to the actual writeWhat Exactly Did the Person Approve?
- Prepare only the context this child may useWhat Should Botie Pass to Another Agent?
- Decide whether the repaired agent can enter a canaryCan the Repaired Agent Survive a Different Shift?
Complete Projects
Define the ML Problem
Model the System Before Building It
- Find the image service bottleneckWhere Does the Prediction Pipeline Run Out of Room?
- Find the worst queue during the upload burstWhat Happens When Requests Arrive Together?
- Budget the inspection device memoryWill the Model Fit on the Device?
- Compare local and remote inspection timeShould the Prediction Happen Here or on a Server?