Introduction to Machine
Learning
Machine learning empowers computers to learn from data. It has three main
types: supervised, unsupervised, and reinforcement learning. This
presentation explores these categories, focusing on supervised learning with
linear and logistic regression.
by Abenezer yakob
Supervised Learning:
Learning from Labeled Data
Definition Goal
Algorithms learn from labeled Map input features to outputs
data to predict or classify using example data pairs.
outcomes.
Common Algorithms
Linear Regression
Logistic Regression
Support Vector Machines (SVM)
Decision Trees
Random Forests
Neural Networks
Unsupervised Learning:
Discovering Hidden
Patterns
Definition Goal
Algorithms learn from unlabeled Discover intrinsic relationships
data to identify structures and and groupings in data.
patterns.
Common Algorithms
K-Means Clustering
Hierarchical Clustering
Principal Component Analysis (PCA)
Association Rule Mining (Apriori)
Anomaly Detection
Reinforcement Learning:
Learning Through
Interaction
Definition Goal
Algorithms learn by interacting Maximize a cumulative reward
with environments via trial and signal over time.
error.
Common Algorithms
Q-Learning
Deep Q-Networks (DQN)
SARSA
Policy Gradients (REINFORCE, A2C, PPO)
Actor-Critic Methods
Diving into Supervised
Learning
Prevalence Nature
Accounts for 70% of practical Clear input-output mapping
machine learning problems with labeled data.
applications.
Focus Areas
Linear Regression and Logistic Regression techniques explored.
Linear Regression:
Predicting Continuous
Values
Goal
1 Model linear relationships between input variables and output.
Equation
2 Y Ĕ » ď »¡X¡ ď »¢X¢ ď ... ď · (predicted value formula)
Example
3 Predict house prices using size, location, and room count.
Why Linear Regression is Important
Linear regression is a foundational and highly practical machine learning technique due to several key reasons:
Simplicity and Interpretability: Its straightforward nature makes it easy to understand and interpret, serving as an excellent
entry point for learning machine learning concepts.
Predictive Power: It effectively predicts future outcomes based on historical data, proving valuable across diverse sectors like
finance, healthcare, and marketing.
Foundation for Other Models: Many advanced algorithms, including logistic regression and neural networks, build upon the
fundamental principles of linear regression.
Computational Efficiency: It is computationally inexpensive and performs well for problems exhibiting a clear linear relationship
between variables.
Widespread Adoption: It is a widely used technique in both statistics and machine learning for various regression tasks.
Insightful Analysis: It provides clear insights into the relationships between variables, illustrating how much one variable
influences another.
The goal of linear regression is to find a straight line that minimizes the error (the difference) between the observed data points and
the predicted values. This line helps us predict the dependent variable for new, unseen data.
y 2 = »0 + »1x1 + »2x2 + ï + »nxn
Where y^ is the predicted value. The goal is to minimize the error between observed and predicted values using the following cost
function:
Costf unction(J) = n1 3 ni(yi2 2 yi)2
x1, x2, & , xn are the independent variables.
The coefficients (weights) »1, »2, & , »n correspond to each predictor.
Gradient Descent for Linear Regression
Linear regression can be trained using gradient descent to minimize the mean squared error (MSE). The model starts with random
»1 and »2 values and iteratively updates them to find the best-fit line.
Logistic Regression:
Predicting Categories
Goal
1 Predict probability of binary outcomes using input features.
Logistic Function (p)
The probability 'p' of a positive outcome is given by the sigmoid
2 function:
p = 1/(1 + e2z )
Linear Combination (z)
The input 'z' to the sigmoid function is a linear combination of
3 the input features (Xi ) and their corresponding weights (»i ),
similar to the output of linear regression:
z = »0 + »1 X1 + »2 X2 + ï + »n Xn
Example
4 Predict customer churn based on demographics and usage.
Conclusion: Supervised Learning Applications
Linear Regression Logistic Regression Choosing Algorithms
Used for sales forecasting with accuracy Effective in fraud detection achieving Match algorithm to your data type and
within 5%. 90% accuracy. problem goals.