No history yet

Introduction to Machine Learning

Teaching Computers to Learn

Machine learning is a way of teaching computers to find patterns in data. Instead of writing explicit instructions for every possible scenario, we let the computer learn from examples. The goal is to build a model that can make predictions or decisions about new, unseen data.

One of the most common types of machine learning is called supervised learning. The “supervision” comes from using labeled data. Think of it like teaching a child to identify fruits. You show them a picture of an apple and say “apple.” You show them a banana and say “banana.” After enough examples, the child learns to identify fruits they've never seen before. In supervised learning, the data we provide has both the input (the picture of the fruit) and the correct output, or label (its name).

Model

noun

In machine learning, a model is the output of a training process. It's a system that has learned to recognize certain types of patterns from data and can make predictions on new data.

The model learns the relationship between the inputs, often called features, and the output label. In healthcare, features might be a patient's age, blood pressure, and cholesterol levels. The label could be whether the patient has heart disease. The trained model can then take the features of a new patient and predict the likelihood of heart disease.

Lesson image

Three Common Approaches

There are many different supervised learning algorithms, each with its own strengths. Let's look at three fundamental methods: linear regression, decision trees, and support vector machines.

Linear regression is used for predicting continuous values, like a price or a temperature. Decision trees and support vector machines are often used for classification, which means assigning an item to a category, like 'spam' or 'not spam'.

Linear Regression

This algorithm tries to find the best straight line that describes the relationship between an input and an output. Imagine you have data on house sizes and their sale prices. Linear regression would draw a line through those data points that best predicts the price of a house based on its size. The model learns the equation of this line.

y=mx+by = mx + b

Here, yy is the value we want to predict (price), xx is our input feature (size), and the model learns the best values for the slope mm and the intercept bb to make the most accurate predictions.

Decision Trees

A decision tree makes predictions by asking a series of questions about the data. It's like a flowchart, where each node represents a question, and each branch represents an answer. Following a path from the top (the root) down to a leaf node gives you the final prediction.

Lesson image

For example, to decide if a patient is at high risk for diabetes, a decision tree might first ask, "Is their blood sugar level above 125?" If yes, it might then ask, "Is their BMI over 30?" Each question splits the data into smaller, more uniform groups until a conclusion is reached.

Support Vector Machines (SVMs)

Support Vector Machines are powerful for classification tasks. Imagine plotting your data points on a graph, with each category represented by a different symbol. An SVM finds the best possible line, or hyperplane, that separates the categories. It doesn't just draw any line; it finds the one that creates the widest possible margin between the two groups.

Lesson image

This wide margin makes the model more robust. When it encounters new data, it's more likely to classify it correctly because the dividing line isn't too close to either group. The data points that are closest to the hyperplane and define the margin are called "support vectors," which is where the algorithm gets its name.

Quiz Questions 1/6

What is the primary goal of machine learning?

Quiz Questions 2/6

The defining characteristic of supervised learning is its use of labeled data.

These three algorithms are foundational building blocks in machine learning. Understanding how they work is the first step toward applying these powerful tools to solve real-world problems.