Personal tools

ML Models and Tasks

Widener Library_Harvard University_050325A
[Widener Library, Harvard University]
 

- Overview

Machine learning (ML) tasks are specific problems or predictions you want to solve using data, while ML models (ML) are the trained mathematical structures that execute those tasks. 

A ML task is a type of prediction or inference that's based on both: the problem or question, the available data. For example, the classification task assigns data to categories, and the clustering task groups data according to similarity. ML tasks rely on patterns in the data rather than being explicitly programmed.

1. Core Machine Learning (ML) Tasks:

  • Regression: Predicts a continuous numerical value (e.g., house prices, temperature, or sales forecasts). Common algorithms include Linear Regression and Random Forest. 
  • Classification: Assigns data points to discrete categories or labels (e.g., detecting if an email is spam or identifying an object in a photo). Common algorithms include Logistic Regression and Support Vector Machines. 
  • Clustering: Groups unlabeled data based on similarities or hidden structures (e.g., customer segmentation). Common algorithms include K-Means and DBSCAN. 
  • Dimensionality Reduction: Simplifies data by reducing the number of variables while retaining essential information (e.g., Principal Component Analysis or PCA).
  • Reinforcement Learning: Trains an agent to make a sequence of decisions by interacting with an environment to maximize a reward.


2. Tasks vs. Models: 

A machine learning (ML) task is a specific prediction or inference problem solved using data, while a ML model is the trained mathematical representation that executes that task. 

  • The Task defines what you want to achieve (e.g., "classify whether a transaction is fraudulent"). 
  • The Algorithm defines how the computer learns from the data (e.g., a decision tree algorithm).
  • The Model is the final output - the algorithm plus the learned parameters (weights and biases) after training on your dataset.


- ML Tasks and Examples

A machine learning (ML) task is a specific prediction or inference problem solved by identifying data patterns rather than through explicit programming. 

It is a type of prediction or inference based on a question or problem posed and the data available. For example, classification tasks assign data to categories, and clustering tasks group data based on similarity.

ML tasks rely on patterns in data rather than being explicitly programmed. A ML task is a type of prediction or inference based on a question or problem posed and the data available. For example, classification tasks assign data to categories, and clustering tasks group data based on similarity. Machine learning tasks rely on patterns in data rather than being explicitly programmed.

Once you have determined which task is applicable to your scenario, you need to choose the best algorithm to train your model. 

1. Core ML Tasks:

  • Classification: Assigns input data into discrete categories or classes (e.g., filtering spam emails).
  • Regression: Predicts continuous numerical values like prices, temperatures, or delivery times.
  • Clustering: Groups unlabeled data points based on similarity or proximity.
  • Forecasting: Estimates future values by taking temporal order and seasonality into account.
  • Anomaly Detection: Identifies rare items, events, or observations that differ significantly from the majority of the data.
  • Dimensionality Reduction: Reduces the number of random variables under consideration by obtaining a set of principal variables.


2. Real-World Examples:

  • Fraud Detection: Financial institutions classify transactions as legitimate or fraudulent.
  • Image Recognition: Computer vision models identify and label objects or emotions within digital images.
  • Data Compression: Unsupervised clustering groups similar data points to simplify handling extensive datasets.

 

Budapest_Hungary_031821A
[Budapest, Hungary - Civil Engineering Discoveries]

- Probabilistic Models in ML

Probabilistic models in machine learning (ML) are statistical frameworks that capture uncertainty in data and use probability distributions to make predictions, rather than outputting a single deterministic value. 

Probabilistic models are one of the most important parts of ML and are based on the application of statistical codes to data analysis. This goes back to one of the earliest ML methods and is still widely used today.

Unobserved variables are treated as random variables in a probabilistic model, and the interdependencies between variables are recorded in a joint probability distribution. It provides the basis for embracing the nature of learning. 

The probabilistic framework outlines a method for representing and deploying model reservations. In scientific data analysis, prediction plays a leading role. Their contributions are also critical in ML, cognitive computing, automation and AI. 

These probabilistic models have many admirable properties and are very useful in statistical analysis. They make it very simple to infer the inconsistencies present in most data. In fact, they can be built in layers to create complex models from basic elements.

One of the main reasons why probabilistic modeling is so popular today is that it provides natural protection against overfitting and allows for fully consistent inferences over complex forms of data.

1. Core Concepts:

  • Probability Distributions: Represent inputs, outputs, and parameters using distributions (like Gaussian or binomial) instead of fixed numbers. 
  • Uncertainty Quantification: Quantify confidence levels for every prediction, showing the risk or likelihood of multiple potential outcomes.
  • Bayesian Inference: Update prior beliefs with new observed data to calculate posterior probabilities dynamically.


2. Key Types of Models:

  • Generative Models: Model the joint distribution of inputs and outputs to generate brand-new, realistic data (e.g., Hidden Markov Models, GANs). 
  • Discriminative Models: Model the conditional distribution of an output given an input to focus strictly on classification boundaries (e.g., Logistic Regression, Naive Bayes). 
  • Graphical Models: Use graphs to represent conditional dependencies between random variables (e.g., Bayesian Networks).


3. Common Applications:

  • Spam Filtering: Classifying emails based on word probabilities (Naive Bayes Algorithm).
  • Speech and Voice Recognition: Handling noisy acoustic signals.
  • Risk Modeling & Forecasting: Projecting financial or biological scenarios with known bounds of error. 
 

- Understanding Deterministic vs Probabilistic Machine Learning

Are machine learning (ML) models deterministic or probabilistic? ML models can be both, depending on how you define the model's architecture and whether you look at its training phase or its inference (prediction) phase. 

Machine learning (ML) is typically introduced through three main paradigms: supervised learning, unsupervised learning, and reinforcement learning. However, another powerful and orthogonal perspective categorizes models into deterministic models and probabilistic (generative) models. This classification focuses not on how the models learn, but rather on the nature of their predictions and their internal representations.
 
Rather than viewing machine learning solely through the lens of paradigms (supervised, unsupervised, and reinforcement learning), we can also classify models along another dimension:

  • Deterministic models: Focus on direct prediction, offering the advantages of speed and simplicity.
  • Probabilistic models (generative models): Embrace uncertainty and excel in sampling, inference, and robustness.

 

1. Deterministic vs. Probabilistic at Inference: 

  • Deterministic models give the same single output every time you feed them the exact same input. Standard models like linear regression, support vector machines (SVMs), or a frozen feedforward neural network with a set random seed perform fixed mathematical calculations that yield a single point estimate. 
  • Probabilistic models output a probability distribution or a range of likelihoods rather than just one hard answer. Examples include Naive Bayes, Gaussian Mixture Models, and Generative AI tools (like Large Language Models that sample the next word based on probabilities). Even if an LLM is set to a temperature of 0 (making it as deterministic as possible), its core mechanism is still built on predicting token probabilities.

 

2. The Role of Training:

  • Training is often stochastic: Most ML training processes rely on randomized weight initialization, random data shuffling (like mini-batch gradient descent), or dropout layers. This means training the same model twice on the same data can lead to slightly different final parameters unless you strictly lock down random number generator seeds and hardware environments.
  • Inference is usually fixed: Once a model is fully trained and saved, running predictions on a fixed input is typically deterministic - the learned weights do not change. 
 
 
 

[More to come ...]


Document Actions