ch5
ch5
Regression
Mathematical Modeling
● To explore how mathematical models represent real-world phenomena and
contribute to solving problems in data science.
● Mathematical modeling is a fundamental approach to representing real-world
phenomena through mathematical expressions, enabling the prediction,
analysis, and optimization of complex systems.
● In data science and machine learning, it serves as the backbone for
designing algorithms and generating insights from data.
● It transforms complex phenomena into a simplified, understandable, and
computable form.
● Models allow for prediction, optimization, and understanding of systems
across various dicipleance. They help identify relationships and patterns in
data, enabling informed decision-making and problem-solving.
Cont.
● Versatility: Can be applied to various domains, such as finance, healthcare, and e-commerce.
● Data Adaptability: Models improve as more data becomes available, leading to better accuracy.
● Automation: Empirical models can automate complex tasks like anomaly detection or
recommendation systems.
● Data Dependence: Requires extensive and high-quality data for training. Poor data quality can lead
to inaccurate predictions.
● Overfitting: Empirical models may perform well on training data but fail to generalize to unseen data
if not properly regularized.
● Interpretability: Complex models like neural networks are often "black boxes," making it difficult to
explain decisions.
Linear regression
x: Independent variable
β0: Intercept
β1: Slope
ϵ: Error term
Explanation: The equation represents a straight line that best fits the data points. The intercept (β0) is the value of
y when x is 0, and the slope (β1) represents the change in y for a one-unit change in x
Cont.
Slope (β1): Change in the dependent variable for a one-unit change in the
independent variable.
Intercept (β0): Value of the dependent variable when the independent variable is
zero.
Understanding the coefficients helps interpret the model and the relationship
between variables. The slope indicates the strength and direction of the
relationship.
Regularization
● Regularization is a technique used to address overfitting by penalizing overly
complex models. It helps in enhancing the generalization ability of models,
ensuring they perform well on unseen data.
● A method to constrain or shrink model coefficients to prevent overfitting.
Introduces a penalty for large coefficients, encouraging simpler, more
interpretable models.
● Prevents Overfitting: Reduces the model's ability to capture noise in the
training data.
● Improves Generalization: Ensures the model performs well on test or real-
world data.
● Stabilizes Models: Helps avoid extreme fluctuations in predictions for small
changes in input.
Types of Regularization Techniques
Ridge Regression
Elastic Net
λ1∑∣𝑤𝑖∣ +λ2∑𝑤𝑖2
● Binary dependent variable: The dependent variable has only two possible
outcomes, typically coded as 0 and 1.
● Independent observations:Observations in the dataset must be
independent, meaning the outcome of one observation does not influence
another.
● No multicollinearity: Independent variables should not be highly correlated
with each other, as this can make the model's coefficients unstable.
● Large sample size: Logistic regression requires a relatively large sample
size to provide reliable and stable estimates of the model parameters.
Building Decision Models with Multi-Criteria Decision Making (MCDM)
◦ Steps:
Convergence:
The Taylor polynomial provides a good approximation of the function near the point 𝑎. The more terms
you include in the expansion, the more accurate the approximation, especially for smooth functions.
Degree of Approximation:
The degree 𝑛 of the Taylor polynomial determines how many derivatives of the function are taken into
account, with higher-degree polynomials offering better approximations for a larger range of 𝑥.
The error between the Taylor polynomial and the actual function can be bounded by the Lagrange
remainder term, which provides an estimate of how much the Taylor polynomial deviates from the actual
function for a given 𝑛.
Dividing and Conquering with Bisection Methods
Algorithm Steps:
1. Identify Interval:
a. Choose an interval [𝑎,𝑏] such that 𝑓(𝑎)⋅𝑓(𝑏)<0. This condition ensures that the function has a
root in the interval, as the function changes sign between 𝑎 and 𝑏.
2. Compute Midpoint:
a. Calculate the midpoint 𝑚 of the interval [𝑎,𝑏]
Cont.
3. Evaluate:
a. Evaluate the function at the midpoint 𝑓(𝑚).
b. If 𝑓(𝑚)=0, then 𝑚 is the root.
c. If 𝑓(𝑎)⋅𝑓(𝑚)<0, the root lies in the left subinterval [𝑎,𝑚].
d. If 𝑓(𝑚)⋅𝑓(𝑏)<0, the root lies in the right subinterval [𝑎,𝑚].
4. Repeat:
a. Narrow the interval by selecting the subinterval where the root lies. Repeat the process until
the desired level of precision is achieved, i.e., until the difference between 𝑎 and 𝑏 is
sufficiently small.
Predicting the future with Markov chains
π t+1 =πt ⋅P
Dimensionality Reduction: PCA and SVD