0% found this document useful (0 votes)
4 views

Reinforcement Learning

Uploaded by

Muhammad Waleed
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Reinforcement Learning

Uploaded by

Muhammad Waleed
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Introduction to Data

and Machine Learning


Concepts
By
Dr. Inam Ullah Khan
What is Data
•Definition of Data:
•Data refers to raw facts and figures that are collected and used for reference or
analysis.

•Types of Data:

•Qualitative Data: Non-numerical data that describes qualities or characteristics (e.g.,


colors, names, labels).
•Example: Survey responses like "satisfied" or "dissatisfied."
•Quantitative Data: Numerical data that can be measured and quantified (e.g.,
height, age, temperature).
•Example: Age of individuals: 25, 30, 45.
•Structured Data: Organized data, often in tabular form, easily searchable (e.g.,
databases, spreadsheets).
•Example: Customer details in an SQL database with columns like Name, Age,
and Address.
•Unstructured Data: Unorganized data, difficult to search (e.g., text, images, videos).
•Example: Emails, social media posts, and scanned documents.
Importance of Data in Machine Learning:

•Data is the foundation of machine learning;


models learn patterns from historical data to
make predictions or decisions.
•Example: Predicting house prices using
features like size, location, and the number of
rooms.
What is Machine Learning
•Definition of Machine Learning:
•Machine Learning is a subset of artificial intelligence that enables systems
•to learn from data and improve performance without explicit programming.
•Types of Machine Learning:
• Supervised Learning: The model learns from labeled data to make predictions.
• Example: Classifying emails as spam or not spam based on past examples.
• Unsupervised Learning: The model identifies patterns in data without labeled
examples.
• Example: Customer segmentation in marketing based on purchasing
behavior.
• Reinforcement Learning: The model learns by interacting with the environment
and receiving rewards or penalties.
• Example: Training a robot to navigate a maze by rewarding it for reaching
the end.
•Applications of Machine Learning:
• Example: Recommending products on an e-commerce site based on user
behavior.
Getting Started with
Machine Learning
•Steps in a Machine Learning Project:

•Data Collection: Gathering relevant data from various sources.


•Example: Collecting weather data from sensors for a climate prediction model.
•Data Preprocessing: Cleaning and preparing data for analysis.
•Example: Handling missing values, normalizing data, and encoding categorical
variables.
•Model Selection: Choosing an appropriate algorithm based on the problem type.
•Example: Selecting a decision tree for a classification task.
•Model Training: Feeding data into the algorithm to learn patterns.
•Example: Training a neural network to recognize images of cats and dogs.
•Model Evaluation: Assessing model performance using metrics like accuracy, precision,
and recall.
•Example: Evaluating a model’s performance in predicting customer churn.

•Common Machine Learning Algorithms:

•Example: Using Linear Regression to predict sales based on advertising spend


Mean, Median & Mode
•Definition and Calculation:
•Mean: The average value of a dataset.
•Example Calculation: For the data [10, 20, 20, 30, 40],
Mean = (10 + 20 + 20 + 30 + 40) / 5 = 24.
•Median: The middle value when data is sorted.
•Example Calculation: For the data [10, 20, 20, 30, 40],
Median = 20.
•Mode: The most frequent value in a dataset.
•Example Calculation: For the data [10, 20, 20, 30, 40],
Mode = 20.
•Use Cases in Data Analysis:
•Example: Calculating the average income of a group to
understand the general economic status.
Standard Deviation
•Definition of Standard Deviation:
•Standard deviation measures the amount of variation or dispersion in a
set of data values.
•Importance in Data Analysis:
•It indicates how spread out the data points are around the mean.
•Example: A low standard deviation indicates that the data points are
close to the mean, while a high standard deviation indicates they are
spread out over a wider range.
•Calculation Method:
•Formula:

