Module B Handbook
Module B Handbook
Minor In AI
March 2, 2025
1 Linear Regression
Linear Regression is a statistical method used to model the relationship between a de-
pendent variable (target) and one or more independent variables (features). It assumes
a linear relationship between variables.
y = mx + c (1)
where:
• y = Dependent variable
• x = Independent variable
• c = Intercept
y = b0 + b1 x1 + b2 x2 + ... + bn xn (2)
where:
• b0 is the intercept
1
Minor in AI 2
where:
2 Polynomial Regression
2.1 Introduction
Polynomial Regression is an extension of Linear Regression where the relationship be-
tween variables is modeled as an n-degree polynomial. It helps in capturing non-linear
relationships.
Minor in AI 3
3 Gradient Descent
Gradient Descent is an optimization algorithm used to minimize the cost function in
machine learning and deep learning models. It iteratively adjusts model parameters to
find the best fit for the data.
• However, for complex models (high-dimensional data, deep learning), OLS is com-
putationally expensive, so we use Gradient Descent.
• Local Minima and Saddle Points: Momentum-based optimizers like Adam can
help.
• Feature Scaling: Gradient Descent converges faster when features are standard-
ized.
4 Regularization
Regularization is a technique used to prevent overfitting in machine learning models
by adding a penalty to large coefficients.
5 Classification
Classification is a supervised learning task where the goal is to assign a given input into
one of several predefined categories. The model learns from labeled training data and
predicts the category for unseen data.
5.2.2 Accuracy
TP + TN
Accuracy = (6)
TP + TN + FP + FN
Goal of SVM: Find the hyperplane that maximizes the margin (distance between
the closest points from both classes, called support vectors).
Minor in AI 8
subject to:
yi (wT xi + b) ≥ 1
This quadratic optimization problem ensures that the margin is maximized while
keeping misclassifications to a minimum.
subject to:
yi (wT xi + b) ≥ 1 − ξi , ∀i
where ξi are slack variables that allow misclassification.
Minor in AI 9
RBF Kernel is the most commonly used because it can model complex
decision boundaries.
6.8.2 Disadvantages
• Computationally expensive for large datasets.
Model Equation
The model estimates the probability using the sigmoid function:
1
P (y = 1 | x) = σ(z) = , where z = wT x + b
1 + e−z
Steps
1. Center the data:
Xcentered = X − X̄
Z = Xcentered Wk
9. PageRank Algorithm
PageRank measures the importance of a node (web page) in a directed graph based on
incoming links.
1
PageRank Formula
n
X P R(Bi )
P R(A) = (1 − d) + d
i=1
L(Bi )
where: