Chapter Knowledge in Learning
Chapter Knowledge in Learning
1. Read it aloud: Repeating information verbally helps reinforce memory. Saying things
out loud activates auditory memory.
o Example: Reading a poem aloud multiple times to memorize it.
2. Write it down: Writing out the material repeatedly helps with retention through
muscle memory and visual recognition.
o Example: Writing down vocabulary words to memorize their spelling.
3. Sing it out: Turning information into a song or rhythm can help make it more
memorable.
o Example: Singing the alphabet or times tables.
4. Visualize: Creating a mental image or associating information with a visual cue
enhances memory.
o Example: Visualizing a map to remember geographic locations.
5. Free association: Linking new information to things you already know by creating
associations helps recall.
o Example: Associating historical events with vivid imagery or personal
experiences.
These techniques aid in memorization, especially when the material doesn't involve deep
understanding or reasoning.
Let’s take the example of learning the card game Hearts using First Operational
Operationalizer (FOO), an AI that learns how to play the game by following advice.
Goal: FOO wants to learn how to play the card game Hearts, but it doesn't know the
rules at first.
Advice: A human expert provides advice on how to play, such as basic strategies and
rules.
Don’t win hearts: FOO is told, "Try not to win any hearts, as each heart card is worth
points, and you want to avoid points."
Avoid the Queen of Spades: Another piece of advice is, "Don’t win the Queen of
Spades, as she is worth a lot of points."
FOO doesn’t understand the full game yet but applies these basic pieces of advice.
Avoid Hearts: Whenever it can, FOO will play lower cards so it doesn't win tricks
containing hearts.
Avoid the Queen of Spades: FOO will avoid playing high spades, especially if the
Queen of Spades could be in play.
Step 3: Learning through Play (Applying Advice)
It looks at its hand and tries to choose cards that will avoid winning hearts or the
Queen of Spades.
For example, if there’s a heart in the trick, it will play its lowest card to avoid winning
the trick.
FOO sees that when it follows the advice (not winning hearts or the Queen of
Spades), it tends to score better.
It learns to prioritize this advice, making adjustments like passing high hearts or
spades to other players.
FOO becomes a better Hearts player simply by operationalizing (putting into practice) the
advice it received. It did not discover these strategies by itself but rather learned by
following instructions.
Learning by parameter adjustment is crucial for many AI systems. In essence, the system
learns by tweaking its internal parameters based on feedback (error or reward) from its
actions. Through iterative updates, the system's performance improves until it can handle
tasks like classification, driving, or playing games with high accuracy.
You want to find the perfect water temperature for your shower, not too hot and not too
cold.
You turn the knob to an initial position randomly, since you are unsure of the right
setting.
Let’s say the water is too cold at first.
You feel the water and realize it’s uncomfortable. This is your feedback.
The error here is the difference between the actual temperature (too cold) and the
desired temperature (just right).
Based on the feedback, you adjust the shower knob slightly towards the hotter side.
The "knob position" is the parameter that you’re adjusting to improve the outcome.
Step 4: Rechecking and Iterating
You feel the water again and notice it’s warmer but still not perfect.
You continue adjusting the knob slightly until you reach the ideal temperature.
Over time, after taking several showers, you learn the approximate knob position
that gives the perfect water temperature without much trial and error.
Now, whenever you take a shower, you can quickly adjust the knob to the right spot,
since you’ve learned the ideal parameter (knob position) through repeated
adjustment.
The knob position is like the "parameter" in machine learning.
The feedback (too cold or too hot) is the "error" that tells you how far off you are
from the goal.
You keep adjusting the parameter (knob) based on feedback until you minimize the
error, just like a learning system tunes its parameters to make better predictions.
This process mirrors how AI systems like neural networks adjust their weights during
training to minimize errors and improve performance.
Learning by Macro-Operation:
This involves creating new, higher-level actions (or macro-operators) by
combining existing operations to solve complex tasks more efficiently.
Example 1: A robotic arm learning to pick up objects by creating a new macro-
operation that combines several basic movements (grasp, lift, and place).
Example 2: In planning systems, learning a macro-operation that combines
"fetching an object" and "delivering an object" into a single high-level operation
for faster task execution.
Learning by Chunking:
Soar Example:
Utility Problem:
o This refers to the challenge that arises when too many learned chunks or
rules make the system inefficient because it takes longer to find the relevant
rule. The AI must balance between having useful chunks and avoiding too
many irrelevant ones.
o Example 1: A decision-making system becomes slower as it accumulates
many rules that it must search through, even though only a few of those rules
are helpful for the current problem.
o Example 2: In a robot's learning process, the robot learns many irrelevant
actions, making it inefficient to find the most useful action in specific
situations.
Prodigy program:
Induction learning involves learning general rules or patterns from specific examples.
The AI system is provided with a set of examples, and it induces a general rule or
model that can be applied to new data.
Example 1: A decision tree algorithm that learns a classification rule by analysing
labelled training data (e.g., a set of medical cases and their corresponding
diagnoses).
Example 2: A machine learning model learns to recognize cats in images by being
trained on a dataset of images labelled as "cat" or "not cat."
Example 3: A spam email filter learns to classify emails as spam or not spam based
on a training dataset containing examples of both types of emails. It induces general
patterns from the examples and applies them to new, unseen emails.
Example 4: A supervised learning algorithm learns to classify images of animals (e.g.,
cats, dogs, birds) by analyzing a labeled dataset of animal images and inducing a
model that can predict the correct label for new images.
Classification refers to the process where an AI system or algorithm learns to assign labels
or categories to new data based on examples it has seen during training. This is a type of
supervised learning, where the system is given input-output pairs (examples) and learns to
map new inputs to their correct outputs.
Example of Classification: Email Spam Detection
Let’s consider a simple example: Email Spam Classification.
Training Phase (Learning from Examples):
The AI system is trained on a dataset containing examples of emails. Each email is
labeled as either "Spam" or "Not Spam".
The inputs to the system could be features extracted from the emails, such as:
o Number of links in the email.
o Presence of certain keywords (e.g., "free," "winner").
o Whether the email contains attachments.
The system learns from these examples. For example:
o Emails with many links and words like "free" are often labeled as Spam.
o Emails from familiar contacts or companies are often labeled as Not Spam.
Prediction Phase:
After training, the system is ready to classify new emails.
When a new email arrives, the system checks its features and classifies it as Spam or
Not Spam based on the patterns it learned during training.
Winston Learning Program
The Winston Learning Program, developed by Patrick Henry Winston, is an early symbolic AI
program designed to learn structural concepts through examples. It is based on learning by
example and is a form of concept learning where the program builds representations of
complex structures using simpler elements. The program's approach to learning revolves
around creating descriptions of objects or concepts using known patterns and then
adjusting these descriptions as new examples are provided.
Winston’s program is particularly focused on learning visual concepts, such as the structure
of simple block-world configurations (e.g., recognizing a tower made of blocks or identifying
an arch). The main idea is that the program learns from positive and negative examples,
adjusting its internal concept model by looking for differences between examples that
belong to a concept and those that do not.
1. Positive Examples:
o The program is given a positive example of the concept. For instance, it might
be shown an arrangement of blocks that form an "arch." The program starts
by noting important relationships between the elements in this example.
2. Negative Examples:
o The program is also shown examples that do not fit the concept. These are
called negative examples. For instance, an arrangement of blocks that does
not form an arch. The program examines what makes this example different
from the positive example.
3. Concept Representation:
o Winston’s program builds its understanding of concepts by creating symbolic
descriptions of objects. For example, it might describe an arch as "a structure
with two vertical blocks and a horizontal block resting on top."
o The program represents each object and its relationships symbolically. These
relationships are often spatial, such as "on top of," "next to," or "below."
4. Generalization and Specialization:
o The program generalizes the concept from the positive example by
identifying the common features that should be present for any object of
that type (e.g., arches always have two side blocks with a top block
connecting them).
o When a negative example is introduced, it specializes the concept by noting
what features must be present for it to remain valid (e.g., an arch can't have
three side blocks or the top block should rest directly on the side blocks).
5. Learning Process:
o The process of learning involves repeatedly modifying the internal concept
representation based on new positive and negative examples.
o If a new positive example of an arch is provided, the program checks if its
current model of an "arch" fits the new example. If it doesn’t, the program
updates its concept by generalizing it to include the new example.
o If a new negative example is given, the program checks what characteristics
prevent this example from fitting the concept, then adjusts the concept by
making it more specific.
Imagine the program is learning the concept of an arch in a world made of blocks. The
process might look like this:
1. Positive Example:
o The program is shown a stack of blocks arranged like an arch: two blocks
standing vertically and a third block resting horizontally across them.
o The program builds a symbolic description:
Block A is vertical.
Block B is vertical.
Block C is horizontal and resting on Blocks A and B.
2. Negative Example:
o The program is shown another stack of blocks, but this one has three vertical
blocks without the horizontal block on top. This does not represent an arch.
o The program identifies what is missing from its concept model and updates it
to ensure that a horizontal block resting on two vertical blocks is necessary
for the structure to be considered an arch.
3. Concept Refinement:
o The program will keep refining the concept as more examples (positive and
negative) are provided, creating a more accurate and generalized
representation of what an arch is.
The method for determining object properties and relations in AI systems typically involves
extracting key features from objects in an image or environment and analysing how these
objects relate to each other spatially or structurally. This method is particularly used in
symbolic AI and machine vision to understand the components and their interactions within
a scene.
Here’s a visualization of how an AI system might determine the properties and relations of
objects in a simple block world, where we will see two vertical blocks with a horizontal block
on top, forming an "arch."
Here's a depiction of a block world where two vertical blocks are standing side by side, and a
horizontal block rests on top of them, forming an arch. The relationships between the
blocks, such as "on top of" and "next to," are represented visually, along with properties like
size and orientation.
This type of diagram helps in understanding how an AI system determines object properties
and their spatial relationships in scenes like this.
Key Characteristics of Winston's Learning Program:
1. Learning Complex Structures: The program is able to learn concepts that are based
on the relationships between elements, such as spatial arrangements, which makes
it useful for tasks like visual recognition and understanding.
2. Generalization and Specialization: The ability to generalize from examples and
specialize based on counterexamples makes the learning more flexible and adaptive.
3. Symbolic Learning: Since the program uses symbolic representations, it allows for
clearer and more interpretable models of learned concepts compared to purely
statistical methods.
Challenges:
Applications:
Decision Trees are a popular machine learning technique used for classification and
regression tasks. They model decisions and their possible consequences in a tree-like
structure, where each internal node represents a feature (or attribute), each branch
represents a decision rule, and each leaf node represents an outcome or class label.
Regression is a statistical and machine learning technique used to model and analyze the relationships between a dependent variable
(often referred to as the output or target variable) and one or more independent variables (also known as features or predictors). The
primary goal of regression is to predict the value of the dependent variable based on the values of the independent variables.
Consider a simple example where we want to predict the price of a house based on its size (in square feet).
Classification in the context of learning from examples refers to the process where an AI system or algorithm learns to assign labels or
categories to new data based on examples it has seen during training. This is a type of supervised learning, where the system is given
input-output pairs (examples) and learns to map new inputs to their correct outputs.
1. Overview:
o Developed by Ross Quinlan in 1986, ID3 is used for generating a decision tree
based on a set of training data.
o The goal is to create a tree that accurately classifies the training examples
into their respective categories.
2. Key Concepts:
o Entropy: A measure of impurity or disorder in the dataset. It is used to
evaluate how well a particular attribute separates the classes.
o Information Gain: The reduction in entropy after splitting the dataset based
on a certain attribute. The attribute with the highest information gain is
chosen for the split.
3. Building the Tree:
o Start with the entire dataset and calculate the entropy.
o For each attribute, calculate the information gain by splitting the dataset
based on that attribute.
o Select the attribute with the highest information gain as the decision node.
o Recursively repeat the process for each subset of the data until:
All examples are classified correctly (pure subsets).
There are no more attributes to split on.
A stopping criterion is met (e.g., maximum tree depth).
4. Limitations:
o ID3 can lead to overfitting, especially with noisy data or when there are many
attributes.
o It can only handle categorical data, requiring transformation for continuous
features.
C4.5
1. Overview:
o C4.5 is an extension of ID3, developed by Ross Quinlan in 1993. It improves
upon ID3 by handling a broader range of data types and addressing some
limitations of ID3.
2. Key Concepts:
o Gain Ratio: Unlike ID3, which uses information gain, C4.5 uses gain ratio to
overcome the bias of information gain towards attributes with many values.
Gain ratio adjusts information gain by considering the intrinsic information of
the attribute (the amount of information generated by splitting the dataset).
o Handling Continuous Data: C4.5 can handle both categorical and continuous
attributes. For continuous attributes, it determines the best split point by
examining the values of the attribute and selecting a threshold that
maximizes information gain.
3. Building the Tree:
o Similar to ID3, but with enhancements:
Calculate the gain ratio for each attribute and select the one with the
highest gain ratio as the decision node.
Handle continuous attributes by determining the best threshold for
splitting.
Prune the tree after it is fully grown to reduce overfitting. This
involves removing branches that have little importance.
4. Advantages:
o Handles both categorical and continuous data.
o Pruning reduces the risk of overfitting.
o More robust and effective with noisy datasets.
Both ID3 and C4.5 are foundational algorithms for decision tree learning, each with its
strengths and weaknesses. ID3 introduced the basic concepts of decision trees, while C4.5
improved upon them significantly, making it more versatile and applicable to real-world
problems. In practice, decision trees remain a popular choice due to their interpretability
and ease of use in classification tasks.
To illustrate how decision trees (specifically using the ID3 or C4.5 algorithms) work with a
real-world example, we will consider the scenario of determining whether to play golf
based on various weather conditions.
ID3
Example: Weather Conditions for Playing Golf
In this example, we have a dataset of weather conditions, and we want to determine if the
decision to play golf (a categorical outcome) can be made based on several attributes. The
attributes include:
Here's a sample training dataset representing various weather conditions and the
corresponding decision to play golf:
1 Sunny 85 85 False No
2 Sunny 80 90 True No
6 Rain 65 70 True No
7 Sunny 72 95 False No
13 Rain 71 80 True No
2. Attribute Evaluation:
o For each attribute (Outlook, Temperature, Humidity, Windy), calculate the
information gain by determining how much the entropy decreases when the
dataset is split on that attribute.