Docsity

Machine Learning 2026-2027, Quizzes of Machine Learning

Toggle sidebar
bg1
Machine Learning 2026-2027
Well-posed Learning Problem
A computer program is said to learn from (E)xperience E with respect to some (T)ask T and
some (P)erformance measure P, if its performance on T, as measured by P, improves with
experience E.
Machine Learning
Field of study that gives computers the ability to learn without being explicitly programmed.
Machine Learning broad definition
Field of study that gives computers the ability to learn without being explicitly programmed.
Abstract Essence of ML
Representation + Evaluation + Optimisation
Machine Learning
Learning from experience. It's also called supervised learning, were experience E is the
supervision.
Pattern Recognition
Finding patterns without experience. It's also called unsupervised learning.
Unsupervised Learing
- We only have xi values, but no explicit target labels.
- You want to do 'something' with them.
Unsupervised Learning Tasks
- Outlier detection: Is this a 'normal' xi ?
- Data visualization: What does the high-dimensional X look like?
- Association rules: Which xij occur together?
- Latent-factors: What 'parts' are the xi made from?
- Ranking: Which are the most important xi ?
- Clustering: What types of xi are there?
Classification
ML task where T has a discrete set of outcomes. Often classification is binary.
Examples:
• face detection
• smile detection
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Machine Learning 2026-2027 and more Quizzes Machine Learning in PDF only on Docsity!

Machine Learning 2026 - 2027

Well-posed Learning Problem A computer program is said to learn from (E)xperience E with respect to some (T)ask T and some (P)erformance measure P, if its performance on T, as measured by P, improves with experience E. Machine Learning Field of study that gives computers the ability to learn without being explicitly programmed. Machine Learning broad definition Field of study that gives computers the ability to learn without being explicitly programmed. Abstract Essence of ML Representation + Evaluation + Optimisation Machine Learning Learning from experience. It's also called supervised learning, were experience E is the supervision. Pattern Recognition Finding patterns without experience. It's also called unsupervised learning. Unsupervised Learing

  • We only have xi values, but no explicit target labels.
  • You want to do 'something' with them. Unsupervised Learning Tasks
  • Outlier detection: Is this a 'normal' xi?
  • Data visualization: What does the high-dimensional X look like?
  • Association rules: Which xij occur together?
  • Latent-factors: What 'parts' are the xi made from?
  • Ranking: Which are the most important xi?
  • Clustering: What types of xi are there? Classification ML task where T has a discrete set of outcomes. Often classification is binary. Examples:
  • face detection
  • smile detection
  • spam classification
  • hot/cold Regression ML task where T has a real-valued outcome on some continuous sub-space Examples:
  • Age estimation
  • Stock value prediction
  • Temperature prediction
  • Energy consumption prediction Labels Values that h aims to predict Example:
  • Facial expressions of pain
  • Impact of diet on astronauts in space
  • Predictions of house prices Training algorithm Given a model h with Solution Space S and a training set {X,Y}, a learning algorithm finds the solution that minimizes the cost function J(S) Features/Attributes Measurable values of variables that correlate with the label y Examples:
  • Sender domain in spam detection
  • Mouth corner location in smile detection
  • Temperature in forest fire prediction
  • Pixel value in face detection Cost Function Squared error cost function. J(S) Local minima The smallest value of the function. But it might not be the only one. General classification problem If classes are disjoint, i.e. each pattern belongs to one and only one class then input space is divided into decision regions separated by decision boundaries or surfaces Decision surfaces are

The curse of dimensionality refers to how certain learning algorithms may perform poorly in high-dimensional data. First, it's very easy to overfit the the training data, since we can have a lot of assumptions that describe the target label (in case of supervised learning). In other words we can easily express the target using the dimensions that we have. Second,we may need to increase the number of training data exponentially, to overcome the curse of dimensionality and that may not be feasible. Third, in ML learning algorithms that depends on the distance, like k-means for clustering or k nearest neighbors, everything can become far from each others and it's difficult to interpret the distance between the data points. EXTREME Dimensionality Case In an extreme, degenerate case, if D > n, each example can be uniquely described by a set of feature values. Hidden layer(s) can

  • Have arbitrary number of nodes/units
  • Have arbitrary number of links from input nodes and to output nodes (or to next hidden layer)
  • There can be multiple hidden layers Hidden Unit Activation Common functions for are unit step, sigmoid or logistic and tanh RELU Rectified Linear Unit New trend, responsible for great deal of Deep Learning success. Advantages:
  • No 'vanishing gradient' problem
  • Can model any positive real value
  • Can stimulate sparseness Output layer can be
  • Single node for binary classification
  • Single node for regression
  • n nodes for multi-class classification Network Topology

