Lesson 1 of 5

Step 1: Define the training data

15 pts

Explanation

Every ML project starts with data. You will build a classifier that tells apples apart from oranges using two features: weight in grams, and a texture score from 0 (very smooth) to 10 (very bumpy). Below is a small labeled dataset — each entry already has the correct label, exactly like the labeled examples from earlier modules.

Visual explanation

Read this from left to right: what goes in, what happens, and what comes out.

Choose examples
Pick features + label
Training dataset

Your project begins by turning a real item into clear input features and a label.

In plain language

First define what each training example contains and what answer the classifier should predict.

Remember

A clear problem definition makes every later step easier.

What to do

Run the starter code as-is to see the training set printed, then add one more labeled fruit of your own to the trainingData array and run it again.

Validation questionDoes your trainingData array include a "label" field of either "apple" or "orange" for every entry?

Code Lab

JavaScript

Run the code, then add one more fruit object to trainingData and run again.

Console

Click Run to execute your code and see console output here.