2BEAI FUNDAMENTALS

Preview of Module 5 · How Machines Learn

Looking for Teach the Sorter?

Train a small classifier from examples, then test what it learned. This Module 5 preview is optional in the Data unit.

Teach the Sorter →

Module 2 · Audit Console · Extension lab

Change one assumption.
Watch the data change.

PYTHON
Runs in your browser

You review a training dataset for a fictional staffing company. Before approving it, test how its design shapes who gets hired.

Invented applicants and hiring decisions. This small experiment is separate from the six-person admissions ranking and the original seven-column Data Audit dataset.

Extension lab, for students who want more: This experiment is not required. Its work saves separately from the Data unit record. Download the Console evidence JSON and paired CSV below and upload them separately from your unit PDF.

City areas A–D: fictional areas of a city or region where applicants live; not where data is stored. The letters do not tell us their skills, reliability, or distance from the workplace.

A hiring reviewer compares applicant files. Three fictional people become three recorded rows, then a chart showing two hired and one not hired. Skills, caregiving and transport remain outside this small record.
View full-size infographic ↗Illustrative teaching example. These are not your lab results.

In the graphic, “Group” means the city area where an applicant lives. Python creates invented hiring outcomes from the stated probabilities; it does not evaluate applicant qualifications.

Read the graphic

A dataset is an organized set of records. Each row represents one applicant; each column records one detail. This small example has three fields: ID, Group, and Hired. A 1 means hired; a 0 means not hired.

The infographic’s three example records
IDGroupHired
01A1
02D0
03B1

The chart counts two hired and one not hired. It summarizes the recorded outcomes; it does not explain why those decisions happened. Skills, experience, caregiving, and transport are not columns in this example.

Why use a dataset? It lets us organize many records, count outcomes, and compare groups. Before acting, a human reviewer must investigate what was recorded, what was omitted, and whether the evidence fits the decision.

  1. Predict
  2. Run Python
  3. Change one setting
  4. Compare & explain

The setup

The rule comes before the rows.

The generator creates 1,000 invented applicants who live in four fictional city areas: A, B, C, and D. Each area gets a starting chance of being hired. These chances are assumptions we put into the program, not findings about real neighborhoods.

Area A55%starting chance
Area B50%starting chance
Area C45%starting chance
Area D22%starting chance

Probability is the setting. Selection rate is the result: hired applicants ÷ all applicants in that cluster. A generated result need not equal its starting probability exactly.

Same people. One changed rule.Like testing two recipes with the same ingredients: change one thing so you can investigate its effect.

First run

01Area A02Area D03Area D

D’s starting chance 22%

Comparison run

01Area A02Area D03Area D

D’s starting chance You choose

Keep: the same 1,000 fictional applicants, groups, and computer-generated chance numbers.
Change: only City area D’s starting chance of a hire.

Three example cards illustrate the setup; they are not actual rows from your run. If we also changed the random numbers, we could not isolate the effect of the new setting.

See the experiment as an infographicFour steps: predict and lock, run Python, change only D and predict again, then run and compare. Two example settings charts keep A at 55%, B at 50% and C at 45%, while D changes from 22% to an illustrative 50%. These are probability settings, not observed hiring rates.

An example of the process, not your results. You choose D’s new setting below. Your actual result charts appear only after Python runs.

1 · Commit before results

Make your prediction.

0 characters · 40 minimum

A prediction is a commitment, not a graded answer. You can continue even if the result surprises you.

Your predictions and evidence are saved in this browser.

Your lab support

City areas A–D: fictional areas where applicants live. “Cluster” is the technical word for a group; here the groups are city areas. These labels do not describe qualifications or distance to work.

Probability: the generator’s starting chance of a hire.

Selection rate: hired ÷ applicants in the group, expressed as a percentage.

Percentage-point difference: one percentage minus another. Moving from 20% to 30% is +10 percentage points.

A fair comparison: keep the sample and chance numbers the same, then change one setting.

The computer term, if you are curious

A seed is a starting value that lets the program recreate the same sequence of random numbers. This lab uses 42 in both runs. You do not need to choose or memorize it.

Evidence limit: a city-area gap in these invented rows does not prove discrimination or a cause in a real hiring process.

Open textbook · inventory and provenance