Variations include:

  • Arbitrary number of layers
  • Fewer hidden units than input units (causes in effect dimensionality reduction, equivalent to PCA)
  • Skip-layer connections
  • Fully/sparsely interconnected networks Training a network Training a NN involves finding the parameters that minimize some error function Choice of activation function depends on the output variables:
  • Unity for regression
  • Logistic sigmoid for (multiple independent) binary classification
  • Softmax for exclusive (1-of-K) multiclass classification NN Error Functions Regression:
  • Binary classification
  • Multiple independent binary Classification:
  • Multi-class classification (mutually exclusive): Gradient points in the direction of Steepest Ascent How to train ANN An error function on the training set must be minimized. This is done by adjusting:
  • Weights connecting nodes.
  • Parameters of non-linear functions h(a). Eigenvalue Given an invertible matrix , an eigenvalue equation can be found in terms of a set of orthogonal vectors , and scalars such that: M Derivative Measure of how fast function value changes withe the change of the argument. So if you have the function f(x)=x^2 you can compute its derivative and obtain a knowledge how fast f(x+t) changes with small enough t. This gives you knowledge about basic dynamics of the function Gradient
  1. Backpropagate d's to obtain d(j) for all hidden units
  2. Evaluate error derivatives as: Regularization Regularization is a technique used in an attempt to solve the overfitting problem in statistical models. Regularization
  • Maximum likelihood generalization error (i.e. cross-validation)
  • Regularized error (penalize large weights)
  • Early stopping Deep Learning
  • Basically a Neural Network with Many hidden layers
  • Can be used for unsupervised learning and dimensionality reduction What is Deep Learning? Definition:
  • Hierarchical organization with more than one (non-linear) hidden layer in-between the input and the output variables
  • Output of one layer is the input of the next layer Deep learning methods (Deep) Neural Networks
  • Convolutional Neural Networks
  • Restricted Boltzmann Machines/Deep Belief Networks
  • Recurrent Neural Networks Convolutional Neural Networks Type of feed-forward artificial neural network in which the connectivity pattern between its neurons is inspired by the organization of the animal visual cortex, whose individual neurons are arranged in such a way that they respond to overlapping regions tiling the visual field. How is deep neural network optimized? Optimized through gradient descent! (Forward-Backward algorithm)
  • Penalize complex solutions to avoid overfitting Cost function - ℓ2 norm In order to avoid over-fitting, one common approach is to add a penalty term to the cost function. Common choices are the ℓ2-norm, given as:

Where C0 is the unregularized cost Cost function - ℓ1 norm Dropout A very different approach to avoiding over-fitting is to use an approach called dropout. Here, the output of a randomly chosen subset of the neurons are temporarily set to zero during the training of a given mini-batch. This makes it so that the neurons cannot overly adapt to the output from prior layers as these are not always present. It has enjoyed wide-spread adoption and massive empirical evidence as to its usefulness. Cost function - Euclidean distance Distance measure between a pair of samples p and q in an n-dimensional feature space Cost function - Manhattan or City block distance Calculate the distance between real vectors using the sum of their absolute difference. Also called City Block Distance Basic Decision Tree Decision trees apply a series of linear decisions, that often depend on only a single variable at a time. Such trees partition the input space into cuboid regions, gradually refining the level of detail of a decision until a leaf node has been reached, which provides the final predicted label. Tree components Root node, branch, node, leaf node. Branching Factor Branching factor of node at level L is equal to the number of branches it has to nodes at level L + 1 CART Classification And Regression Trees Six general questions to decide on decision tree algorithm:

  1. How many splits per node (properties binary or multi valued)?
  2. Which property to test at each node?
  3. When to declare a node to be leaf?
  4. How to prune a tree that has become too large (and when is a tree too large)?
  5. If a leaf node is impure, how to assign a category label?
  6. How to deal with missing data?

Stopping Criteria Reaching a node with a pure sample is always possible but usually not desirable as it usually causes over-fitting. Three common ways to decide when to stop splitting decision tree

  • Validation set
  • Cross-validation
  • Hypothesis testing (chi-squared statistic) Evaluation Procedures
  • For large datasets, a single split is usually sufficient.
  • For smaller datasets, rely on cross validation Validation set Criterian Split training data in a training set and a validation set (e.g. 66% training data and 34% validation data). Keep splitting nodes, using only the training data to learn decisions, until the error on the validation set stops going down. Cross-validation In k-fold cross-validation, a dataset is split into k roughly equally sized partitions, such that each example is assigned to one and only one fold. At each iteration a hypothesis is learned using k-1 folds as the training set and predictions are made on the k'th fold. This is repeated until a prediction is made for all k folds, and an error rate for the entire dataset is obtained. Cross-validation maximises the amount of data available to train and test on, at cost of increased time to perform the evaluation.
  • Training Data segments between different folds should never overlap
  • Training and test data in the same fold should never ovelap Error estimation can either be done per fold separately, or delayed by collating all predictions per fold. Cross-validation criterion Split training data in a number of folds. For each fold, train on all other folds and make predictions on the held-out test fold. Combine all predictions and calculate error. If error has gone down, continue splitting nodes, otherwise, stop Pruning First fully train a tree, without stopping criterion After training, prune tree by eliminating pairs of leaf nodes for which the impurity penalty is small

