Course contentsShow
← Computer Science
Lesson 2792 of 2,87262. Machine Learning FundamentalsFree lesson

Reinforcement Learning Overview

Introducing learning through rewards and penalties by interacting with an environment over time.

Reinforcement Learning Overview

What you'll learn: How an agent learns optimal behavior by receiving rewards and penalties as it interacts with an environment over time.

The Core Idea

Reinforcement Learning (RL) is a learning paradigm where an agent discovers the best actions to take by trial and error. Unlike supervised learning (where you have labeled examples) or unsupervised learning (where you find hidden patterns), RL focuses on learning through consequences.

Think of training a dog: when it sits on command, you give it a treat (positive reward). When it misbehaves, you withhold treats or say "no" (penalty). Over many interactions, the dog learns which behaviors lead to rewards. That's reinforcement learning.

How It Works

In RL, an agent operates in an environment. At each step:

  1. The agent observes the current state of the environment
  2. The agent chooses an action
  3. The environment responds with a reward (or penalty) and transitions to a new state
  4. The agent uses this feedback to improve its decision-making

The goal is to learn a policy—a strategy that maps states to actions—that maximizes cumulative rewards over time, not just immediate gains.

Why It's Different

Unlike supervised learning where you're told "this input should produce this output," RL only tells you "that action led to a +5 reward" or "that cost you -10 points." You must figure out the optimal behavior yourself through exploration and exploitation of your experience.

Key Takeaway: Reinforcement learning trains agents to make sequential decisions by learning from rewards and penalties received through environmental interaction, discovering optimal strategies without explicit instruction.