•Example Calculation: For the data [10, 20, 20, 30, 40], calculate the
mean (24), then find the standard deviation by applying the formula.
•Example:
•Standard deviation is commonly used in finance to measure the volatility
of stock prices
Variance
•Definition of Variance:
• Variance measures the average of the squared differences from
the mean.
•Relationship between Variance and Standard
Deviation:
• Variance is the square of the standard deviation.
•Use in Data Analysis:
• Example: Variance helps in understanding the spread of data
points in a dataset.
•Example Calculation:

• Formula:


• For the data [10, 20, 20, 30, 40], calculate the variance using
the mean and applying the formula.
Percentile
•Definition of Percentile:

•A percentile indicates the value below which a given


percentage of observations in a dataset falls.
•How Percentiles are Used in Data Analysis:
•Example: The 90th percentile means that 90% of the
data falls below this point.

•Example Calculation:
•Example: For the data [15, 20, 35, 40, 50], the 90th
percentile can be calculated to find the score below which
90% of the data lies.
Data Distribution
•Types of Data Distributions:

• Normal Distribution: A symmetric, bell-shaped distribution where most of the


data points are concentrated around the mean.
• Example: Heights of people in a population often follow a normal
distribution.
• Skewed Distribution: A distribution where data points are not symmetrically
distributed around the mean.
• Example: Income distribution, where a few high earners skew the
distribution to the right.
• Uniform Distribution: A distribution where all outcomes are equally likely.
• Example: Rolling a fair die, where each number from 1 to 6 has an equal
chance of occurring.

•Visualizing Data Distributions:


• Example: Using histograms to show the distribution of exam scores in a class.

•Impact on Data Analysis:


• Understanding data distribution is crucial for selecting appropriate statistical
methods.
Probability Using Python
•Introduction to Probability:
•Probability is the measure of the likelihood that an event will occur.
•Basic Probability Concepts:
•Example: The probability of flipping a coin and it landing on heads is 0.5.
•Python Libraries for Probability:
•NumPy: Used for numerical computations and generating random numbers.
•SciPy: Provides functions for probability distributions and statistical tests.

•Examples of Probability Calculations in Python:


Association Rule
•Definition of Association Rule:
•Association rules are used to find relationships between variables in large
datasets.

•Applications in Market Basket Analysis:


•Example: Finding that customers who buy bread often buy butter as well.

•Key Metrics:
•Support: Frequency of occurrence of an itemset.
•Example: The proportion of transactions that contain both bread and
butter.
•Confidence: The likelihood of finding the consequent in transactions that
contain the antecedent.
•Example: If a customer buys bread, how often do they also buy butter?
•Lift: How much more likely the consequent is to occur given the antecedent,
compared to it occurring independently.
•Apriori Algorithm:
•Used to generate association rules by identifying frequent itemsets.
Association Rule Example
Reinforcement Learning
Definition: Reinforcement Learning (RL) is a type of machine
learning where an agent learns to make decisions by interacting with
an environment and receiving rewards or penalties for its actions.Key

Concepts:
1. Agent: The decision-making entity that interacts with the
environment.
2. Environment: The external world that responds to the agent's
actions.
3. Reward: Feedback received by the agent for its actions, guiding
its learning process.

Types of Reinforcement Learning:

• Positive Reinforcement: The agent receives a reward for desirable


actions, encouraging repetition.
Example: A robot receives a reward for reaching its goal.

• Negative Reinforcement: The agent avoids penalties for


undesirable actions, learning to avoid them.
Example: A robot avoids penalties for not reaching its goal.
Conclusion
•Recap:
•Data types and their importance in machine learning.
•Key ML concepts: supervised, unsupervised, and
reinforcement learning.
•Essential statistics: mean, median, mode, standard
deviation, variance, and percentiles.
•Probability and association rules in data analysis.
•Reinforcement learning basics and applications.

•Key Takeaway: Understanding these fundamentals equips


you to analyze data effectively and build better machine
learning models.
•Next Steps: Practice with real data, explore advanced
techniques, and keep learning about new developments in
machine learning.
1
Thank you 8

You might also like