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

Machine Learning (Chapter1)

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

Machine Learning (Chapter1)

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

INTRODUCTION & OVERVIEW:

Machine Learning is a subset of Artificial Intelligence that enables


systems to learn and improve from experience without being
explicitly programmed. It's about finding patterns in data and using
those patterns to make predictions or decisions.
An Illustrative Learning Task: Email Spam Filtering
Let's consider a common ML problem: email spam filtering. The goal
is to classify emails as either "spam" or "not spam".
Data:
✓ A dataset of emails, each labeled as "spam" or "not spam".
✓ Each email can be represented as a set of features like:
✓ The presence of certain words (e.g., "free", "money", "urgent")
✓ The length of the subject line
✓ The email sender
✓ The presence of links
✓ The use of exclamation marks
Learning Task:
The machine learning model needs to learn to identify patterns in
these features that correlate with spam emails. Once trained, it should
be able to classify new, unseen emails as spam or not spam.
Approaches to the Problem
1. Supervised Learning
➢ Approach: The model is trained on a dataset where each email is
labeled as spam or not spam. The algorithm learns to map input
features (email characteristics) to output labels (spam or not
spam).
➢ Algorithms:
• Naive Bayes: Assumes independence between features.
• Support Vector Machines (SVM): Finds the best hyperplane to
separate spam and non-spam emails.
• Decision Trees: Creates a tree-like model of decisions and their
possible consequences.
• Random Forest: An ensemble of decision trees.
• Logistic Regression: Estimates the probability of an email being
spam.
2. Unsupervised Learning
➢ Approach: The model is trained on unlabeled data. It tries to
find patterns or clusters in the data without explicit guidance.
While not directly applicable for spam filtering (since we have
labeled data), it could be used for pre-processing or feature
engineering.
➢ Algorithms:
• Clustering: Groups similar emails together (e.g., clustering by
sender, subject length).
• Dimensionality Reduction: Reduces the number of features in
the data.
3. Reinforcement Learning
➢ Approach: The model learns by interacting with an environment
and receiving rewards or penalties for its actions. While not a
typical approach for spam filtering, it could be used in more
dynamic scenarios, like adaptive spam filtering based on user
feedback.
➢ Key Considerations
• Data Quality: The quality of the training data is crucial for
model performance.
• Feature Engineering: Creating relevant features from raw
data can significantly impact model accuracy.
• Model Evaluation: Metrics like accuracy, precision, recall,
and F1-score are used to assess model performance.
• Overfitting: The model should generalize well to new
data, avoiding overfitting to the training data.

Algorithms:
Algorithms are the heart of machine learning. They are the
computational procedures that enable computers to learn from data,
identify patterns, and make predictions or decisions without
explicit programming.
Theory
➢ Computational Complexity: Understanding the theoretical limits
of algorithms helps in selecting appropriate algorithms for
different problem sizes and computational resources.
➢ Optimization: Optimization theories provide the foundation for
training machine learning models efficiently, finding optimal
parameters, and minimizing errors.
➢ Probability and Statistics: These theoretical frameworks
underpin many machine learning algorithms, from Bayesian
methods to hypothesis testing.
Experiment
➢ Algorithm Design and Evaluation: Experimentation with
different algorithms on various datasets leads to the
development of new algorithms and improvements in existing
ones.
➢ Hyperparameter Tuning: Experimental approaches are used to
find optimal hyperparameters for machine learning models,
maximizing performance.
➢ Model Selection: Experimentation helps in selecting the best
model for a specific problem based on performance metrics.
Biology
➢ Neural Networks: Inspired by the human brain, artificial neural
networks have been a cornerstone of deep learning.
➢ Evolutionary Algorithms: Genetic algorithms and other
evolutionary approaches are used for optimization and feature
selection in machine learning.
➢ Biologically Inspired Algorithms: Techniques like swarm
intelligence (inspired by ant colonies) and particle swarm
optimization find applications in machine learning.
Psychology
➢ Cognitive Science: Understanding human cognition helps in
designing algorithms that mimic human decision-making
processes, such as reinforcement learning.
➢ Human-Computer Interaction: Insights from psychology are
used to create user-friendly machine learning interfaces and
explainable AI models.
➢ Behavioral Economics: Understanding human biases and
decision-making under uncertainty contributes to developing
robust machine learning models.

