Supervised learning
Licensed under ::
by ()
@


Supervised learning

Supervised learning is a type of machine learning where a model is trained on labeled data to learn the mapping between input features and corresponding outputs. The goal is to enable the model to make accurate predictions or classifications on unseen data by minimizing the error between its predictions and the true labels. Common tasks include regression (predicting continuous values) and classification (assigning categories). Supervised learning relies on a training dataset with known inputs and outputs and evaluates performance using a separate test dataset. Examples include spam email detection, image recognition, and speech-to-text systems.

Features (human experience)

In human experience, features can be thought of as the observable or measurable characteristics that we use to interpret and make decisions about the world around us. These features can come from different sensory modalities or cognitive processes.

Visual modality: Color, shape, size, motion, texture (raw); patterns, symmetry, depth cues (derived)

Auditory modality: pitch, volume, tempo, rhythm (raw); speech patterns, tone of voice (derived)

haptics ? emotions ? language ?

Features (machine learning)

Features represent the input variables used by a machine learning model to make predictions or classifications. They are the building blocks of the dataset and provide the information necessary for the model to learn relationships and patterns. Features can be:

Numerical: Continuous or discrete values (e.g., height, number of words).

Categorical: Representing distinct groups (e.g., color, category labels).

Derived: Transformed or engineered values combining raw data (e.g., ratios, log values).

Feature detection

Canny%20edge%20detector%20is%20an%20old-school%20powerful%20means%20for%20contour%20feature%20extraction%20%2F%20detection.

Canny edge detector is an old-school powerful means for contour feature extraction / detection.

Feature detection is the process of identifying significant patterns, structures, or attributes in raw data to aid analysis and decision-making. 

In images, this includes methods like SIFT, SURF, and Haar cascades for detecting edges, corners, or keypoints. 

In audio, algorithms like MFCCs extract time-frequency characteristics, while text relies on tokenization and n-grams. 

Feature selection

Feature selection involves choosing the most relevant features from a dataset to improve model accuracy, reduce overfitting, and enhance computational efficiency. Techniques include filters (e.g., chi-square tests), wrappers (e.g., recursive feature elimination), and embedded methods like LASSO. Boosting algorithms (e.g., AdaBoost, Gradient Boosting, XGBoost) also inherently perform feature selection by iteratively focusing on features with the highest predictive power.
 
Feature selection process is crucial in high-dimensional datasets, enabling models to concentrate on the most impactful data while discarding irrelevant or redundant features.

Testing

In supervised machine learning, *testing* (or *inference*) is the process of evaluating a trained model's ability to make accurate predictions on new, unseen data. During this phase, the model is given data points with *features* (inputs like size or color) but without the labels it was trained on. The model uses the patterns it learned during training to predict the labels for this data. The results are then compared to the actual labels (if available) to measure the model's performance using metrics like accuracy or precision. Inference is the final application of the model to make real-world predictions.

Supervised learning & Human learning

Supervised learning parallels human learning through its reliance on guidance from labeled examples, similar to how humans learn with feedback. For instance, when a child learns to identify objects, they receive input (the object) and a corresponding label (e.g., "dog" or "apple") from a teacher or parent. Mistakes are corrected, reinforcing the connection between input and label, much like how supervised learning algorithms adjust their predictions based on errors.

Categorization

Categorization is a fundamental human cognitive process where we group objects, ideas, or experiences based on shared characteristics.

Classifiers

A classifier in machine learning is a model or algorithm designed to categorize data into predefined groups or labels. It takes input data, analyzes its features, and assigns it to a specific class based on learned patterns from training data. For example, a classifier might identify whether an email is spam or not spam, or recognize handwritten digits. Classifiers are essential in supervised learning tasks and operate by minimizing errors in predictions through training on labeled datasets. Common types include neural networks, support vector machines, decision trees etc.

Support Vector Machines

A Support Vector Machine (SVM) is a machine learning method that helps divide data into categories. Imagine drawing a line (or boundary) on a graph to separate different groups of points, like cats and dogs. SVM finds the best line that keeps the groups as far apart as possible. For trickier data, it can use special math (called kernels) to draw curves or work in higher dimensions.

Decision Trees

A Decision Tree is a visual and intuitive machine learning method that makes decisions by asking questions about the data. It works like a flowchart, starting with a question at the top and branching out based on answers. These questions are not just yes/no, but can also be comparisons, like "Is the age greater than 18?" or "Is the temperature below 30°C?" Each split is chosen using a quantitative measure, such as information gain or Gini impurity, to find the best threshold for separating the data.

Training

In supervised machine learning, training is the process of teaching a model, like a classifier, to make accurate predictions by learning patterns from labeled data. Each data point in the training set includes features (characteristics or inputs that describe the data, like size or color) and a corresponding label (the correct output or category). The model uses this data to adjust its internal parameters, minimizing the error between its predictions and the actual labels. This is done through algorithms like gradient descent. The goal is to generalize from the training data, enabling the classifier to make accurate predictions on new, unseen data.

Evaluation

Binary classifiers are evaluated by comparing their predictions to the actual outcomes using a confusion matrix. This is a table with four categories: True Positives (TP), where the classifier correctly predicts a positive outcome; True Negatives (TN), where it correctly predicts a negative outcome; False Positives (FP), where it wrongly predicts a positive; and False Negatives (FN), where it misses a positive case. Metrics like accuracy (overall correctness), precision (focus on positives), and recall (how well positives are found) are calculated from this matrix, helping to assess the classifier’s performance.

Validating

In supervised machine learning, *validating* is the process of fine-tuning and assessing a model's performance during training to ensure it generalizes well to unseen data. Unlike testing, validation occurs on a separate *validation set*, distinct from both training and testing data. The model uses the *features* of this set to make predictions, which are compared to the actual labels to calculate metrics like accuracy or loss. This helps monitor overfitting or underfitting and guides adjustments to model parameters or hyperparameters (e.g., learning rate or regularization). Validation ensures the classifier is optimized before its final evaluation on the test set.