Ai Notes
Ai Notes
2. Unsupervised Learning
Definition: This form involves training algorithms on unlabeled data, allowing
them to identify patterns or groupings without prior knowledge of the
outcomes.
Types- a)Clustering
Description: Groups similar data points together based on their features.
How It Works: Imagine sorting a box of mixed candies into different jars based
on color or type.
Common Algorithms:
K-Means Clustering: Partitions data into K distinct clusters based on feature
similarity.
Hierarchical Clustering: Builds a tree of clusters by either merging or splitting
existing clusters.
b)Association Rule Learning:
Definition: It identifies patterns in data, showing how items are associated with
each other. For example, it can reveal that customers who buy bread often also
buy butter.
Applications:
• Customer Segmentation: Groups customers based on buying behavior for
targeted marketing.
• Anomaly Detection: Identifies unusual patterns that may indicate fraud or
defects
• Market Basket Analysis:Description: Identifies items that are frequently
purchased together.
• Recommendation Systems: Analyzes user behavior to recommend
products or content.
• Gene Expression Analysis: Simplifies genomic data to identify significant
genes related to diseases.
3)Reinforcement Learning
Definition: It identifies patterns in data, showing how items are associated with
each other. For example, it can reveal that customers who buy bread often also
buy butter.
Types:
a. Model-Based Reinforcement Learning
Purpose: Builds a model of the environment to simulate outcomes and optimize
actions.
Applications:
Robotic Planning: Robots learn to navigate complex environments by simulating
potential actions and outcomes.
b. Model-Free Reinforcement Learning
Purpose: Learns directly from the environment without an internal model.
Applications:
Game Playing: Uses algorithms like Q-learning or Deep Q-Networks to learn
optimal strategies in games such as chess or Go.
Applications of Reinforcement Learning
• Gaming: RL is used to create AI that can play and master complex games
• Robotics: RL helps robots learn how to perform tasks and adapt to new
situations.
• Autonomous Vehicles: RL enables self-driving cars to learn from their
surroundings and make safe driving decisions.
• Finance: Used for optimizing trading strategies and managing investment
portfolios.
1. Data Collection:
- Gather a set of labelled examples of fruits. For instance, collect images
of apples and oranges along with their characteristics:
- Apples: Red or green, round shape, smooth skin.
- Oranges: Orange color, round shape, bumpy skin.
2. Hypothesis Space:
- Define the possible rules or patterns the AI can learn from the data.
For example:
- Rule 1: If the fruit is red or green and has smooth skin, it is likely an
apple.
- Rule 2: If the fruit is orange and has bumpy skin, it is likely an orange.
3. Hypothesis Generation:
- The AI examines the features of the collected data and generates
hypotheses based on observed patterns. It might create rules like:
- "Fruits that are round and smooth-skinned are apples."
- "Fruits that are orange and bumpy-skinned are oranges."
4. Hypothesis Evaluation:
- Test these hypotheses on new examples (fruits not in the training set)
to see how accurately they classify them. For instance, if a new fruit
image appears:
- **New Fruit**: A round, smooth-skinned fruit that is red.
- The AI applies its rules and predicts it is an apple.
5. Hypothesis Refinement:
- If the AI makes incorrect predictions (e.g., classifying a fruit
incorrectly), it refines its hypotheses based on feedback. For example, if it
misclassifies a fruit due to varying shades of color or texture, it adjusts its
rules to account for these variations.
6. Generalization:
- After refining its rules based on testing and feedback, the AI can now
classify new, unseen fruits accurately based on the learned patterns. For
example:
- A new fruit that is round, orange, and bumpy will be classified as an
orange.
example of statistical learning using **k-means clustering**.
Example: Customer Segmentation
Scenario: Imagine you run a small coffee shop and want to segment your
customers based on their spending habits.
Data: You collect data on two features: the average amount they spend per visit
and the number of visits per month.
Steps:
1. Choose the number of clusters (k):
You decide to segment your customers into 2 groups (k = 2).
3. Results:
After processing, you might find:
- Cluster 1: Customers A, C, and D (low spend, high visits)
- Cluster 2: Customers B and E (high spend, low visits)
Interpretation:
- Cluster 1: These are frequent visitors who spend less. You might consider
offering them loyalty rewards.
- Cluster 2: These customers spend more but visit less often. You could target
them with promotions to increase their visit frequency.
Sensors:
• Stench: Indicates the presence of the Wumpus in an adjacent room.
• Breeze: Indicates a pit in an adjacent room.
• Glitter: Indicates that gold is present in the current room.
PEAS Description
Performance Measures:
• +1000 points for retrieving gold and exiting safely.
• -1000 points for being eaten by the Wumpus or falling into a pit.
• Each move costs -1 point; using an arrow costs -10 points
• The game ends if either agent dies or came out of the cave.