Linear Regression:
Linear regression is a statistical method used to model the relationship
between a dependent variable (target variable) and one or more
independent variables (predictor variables). It assumes a linear
relationship between the variables.
Simple Linear Regression: Involves one independent variable.
Multiple Linear Regression: Involves multiple independent variables.
The linear regression model can be represented as:
y = b0 + b1*x1 + b2*x2 + ... + bn*xn + ε
Where:
* y is the dependent variable
* b0 is the intercept
* b1, b2, ..., bn are the coefficients for the independent variables x1,
x2, ..., xn
* ε is the error term
Examples of Linear Regression
Simple Linear Regression:
➢ Predicting house prices based on square footage:
i. Dependent variable: House price
ii. Independent variable: Square footage
➢ Predicting student grades based on study hours:
i. Dependent variable: Grades
ii. Independent variable: Study hours
Multiple Linear Regression:
➢ Predicting car prices based on mileage, age, and horsepower:
➢ Dependent variable: Car price
➢ Independent variables: Mileage, age, horsepower
➢ Predicting sales based on advertising expenditure, price, and
competition:
➢ Dependent variable: Sales
➢ Independent variables: Advertising expenditure, price,
competition
Applications of Linear Regression
Linear regression is widely used in various fields, including:
• Finance: Predicting stock prices, portfolio returns
• Economics: Forecasting GDP, inflation
• Marketing: Predicting sales, customer churn
• Healthcare: Modeling disease progression, predicting patient
outcomes
• Social Sciences: Analyzing relationships between social factors
Key Considerations
➢ Assumptions: Linear regression makes certain assumptions about
the data, such as linearity, independence, normality, and
homoscedasticity. Violating these assumptions can affect the
model's accuracy.
➢ Outliers: Outliers can significantly impact the regression line. It's
essential to identify and handle outliers appropriately.
➢ Multicollinearity: When independent variables are highly
correlated, it can affect the model's stability and interpretation.
➢ Outliers: Outliers can significantly impact the regression line. It's
essential to identify and handle outliers appropriately.
➢ Multicollinearity: When independent variables are highly
correlated, it can affect the model's stability and interpretation.

Multiple Regression
Multiple regression is an extension of simple linear regression
that involves more than one independent variable to predict a
continuous dependent variable.
Example:
• Predicting house prices based on multiple factors like square
footage, number of bedrooms, location, age, etc.
• Model:
• y = b0 + b1x1 + b2x2 + ... + bn*xn + ε
• y: Dependent variable (house price)
• x1, x2, ..., xn: Independent variables (square footage, number of
bedrooms, etc.)
• b0: Intercept
• b1, b2, ..., bn: Coefficients
• ε: Error term
Logistic Regression
Logistic regression is used for classification problems where the
dependent variable is categorical (usually binary, like yes/no or 0/1). It
estimates the probability of an event occurring.
Example:
* Predicting whether a customer will churn (leave a company) based
on factors like tenure, contract type, usage, etc.
Model:
* Uses a logistic function to map linear combinations of predictors to
probabilities.
* Output is a probability between 0 and 1.
* A threshold (often 0.5) is used to classify instances.
Logistic Function
The logistic function (or sigmoid function) is used in logistic
regression to map any real number to a value between 0 and 1.
Formula:
* f(x) = 1 / (1 + e^(-x))

Graph:
Example:
* In logistic regression, the output of the linear combination of
predictors is passed through the logistic function to obtain the
probability of the positive class.
Key Differences
* Multiple regression predicts a continuous value, while logistic
regression predicts a probability.
* Multiple regression uses a linear equation, while logistic regression
uses a logistic function.

You might also like