Homework 2 · Part 2

From One Pixel to Your Classifier

80 points · up to 10 bonus points

You do not need to know how to code for this assignment. You are not expected to type a single line of HTML or JavaScript. Codex will write the code.

Your job is to decide what you want to make, describe it clearly, open the result, try it, notice what happens, and ask for changes. These are important skills for working with AI—and for doing experiments in machine learning.

explore→choose→direct→test→explain

We will begin together during lab. By the end of the session, everyone should have a project folder, a first Git save point, an idea, and an imperfect first webpage. Imperfect is expected.

Stop 1

Explore One Pixel ML

15 points

Open the provided one-pixel.html file in a browser.

The lab contains twelve grayscale pixels. The brightness values are already there, but the labels come from you. Your labels tell the classifier what task to learn.

Try at least three labeling patterns. You may use the three Guided Stops in the page.

For each pattern, answer briefly:

  1. What rule did you use to label the pixels?
  2. What boundary did you expect?
  3. What happened?

One or two sentences per pattern is enough. Include a screenshot of the pattern you found most interesting.

Big ideaThe same data can become different learning problems when we change the labels.

Stop 2

Make a safe starting point

10 points

We will do this together in lab.

Create a new project folder and open it in VS Code. Put these two files inside:

README.mdone-pixel.html

Initialize a Git repository and make one commit with the original files. You may ask Codex to do each step.

A commit is simply a named save point for your project. You do not need to memorize the commands. Check that the files appear in the Source Control view and that the commit was created.

A good first commit message is Add starter One Pixel lab.

Create a GitHub repository and push your project. It may be private.

GitHub repository link:

Stop 3

Choose one tiny classifier

10 points

Invent a classification problem that is only a little more complicated than One Pixel ML.

Your idea can be playful. For example, you might classify colors, simple symbols, imaginary creatures, arrangements of lights, shapes, or recommendations based on two choices. Avoid medical, legal, financial, or other high-stakes decisions.

Complete these five sentences before asking Codex to build:

  1. My page will classify
  2. The possible labels are
  3. The classifier will look at
  4. One example it can learn from is
  5. A visitor should understand that

Keep the idea small. Two or three understandable inputs are often more interesting than twenty mysterious ones.

Big ideaBefore building a model, decide what its inputs, examples, and labels mean.

Stop 4

Direct Codex

25 points

Now ask Codex to create your page. Codex may write every line of code.

You can begin by adapting this prompt:

I am a beginner and I do not write code yet.

Help me create one self-contained HTML page for a tiny classifier.

My classification idea:
My inputs:
My labels:
A few examples:
What I want a visitor to try:
What I want the page to teach:

Please keep it simple and playful. Do not use API keys, paid services, or a build step. Tell me how to open and test it.

Your finished page should:

  • Open in a browser
  • Let a visitor change or choose an input
  • Show a prediction or classification
  • Use some examples, labels, scores, distances, or learned weights
  • Reveal at least one reason for its prediction

The last item matters most. A visitor should see some evidence—not only an answer.

You do not need to understand every line of generated code. You should be able to point out, in ordinary language:

  • What goes into the classifier
  • What comes out
  • What evidence changes the result

Work in short rounds

Do not try to write the perfect prompt. Ask for a small first version, open it, and respond to what you see.

Keep a short development log in your README. Record at least three moments when you directed the work. For example:

  • I asked for a first version with two inputs.
  • The result was hard to understand, so I asked to show the scores.
  • I found a strange prediction and asked Codex to explain it.
  • I asked a classmate to try it and simplified the instructions.
Big ideaVibe coding is a conversation with a working artifact. Your observations make the next prompt better.

Stop 5

Test like an experimenter

15 points

Try your classifier rather than only looking at it.

Test at least three cases:

  1. An easy case: a result you expect the classifier to get right.
  2. A close case: an input near the boundary between two labels.
  3. A strange case: something unusual that may expose a weakness.

For each case, record the input, the prediction, and one sentence about what you noticed.

Show the page to one classmate. Do not explain it first. Ask them:

  • What do you think you can change?
  • What do you think the classifier is doing?
  • What is confusing?

Make at least one improvement after testing. It can be small: clearer words, a better example, a useful score, a reset button, or a more visible explanation.

Ask Codex to make at least two more Git commits at meaningful checkpoints. You do not need to write Git commands yourself, but check that the commits appear.

Big ideaA working page is not necessarily a clear explanation. Testing helps you see the difference.

Stop 6

Tell the story and submit

5 points

Ask Codex to help organize your README. It should include:

  • The name and purpose of your classifier
  • How to open and use the page
  • A plain-language explanation of how it makes a prediction
  • One limitation you discovered
  • Your short development log

Then write this final reflection yourself, without AI-assisted writing:

In 2–4 sentences, what choice or correction did you make that improved the project? What did you learn about classification or about directing an AI coding agent?

Submit in Canvas

  1. This document with your answers
  2. A screenshot of your finished classifier
  3. Your GitHub repository link
  4. Your complete project as a ZIP file

Your ZIP file should include at least:

README.mdone-pixel.htmlyour-new-lab.html

Do not include passwords, API keys, or other private information.

Optional

Bonus

10 points

Add something that makes the learning experience clearer—not merely more complicated. Possibilities include comparing two classifiers, showing a useful failure case, adding an especially clear visualization, or making the page work particularly well on a phone or with a keyboard.

Tomorrow in lab

What we will do together

  1. Explore One Pixel ML.
  2. Look at a few instructor examples for inspiration.
  3. Create the project folder and first Git save point.
  4. Write the five-sentence idea.
  5. Send the first Codex prompt.
  6. Open and test the first version.
  7. Make one more save point before leaving.
Before you leave: show your page to a neighbor. Write down one thing they understood immediately and one thing they found confusing.