Untitled
Supervised Learning Overview
Supervised learning is a machine learning paradigm where models are trained on labeled data.
Human annotations provide guidance during model training.
Key Elements of Supervised Learning
Consider both model performance and model complexity during development.
Important concepts include:
Data partitioning schemes for evaluation.
Initialization and setting of hyperparameters.
Addressing the imbalancing issue in classification problems.
Definition of Supervised Learning
Supervised learning can be likened to educational supervision where teachers provide guidance to students.
In machine learning, the "supervision" translates to using labeled data to guide the learning process.
Example: Image data annotated with labels (e.g., "cat," "dog", etc.).
In Natural Language Processing (NLP), human annotations help evaluate generated text responses.
Families of Supervised Learning
Two major theoretical frameworks in supervised learning:
Bayesian Family:
Assumes data is generated from a specific distribution (e.g., normal distribution).
Focuses on the prior, likelihood, and posterior.
Frequentist Family:
Does not assume any distribution for data.
Stresses direct mapping from input to output without probability assessments.
Training Process in Supervised Learning
The core idea is estimating a mapping function from input variable x to output variable y using labeled training data.
Active learning is a complementary research topic involving iterative labeling of data.
Human experts provide annotations for a subset of unlabeled data, enhancing the quality of labeled datasets.
Nowadays, large language models can assist in generating quality labels for unlabeled data.
Benefits of Supervised Learning
Enables direct learning of mapping functions between features and outputs, leading to numerous prediction capabilities.
Includes various forms such as regression, classification, and ranking.
Regression: Predicts continuous outcomes (e.g., sales prediction based on temperature).
Classification: Involves categorizing inputs into discrete classes.
Ranking: Prioritizes results, particularly in search queries where relevance matters.
Models and Concepts in Supervised Learning
The discussion starts with simple linear regression, a foundational modeling technique.
Many machine learning models derive from linear regression through various transformations (e.g., logistic regression, support vector machines).
Example Cases
Regression Tasks:
Example: Predicting yogurt sales based on temperature. Displays a positive correlation.
Challenge: Outlier data points may skew results (e.g., expected sales vs actual anomalies).
Classification Tasks:
Example: Differentiating red data points from star data points in a visual space.
Fundamentals of Supervised Learning
Definitions:
Learning algorithms aim to find a function h mapping from input space x (upper case) to output space y (upper case) from a set of training examples (lower case x and y).
The function h belongs to a hypothesis space, which encapsulates potential mapping functions.
Hypothesis Testing:
Involves testing assumptions regarding the data; fundamentally different from the hypothesis space in machine learning.
Evaluation of Model Performance
Model performance is assessed through a loss function that quantifies the discrepancy between predicted and true output values.
Common examples include:
Mean Squared Error (MSE): Sensitive to outliers due to squaring.
Mean Absolute Error (MAE): More robust to outliers; measures average distance.
Loss functions vary for different types of models and contexts.
Model Complexity
Critical to evaluate trade-offs between model performance and complexity.
Simple models risk underfitting while complex models may overfit data.
The bias-variance trade-off is a critical discussion point.
Bias-Variance Trade-off
Bias: Error due to overly simplistic assumptions in the learning algorithm.
Variance: Error due to excessive sensitivity to small fluctuations in the training data.
The goal is to find a model that minimizes both bias and variance to achieve good generalization.
Model Performance Metrics
Quality of predictions can be assessed via various evaluation metrics, such as:
Accuracy, Precision, Recall (Sensitivity), F1 Score, Confusion Matrix, ROC Curve
ROC Curve & Area Under Curve (AUC)
Determines trade-off between true positive rate and false positive rate.
AUC provides a single scalar value representing the classifier's performance.
Data Partitioning Techniques
Different methods exist for splitting data into training and testing sets, including:
Random Sampling: Simple approach but may not maintain class distributions.
Stratified Sampling: Ensures maintained ratios of class distributions, beneficial for imbalanced datasets.
Cross-Validation: Involves partitioning data into k subsets, training models multiple times, and averaging results for more reliable performance estimates.
Hyperparameters in Machine Learning
Distinction between hyperparameters and model parameters:
Hyperparameters are set before model training and influence architecture or learning behavior (e.g., learning rate, number of layers).
Finding optimal hyperparameters can involve methods like grid search or Bayesian optimization.
Issues in Imbalanced Datasets
Strategies for handling imbalanced data include:
Oversampling rare classes or undersampling abundant ones.
Adjusting model loss functions to penalize misclassifications of minority classes.
Evaluation metrics must reflect the challenges of classification in imbalanced datasets.
Conclusion
Understanding the trade-off between model complexity and performance is key.
Continuous emphasis on evaluation quality is essential for successful deployment in real-world scenarios.
The lessons observed in supervised learning will recur across various machine learning models and contexts.
Next Steps
Review and apply these principles in practical assignments and forthcoming assessments.
Acknowledge the importance of maintaining ethical considerations in data handling and model deployment.