Docsity

Chapter_9_Artificial_Intelligence_and_Machine_Learning-v2, Lecture notes of Computer Fundamentals

Toggle sidebar
bg1
CH AP TE R 09 • A PP LIE D COM PUT IN G
Artificial Intelligence & Machine Learning
Topic: Learning Paradigms, Model Training, Bias-Variance & Evaluation Metrics
1. Machine Learning Paradigms
Unlike rule-based software where programmers hardcode every condition, machine learning infers statistical patterns directly
from training examples.
Supervised Learning: Trains on labeled input-output pairs. Used for classification (spam detection) and regression (house
price forecasting).
Unsupervised Learning: Discovers hidden groupings in unlabeled data, such as customer segmentation via clustering.
Reinforcement Learning: An agent learns optimal actions inside an environment through trial-and-error rewards and
penalties.
2. Data Splitting & Generalization
Datasets are divided into a Training Set (70–80%) to fit model parameters, a Validation Set to tune hyperparameters, and a
held-out Test Set for unbiased final scoring.
Condition Training Error Test Error Primary Remedy
Underfitting (High Bias) High High Add informative features or increase model capacit y
Balanced Fit Low Low Model generalizes well to unseen inputs
Overfitting (High Variance) Very Low High Gather more data, apply regularization, or simplif y model
3. Classification Evaluation Metrics
Raw accuracy misleads when classes are imbalanced (e.g., 99% normal transactions, 1% fraud). Engineers rely on confusion-
matrix metrics instead:
Precision: Of all items predicted positive, how many were truly positive? Minimizes false alarms.
Recall (Sensitivity): Of all actual positive cases, how many did the model catch? Crucial in medical screening.
F1-Score: The harmonic mean of precision and recall, balancing both error types in a single number.
Ethical AI & Data Leakage Rule
Always fit scalers and imputers exclusively on the training split before transforming test data; otherwise, test statistics
leak into training and inflate accuracy artificially.
•
•
•
•
•
•

Partial preview of the text

Download Chapter_9_Artificial_Intelligence_and_Machine_Learning-v2 and more Lecture notes Computer Fundamentals in PDF only on Docsity!

CH AP T ER 09 • AP PLIED COMPUTING

Artificial Intelligence & Machine Learning

Topic: Learning Paradigms, Model Training, Bias-Variance & Evaluation Metrics

1. Machine Learning Paradigms

Unlike rule-based software where programmers hardcode every condition, machine learning infers statistical patterns directly from training examples.

Supervised Learning: Trains on labeled input-output pairs. Used for classification (spam detection) and regression (house price forecasting). Unsupervised Learning: Discovers hidden groupings in unlabeled data, such as customer segmentation via clustering. Reinforcement Learning: An agent learns optimal actions inside an environment through trial-and-error rewards and penalties.

2. Data Splitting & Generalization

Datasets are divided into a Training Set (70–80%) to fit model parameters, a Validation Set to tune hyperparameters, and a held-out Test Set for unbiased final scoring.

Condition Training Error Test Error Primary Remedy

Underfitting (High Bias) High High Add informative features or increase model capacity

Balanced Fit Low Low Model generalizes well to unseen inputs

Overfitting (High Variance) Very Low High Gather more data, apply regularization, or simplify model

3. Classification Evaluation Metrics

Raw accuracy misleads when classes are imbalanced (e.g., 99% normal transactions, 1% fraud). Engineers rely on confusion- matrix metrics instead:

Precision: Of all items predicted positive, how many were truly positive? Minimizes false alarms. Recall (Sensitivity): Of all actual positive cases, how many did the model catch? Crucial in medical screening. F1-Score: The harmonic mean of precision and recall, balancing both error types in a single number.

Ethical AI & Data Leakage Rule Always fit scalers and imputers exclusively on the training split before transforming test data; otherwise, test statistics leak into training and inflate accuracy artificially.