6103 - Advanced ML
session: "6103-advanced-ml/2026-09-01 1830 Advance Machine Learning"
title: "Advance Machine Learning"
date: "2026-09-01 18:30"
duration: "1h 32m"
language: "en"
model: "deepseek-ai/DeepSeek-V3.2"
parts: 2
transcript_chars: 49915
generated: "2026-11-23T01:31:48+05:30"
This class covered foundational methods for evaluating and training supervised learning models. It began with data splitting techniques, comparing the holdout method and k-fold cross-validation, emphasizing their application to sequential versus non-sequential data. The lecture then introduced supervised learning's two main categories—regression and classification—and focused on linear regression. It detailed the model's equation, the concept of error calculation (absolute and squared), and the objective of minimizing error through methods like least squares and optimizers such as gradient descent. This session builds the groundwork for model training and evaluation, leading into more complex regression variants.
Splitting a dataset into training and testing sets is crucial to evaluate a model's performance on unseen data. The holdout method uses a single, fixed split, while k-fold cross-validation rotates the test set across k partitions, providing a more robust evaluation by using each data point for both training and testing across iterations.
The order of data points matters for sequential data (e.g., time series, text), requiring a sequential split to preserve temporal dependencies. For non-sequential data (e.g., images), the split can be random. This distinction dictates the splitting strategy in both holdout and k-fold methods.
Supervised learning involves predicting a target variable from input features. Regression predicts a continuous target (e.g., price, salary), while classification predicts a categorical target (e.g., spam/not spam). This class focused on regression, specifically linear models.
A linear regression model assumes a linear relationship between input variables (features) and a continuous output variable. It is represented by a line (in 2D) or a hyperplane (in higher dimensions). The model's parameters are coefficients (weights) and an intercept (bias), which are learned from data.
Error is the difference between the model's prediction and the actual target value. Aggregating errors (e.g., via sum of squared error) provides a metric for model accuracy. The training process aims to find the model parameters that minimize this error, using methods like the least squares approach or iterative optimizers.
An optimizer is an algorithm that automatically adjusts the model's coefficients to reduce the total error iteratively. Gradient descent is a fundamental optimizer that updates weights based on the error gradient, moving the model toward the minimum error configuration without manual intervention.
Linear Regression Equation (Simple)
y = θ₀ + θ₁x₁
y: Output/target variable (continuous).x₁: Input variable/feature.θ₀: Intercept/bias term.θ₁: Coefficient/slope for x₁.Linear Regression Equation (Multiple)
y = θ₀ + θ₁x₁ + θ₂x₂ + ... + θₙxₙ
x₁, x₂, ..., xₙ: Multiple input variables/features.θ₁, θ₂, ..., θₙ: Coefficients for each feature.Error for a Single Observation
error = target value – predicted value
target value: Actual value from the dataset (ground truth).predicted value: Value estimated by the model.Sum of Squared Error (SSE)
SSE = (error₁)² + (error₂)² + ... + (errorₙ)²
errorᵢ: Error for the i-th observation.n: Number of observations.Mean Squared Error (MSE)
MSE = SSE / n
SSE: Sum of squared error.n: Number of observations.Mean Absolute Error (MAE)
MAE = (|error₁| + |error₂| + ... + |errorₙ|) / n
|errorᵢ|: Absolute value of the error for the i-th observation.n: Number of observations.Holdout Method Data Split
For a dataset of 1 crore (10 million) observations:
k-Fold Cross-Validation (k=5)
Dataset is divided into 5 equal partitions (folds), each containing 20% of the data.
Linear Regression Prediction and Error
Model equation: price = b₀ + b₁ * size, with initialized weights b₀ = 25, b₁ = 15.
For a house of size 1000 sq ft:
Predicted price = 25 + 15 * 1000 = 15025 (units).
If the target price is 35,000:
Error = 35000 - 15025 = 19975.
Error Aggregation Example
Given four observations with errors: 5, -3, 0, 4.
|5| + |-3| + |0| + |4| = 12.5² + (-3)² + 0² + 4² = 25 + 9 + 0 + 16 = 50.12 / 4 = 3.50 / 4 = 12.5.Q: How is k-fold cross-validation better than holdout?
A: In k-fold, each data point is used for both training and testing across iterations, leading to a more comprehensive model evaluation and better utilization of data.
Q (Muthu): How is k-fold feasible with large datasets compared to holdout?
A: Both methods use the same total dataset size. k-fold increases the number of training iterations but does not require more data, which can improve learning without additional data collection.
Q (G1): Is splitting in k-fold random or sequential?
A: It depends on the data type. For sequential data (e.g., IoT, stock market), the split must be sequential to preserve order. For non-sequential data (e.g., images), the split can be random.
Q: How to calculate the coefficients (θ₀, θ₁)?
A: Not manually. The training process (e.g., least square method or gradient descent optimizer) estimates these values automatically using the dataset.
Q: Why is the intercept called bias?
A: It is a terminological convention in machine learning; there is no specific scientific reason behind this naming.
Q: Clarification on variables in the linear regression equation.
A: y is the output/target variable (e.g., CTC, price). xᵢ are input variables/features. θ₀ (or b₀, w₀) is the bias/intercept and is not associated with any input feature.
Q: How to draw a random line for model initialization?
A: Assume random values for the coefficients (e.g., b₀, b₁) or initialize them with zeros or small numbers.
Q: Why square the error?
A: Squaring ensures negative errors become positive so they do not cancel with positive errors when summed, preventing a misleading total error near zero.
Q: How to reduce error?
A: Draw many lines (models), calculate the total error for each, and select the line with the minimum error. An optimizer automates this search.
Q: Can we have multiple input variables?
A: Yes, that is multiple linear regression, which involves a plane or hyperplane instead of a line.
Q: What if the relationship is not linear?
A: Use polynomial regression (curve fitting) by introducing polynomial terms (e.g., x², x³) determined through hit-and-try.
θ₀) is also called the bias in machine learning terminology.1. Compare and contrast the holdout method and k-fold cross-validation for model evaluation. Include a discussion on when each might be preferred.
Answer outline: Holdout uses a single split; k-fold uses multiple rotations. Holdout is simpler and faster; k-fold provides more reliable performance estimates, especially with limited data. For very large datasets, holdout may be sufficient; for smaller datasets or when robust evaluation is critical, k-fold is preferred.
2. **Given a linear regression model price = 10 + 5 * size and the following data points (size, price): (2, 25), (4, 30), calculate the predicted prices, individual errors, sum of squared error (SSE), and mean squared error (MSE).**
Answer outline: For (2,25): predicted = 20, error = 5. For (4,30): predicted = 30, error = 0. SSE = 5² + 0² = 25. MSE = 25 / 2 = 12.5.
3. Explain the steps involved in training a linear regression model using the least square method, from weight initialization to selecting the final model.
Answer outline: 1) Initialize coefficients (e.g., randomly). 2) Use the model to predict outputs. 3) Calculate errors (target - predicted). 4) Compute the sum of squared errors (SSE). 5) Adjust coefficients (via an optimizer) to minimize SSE. 6) Repeat until error is minimized, selecting the model with the least error.
4. Describe the difference between sequential and non-sequential data. Provide an example of each and explain how data splitting should be handled in each case.
Answer outline: Sequential data order matters (e.g., stock prices over time); splitting must be sequential (e.g., first 80% for training, next 20% for testing). Non-sequential data order does not matter (e.g., images of cats and dogs); splitting can be random.
5. **A polynomial regression model is proposed to predict salary based on age, with equation salary = θ₀ + θ₁*age + θ₂*age². Why might this be more suitable than simple linear regression for this problem?**
Answer outline: The relationship between salary and age is often non-linear (e.g., increases then plateaus). The squared term (age²) allows the model to capture curvature, providing a better fit than a straight line.
k in k-fold cross-validation (depends on dataset size and number of features).
One line per segment, [hh:mm:ss] timestamp first.
loading…