Multivariate Trees Instead of monothetic decisions at each node, we can learn polythetic decisions. This can be done using many linear classifiers, but keep it simple! Missing Attributes It is common to have examples in your dataset with missing attributes/variables. One way of training a tree in the presence of missing attributes is removing all data points with any missing attributes. A better method is to only remove data points that miss a required attribute when considering the test for a given node for a given attribute. This is a great benefit of trees (and in general of combined models,) ID Interactive dichotomizer version 3 Used for nominal, unordered, input data only. Every split has branching factor , where is the number of values a variable can take (e.g. bins of discretized variable) has as many levels as input variables C4.

  • Successor of ID3.
  • Multiway splits are used.
  • Statistical significant split pruning. Regression Trees
  • Trained in a very similar way
  • Leaf nodes are now continuous values - the value at a leaf node is that assigned to a test example if it reaches it
  • Leaf node label assignment is e.g. mean value of its data sample Problem: nodes make hard decisions, which is particularly undesired in a regression problem, where a smooth function is sought. Model Combination View
  • Decision Trees combine a set of models (the nodes)
  • In any given point in space, only one model (node) is responsible for making predictions
  • Process of selecting which model to apply can be described as a sequential decision making process corresponding to the traversal of a binary tree Random forests
  1. Very good performance (speed, accuracy) when abundant data is available.
  2. Use bootstrapping/bagging to initialize each tree with different data.
  3. Use only a subset of variables at each node.
  • For large datasets, a single split is usually sufficient.
  • For smaller datasets, rely on cross validation Overfitting can occur when
  • Learning is performed for too long (e.g. in Neural Networks)
  • The examples in the training set are not representative of all possible situations (is usually the case!)
  • Model parameters are adjusted to uninformative features in the training set that have no causal relation to the true underlying target function. Confusion Matrix Easy to see if the system is commonly mislabelling one class as another Classification measures - Error Rate Common performance measure for classification problems
  1. Success: Instance's class is predicted correctly (True Positives (TP) / Negatives (TN)).
  2. Error: Instance's class is predicted incorrectly (False Positives (FP) / Negatives (FN)).
  3. False positives - Type I error. False Negative - Type II error.
  4. Classification error rate: Proportion of instances misclassified over the whole set of instances. F-measure Comparing different approaches is difficult when using multiple evaluation measures (e.g. Recall and Precision) F-measure combines recall and precision into a single measure accuracy (TP + TN)/ (TP + TN + FP + FN) accuracy may not be useful measure in cases where 1 - There is a large class skew 2 - There are differential misclassification costs - say, getting a positive wrong costs more than getting a negative wrong. 3 - We are interested in a subset of high confidence predictions TPR - True Positive Rate - Recall TP/actual Positive = TP/TP + FN False Positive Rate FP/actual negative = FP/TN + FP Specificity

Sensitivity ROC Curve Receiver Operator Characteristic (ROC) curves plot TP vs FP rates Hypothesis Quality

  • We want to know how well a machine learner, which learned the hypothesis as the approximation of the target function , performs in terms of correctly classifying novel, unseen examples
  • We want to assess the confidence that we can have in this classification measure The true error of hypothesis h Probability that it will misclassify a randomly drawn example from distribution : D However, we cannot measure the true error. We can only estimate it by observing the sample error eS SAMPLE ERROR In statistics, sampling error is incurred when the statistical characteristics of a population are estimated from a subset, or sample, of that population. A Bernoulli trial
  • It is a trial with a binary outcome, for which the probability that the outcome is 1 equals p (think of a coin toss of an old warped coin with the probability of throwing heads being p).
  • A Bernoulli experiment is a number of Bernoulli trials performed after each other. These trials are i.i.d. by definition. Binomial distribution In probability theory and statistics, the binomial distribution with parameters n and p is the discrete probability distribution of the number of successes in a sequence of n independent yes/no experiments, each of which yields success with probability p. Normal distribution
  • The Normal distribution has many useful properties. It is fully described by it's mean and variance and is easy to use in calculations.
  • The good thing: given enough experiments, a Binomial distribution converges to a Normal distribution. t-test Assesses whether the means of two distributions are statistically different from each other

