Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Oracle · OCI AI Foundations

Machine learning basics

OCI AI Foundations · Lesson 2 of 16 · 9:01

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Oracle Cloud Infrastructure AI Foundations Associate exam (1Z0-1122-26). In this lesson: how machine learning works (features, labels, training, and inference), supervised learning, regression with a line fitted by reducing the loss, and classification with logistic regression, the sigmoid, and a threshold. Includes three original practice questions, with Willowmere Motors, a fictional network of car dealerships and repair shops, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Two prediction problems

Willowmere's used car team prices every trade-in by hand, and two experts can disagree by a thousand dollars. The team wants a model that predicts the price from the car's age, mileage, and condition, and the finance team wants another one that predicts whether a loan application will be approved. Both are machine learning problems, and both are supervised.

How machine learning works

Machine learning lets a computer learn from examples, and make predictions on data that it has never seen, without being programmed with explicit rules. Each example is described by features, the inputs, like a car's age, mileage, and condition. When the example also comes with the answer, like the price that the car actually sold for, that answer is the label, the output. Training is the process where the model learns the relationship between the features and the labels. And inference is when the trained model receives a new example, and predicts its output.

Supervised learning

Supervised learning learns from labeled data: every training example comes with the right answer, like a teacher who corrects the homework. The model compares its predictions with the labels, and adjusts itself to make fewer mistakes. What the label looks like decides the type of task. When the output is a continuous number, like a price or a temperature, the task is regression. When the output is a category, like approved or declined, the task is classification.

Regression

Linear regression fits a straight line through the data, written f of x equals w x plus b, where w is the weight, or slope, and b is the bias. For each training example, the error is the gap between the predicted value and the real one. A loss function turns all these errors into one number, a penalty for bad predictions, like the squared loss, which squares each error. Training adjusts w and b, again and again, to make the loss as small as possible. Once trained, the model takes a new car, and reads its predicted price on the line.

Classification

Classification predicts a category. Binary classification has two classes, like spam or not spam, or a loan approved or declined, and multi-class classification has more, like a review that is positive, negative, or neutral. Logistic regression is a classic method for it: it passes a score through the sigmoid function, an S-shaped curve that turns any number into a probability between zero and one. Then a threshold, often 0.5, turns that probability into a class: above it, approved, and below it, declined. The course demo uses the well known Iris data set: one hundred fifty flowers, four measurements each, and three species to predict.

Recap

Let's recap. Machine learning learns from examples: features are the inputs, labels are the answers, training learns the relationship, and inference predicts on new data. Supervised learning uses labeled data. Regression predicts a continuous number: linear regression fits a line, and training reduces the loss. Classification predicts a category, binary or multi-class: logistic regression uses the sigmoid and a threshold. Next, learning without labels, and learning from rewards.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Willowmere wants to predict how many hours a repair will take, from the car model and the type of damage, using thousands of past repairs. Which type of task is this?

    • Classification
    • Clustering
    • Regression
    • Reinforcement learning
    Show the answer

    Regression

    The output is a continuous number, a number of hours, so the task is regression. “Classification” would fit if the output were a category, like quick or long repair. “Clustering” would group repairs without any labels, but here every past repair has its real duration. And “Reinforcement learning” learns actions from rewards, with no labeled examples at all.

  2. During training, Willowmere’s price model predicts $12,000 for a car that actually sold for $15,000. What does training do with this gap?

    • Adds it to the loss, then adjusts the weights
    • Uses the sale price as a new feature
    • Turns the task into classification
    • Keeps it for inference, when it learns
    Show the answer

    Adds it to the loss, then adjusts the weights

    The gap is an error that adds to the loss, and training adjusts the weight and the bias to make the loss smaller. “Uses the sale price as a new feature” is wrong, because the sale price is the label, not a feature. “Turns the task into classification” is wrong too, because the output is still a number, so the task stays regression. And “Keeps it for inference, when it learns” comes too late: inference uses the trained model, and learns nothing from its errors.

  3. Willowmere sorts every incoming service email into one of three groups: booking, complaint, or question, and has thousands of emails that staff already sorted. Which type of task is this?

    • Binary classification
    • Regression
    • Clustering
    • Multi-class classification
    Show the answer

    Multi-class classification

    Each email gets one of three known categories, learned from labeled examples, so it's multi-class classification. “Binary classification” has only two classes, and here there are three. “Regression” would predict a number, not a category. And “Clustering” would find groups without labels, while these emails are already sorted into known groups.