Convergence is guaranteed but not necessarily optimal - local minima likely to occur

  • Depends largely on initial values of uk.
  • Hard to define optimal number K.
  • K-means algorithm is expensive: requires Euclidean distance computations per iteration.
  • Each instance is discretely assigned to one cluster.
  • Euclidian distance is sensitive to outliers. ROBBINS-MONRO •Addresses the slow update speed of the M-step in K-means •Uses linear regression (see lecture 1) K-medoids clustering Addresses issue with quadratic error function (L2-norm, Euclidean norm) Replace L2 norm with any other dissimilarity measure (V...) Random Initialization
  • Randomly Initialize K-Means clusters using actual instances as cluster centers
  • Run K-Means and store centers and final Cost function
  • Pick clusters of iteration with lowest Cost function as optimal solution
  • Most useful if K < 10 Choosing K Elbow method
  • Visual inspection
  • 'Downstream' Analysis Probability Theory Recap p(x) = marginal distribution p(x,y) = joint distribution p(x|y) = conditional distribution Mixture of Gaussians Simple formulation: density model with richer representation than single Gaussian i.i.d. Independent and identically distributed random variables EM Algorithm issues
  • Takes a long time
  • Often initialised using k-Means Data Mining
  • Quest to extract knowledge and/ or unknown interesting patterns from apparently unstructured data. aka Knowledge Discovery from Data (KDD)
  • Data mining bit of a misnomer - information/ knowledge is mined, not data. Knowledge Discovery Process
  1. Data cleaning - remove noise and inconsistencies
  2. Data integration - combine data sources
  3. Data selection - retrieve relevant data from db
  4. Data transformation - aggregation etc. (cf. feature extraction)
  5. Data mining - machine learning
  6. Pattern Evaluation - identify truly interesting patterns
  7. Knowledge representation - visualize and transfer new knowledge ARFF Attribute-Relation File Format HDF
  • Much more complex file format designed for scientific data handling
  • It can store heterogeneous and hierarchical organized data.
  • It has been designed for efficiency. DM Types of data
  • Relational databases
  • Data warehouses
  • Transactional databases
  • Object-relational databases
  • Temporal/sequence/time-series databases
  • Spatial and Spatio-temporal databases
  • Text & Multimedia databases
  • Heterogeneous & Legacy databases
  • Data streams DM Functionalities Concept/Class description
  • Characterization
  • Discrimination
  • Frequent patterns/ Associations/ Correlations
  • Classification and Regression (Prediction)
  • Cluster analysis
  • DM query language incorporates primitives
  • Allows flexible interaction with DM systems
  • Provides foundation for building user-friendly GUIs
  • Example: DMQL DM integration with DBS/ Data Warehouses
  • No coupling - DMS will not utilize any DB/DW system functionality
  • Loose coupling - Uses some DB/DW functionality, in particular data fetching/storing
  • Semi-tight coupling - In addition to loose coupling use sorting, indexing, aggregation, histogram analysis, multiway join, and statistics primitives available in DB/DW systems
  • Tight coupling Dirty data incomplete noisy inconsistent Causes of incomplete data
  • "Not applicable" data value when collected
  • Different considerations between the time when the data was collected and when it is analyzed.
  • Human/ hardware/ software problems Causes of noisy data (incorrect values)
  • Faulty data collection instruments
  • Human or computer error at data entry
  • Errors in data transmission Causes of inconsistent data
  • Different data sources
  • Functional dependency violation (e.g., modify linked data) Importance of cleaning data If you have good data, the rest will follow Data quality measures Multi-Dimensional Measure of Data Quality
  • A well-accepted multidimensional view:
  • Accuracy
  • Completeness
  • Consistency
  • Timeliness
  • Believability
  • Value added
  • Interpretability
  • Accessibility
  • Broad categories:
  • Intrinsic, contextual, representational, and accessibility Major DM prep tasks
  • Data cleaning : Fill in missing values, smooth noisy data, identify or remove outliers, and resolve inconsistencies
  • Data integration : Integration of multiple databases, data cubes, or files
  • Data transformation : Normalisation and aggregation
  • Data reduction : Obtains reduced representation in volume but produces the same or similar analytical results
  • Data discretization : Part of data reduction but with particular importance, especially for numerical data Noisy data Noise is a random error or variance in a measured variable Techniques for canceling out noise
  1. Binning - First sort data, then distribute over local bins
  2. Regression - Fit a parametric function to the data (e.g. linear or quadratic function)
  3. Clustering Noisy data - Binning Cancelling noise by binning:
  • Sort data
  • Create local groups of data
  • Replace original values by: ______ The bin mean ______ The closest min/max value of the bin Noisy data - Regression Canceling noise by regression:
  1. Fit a parametric function to the data using minimization of e.g. least squares error
  2. Replace original values by the parametric function value Noisy data - Clustering