What Is Learning?
In the previous chapter, we formalized a learning method as an algorithm that receives a sample and returns a hypothesis. This description clarifies as training is organized, but still leaves open the central question of this chapter: when can we affirm that there was learning?
Hitting the known examples is not enough. A program could store each pair of the sample and return the memorized response when it found exactly the same input. Your training error would be zero, but it would not know how to respond to a new input. Learning requires some form of generalization.
In this chapter, we will say that a method learns when using a finite sample to produce a hypothesis whose performance remains good in examples not yet observed, from the process of interest. This idea involves three elements:
- a measure of quality or error;
- a statement on data outside the sample;
- a probabilistic guarantee, because different samples can lead to different hypotheses.
Returning notation.
In supervised learning, we consider:
- an entry space ;
- an output space ;
- an unknown distribution over ;
- a training sample
- a hypothesis class ;
- a loss function ;
- a algorithm that produces
In a deterministic model, we can assume for some target function . In noise problems, we work with the conditional distribution . The ideas of error and generalization are valid in both cases.
Empirical risk measures performance in the examples observed:
The expected risk measures the average performance in the generating process:
The first can be calculated from the training; the second is what really interests us, but it depends on an unknown distribution.
Learned as generalization.
A hypothesis generalizes when your error in new data is close to the error observed in the sample. Intuitively, we wish that
This approach does not occur automatically. The algorithm itself chose after observing , so the hypothesis may have explored accidental sample details. The more flexible the class, the greater its ability to adjust real patterns — and also noise.
Two types of failure help organize this discussion:
- subajuste (underfitting): the class or training is too simple to capture the relevant pattern; the training and test errors tend to be high;
- overfit (* overfitting*): the hypothesis adapts excessively to the sample; the training error is low, but the error in new data is high.
The goal is not to get the least training error at any cost. We want to balance adjustment and generalization capacity.
The test set does not participate in learning
If we repeatedly use test performance to choose features, hyperparameters or models, the test ceases to represent unseen data. These choices should be made with training and validation data; the test is reserved for the final evaluation.
The role of probability.
The sample is random. Two teams can collect examples of the same population and get different sets. Consequently, the algorithm can produce different hypotheses.
A guarantee of learning usually has the form:
where:
- is the error tolerance;
- is the maximum probability of warranty failure;
- the probability is taken over the random choice of the sample .
We read the expression as follows: with the probability of at least , the algorithm returns a hypothesis whose risk does not exceed . In more general formulations, we compare to the best achievable risk within .
This is the origin of the expression probably approximately correct: “probably” refers to confidence and “approximately” to tolerance.
What determines the difficulty.
The amount of data required depends on several factors:
- the desired precision, controlled by ;
- the desired confidence, controlled by ;
- the complexity of the hypothesis class ;
- the noise level;
- the quality and representativeness of the sample;
- the loss function and the type of warranty sought.
Demanding lower error or higher confidence usually requires more examples. Very expressive classes also need more data so that we can distinguish generalizable patterns from accidental adjustments.
Three questions from the chapter.
The next sections will develop three supplementary questions.
- How to measure the discrepancy? We need to define error, loss and notion of proximity between a hypothesis and the desired behavior.
- When is the observed error reliable? We will study probabilistic guarantees that relate sample and population.
- How to estimate performance in practice? We will discuss divisions between training, validation and testing.
These questions connect theory and engineering. The theory provides conditions and limits; the experimental protocol produces evidence about a concrete model.
Motivating example.
Suppose a spam classifier hits from training messages. The empirical error rate is
We still cannot conclude that your future error will be . Maybe the messages have been used to choose specific keywords, maybe the sample contains very similar messages or maybe the spam pattern has changed.
If we evaluate the classifier once in independent test messages and find errors, the test estimate will be
The difference between in training and in the test suggests a generalization gap. To interpret the uncertainty of this estimate, we will need probabilistic tools.
Preparation exercises.
- Explain why memorizing a sample is not enough to characterize learning.
- Differentiate empirical risk and expected risk.
- Give an example of underfit and one of overfit.
- Interpret and in a probabilistic warranty.
- Why does repeatedly evaluate in the test set compromise your function?
- In the example of spam, cite two possible causes for the difference between training and testing errors.
2.1 Error
Learning requires comparing predictions with observed results. This comparison is made by a loss function, which translates the quality of a prediction into a number. The lower the loss, the better the prediction according to the chosen criterion.
There is not a single notion of error appropriate for all problems. Mistake of a class is different from missing a continuous amount; in some applications, certain errors have far more serious consequences than others. The loss function is part of the formulation and should reflect the actual purpose of the system.
2.1.1 Per-example loss, risk, and metrics
The loss for example compares a prediction with the target :
empirical risk aggregates the losses in the sample:
A evaluation metric summarizes some aspect of the model’s behavior, such as accuracy, accuracy, recall or mean absolute error. Some metrics can be used as a training objective; others are difficult to optimize directly and serve mainly for evaluation.
The algorithm can minimize an objective with empirical risk and regularization:
We will use loss for an example, risk for a loss average and target for the quantity effectively optimized.
2.1.2 Classification: zero-one loss
In classification, the zero-one loss is for a hit and for an error:
Its empirical risk is the rate of incorrect classifications:
If a classifier misses of examples, then and its accuracy is .
The zero-one loss directly expresses the amount of errors, but is discontinuous. Therefore, many algorithms train with differentiable substitute losses.
2.1.3 Confusion matrix
In binary classification there are four results:
| Target | Prediction | Name |
|---|---|---|
| positive | positive | true positive (VP) |
| negative | negative | true negative (VN) |
| negative | positive | false positive (FP) |
| positive | negative | false negative (FN) |
From these counts we calculate
e
Accuracy answers: among the positive predictions, how many were correct? Revocation answers: among the really positive cases, how many were detected?
When classes are very unbalanced, accuracy can be misleading. If only of transactions are fraudulent, predicting “no fraud” for all produces of accuracy and no ability to detect fraud.
2.1.4 Asymmetric costs
False positives and false negatives may have different costs:
The corresponding empirical risk is
In authentication, accepting an unauthorized person may be more serious than asking the authorized person to try again. In sorting, no longer signaling an urgent case may be more serious than forwarding a non-urgent case. Costs should represent consequences of the context.
2.1.5 Regression: residual
In regression, the residual example is
indicates overestimation and indicates underestimation. A loss turns this residual into a non-negative penalty.

Figure 2.1. Absolute loss grows linearly with the residual; quadratic growth grows faster; logistics decreases as the correct margin increases.
2.1.6 Mean squared error
The squared loss is
The average squared error (* mean squared error*, MSE) is
Large errors receive disproportionate penalty. A magnitude residual contributes , while three magnitude residuals contribute in total. This makes the MSE sensitive to extreme values.
The root of the MSE,
It has the same unit as the target.
2.1.7 Mean absolute error
The absolute loss is
The mean absolute error (* mean absolute error*, MAE) is
The EAM grows linearly and is less sensitive to extreme observations than the SEM. For waste ,
The magnitude error exerts a much greater influence on the MSE.
2.1.8 Huber Loss
The loss of Huber combines quadratic behavior close to zero and linear behavior for large waste:
The parameter determines the transition. This loss keeps smoothness close to the minimum and reduces the influence of very discrepant values.
2.1.9 Classes encoded by and
If , then
Therefore, squared loss is four times zero-one loss in this specific case. It is not worth when there is error. If the model produces a real score, squared loss also considers the distance from punctuation to label.
2.1.10 Probabilities and binary cross-entropy
Consider and a prediction. The binary cross-entropy is
If , the loss is ; if , it is . A confident and wrong prediction gets big loss:
This loss assesses the probability attributed to the observed result, not just the final class.
2.1.11 Maximum likelihood
For i.i.d. examples and a model , likelihood is
Maximum likelihood chooses parameters that maximize . As logarithm is strictly increasing,
To write the training as minimization, we use the mean negative log-likeness:
For a Bernoulli model, NLL coincides with binary cross-entropy.
Transformations and great points
A strictly growing transformation preserves minimum and maximum. A strictly decreasing transformation maximum exchange by minimum. Thus, preserves the maximum likelihood; converts this maximum to minimum.
2.1.12 Multiclass cross-entropy
For classes, the model produces with and . If the correct class is , the loss is
With target * one-hot* ,
This is the usual loss for trained multiclass class classifiers with * softmax*.
2.1.13 Margin-based losses
In binary classification with and score, we set the margin
Positive margin indicates correct classification; negative margin indicates error.
It decreases smoothly as the correct margin increases. We can optimize cross-entropy and evaluate accuracy, accuracy, recall and calibration.
2.1.14 Choosing a Loss
| Situation | Common option | Feature |
|---|---|---|
| Regression with approximately symmetrical noise | MSE | heavily penalizes big mistakes |
| Return with extreme values | MAE or Huber | greater robustness |
| Binary probabilistic classification | binary cross-entropy | evaluates probabilities |
| Multiclass classification | cross-entropy | penalizes low probability of correct class |
| Different costs between errors | weighted loss | incorporates asymmetry |
The choice should consider the type of output, the consequences of errors, extreme values, properties required for optimization and the metric of interest. No loss corrects inadequate data or replaces outside of the sample.
2.1.15 Computing example
def mse(predictions, targets):
errors = [(p - y) ** 2 for p, y in zip(predictions, targets)]
return sum(errors)/len(errors)
Def mae(predictions, targets):
errors = [abs(p - y) for p, y in zip(previews, targets)]
return sum(errors)/len(errors)
y = [10, 12, 14]
pred = [11, 13, 18]
print(mse(pred, y)) #6.0
print(mae(pred, y)) # 2.0
In production, we should also check lengths, missing values, numerical types and behavior when the sample is empty.
2.1.16 Practice exercises
- A classifier obtained , , and . Calculate accuracy, accuracy and recall.
- For waste , calculate MAE, MSE and RMSE.
- Explain why squared loss is worth , not , when and .
- Calculate binary cross-entropy for with and with .
- Show why maximizing is equivalent to minimizing .
- Give an example in which and another in which .
- When would you prefer MAE to MSE?
- Explain the difference between training loss and evaluation metric.
2.2 Probably Right.
The theory probably roughly correct, abbreviated by PAC (* probably approximately correct*), transforms the idea of generalization into a mathematical guarantee. It recognizes two inevitable limitations:
- a finite sample does not perfectly determine the behavior of the entire population;
- as the sample is random, some samples may be unrepresentative.
Instead of demanding certainty and perfection, we fixed a error tolerance and a failure probability. We asked how many examples are needed for the algorithm to produce a good enough hypothesis with high probability.

Figure 2.2. In the PAC warranty, at least one fraction of the samples leads the algorithm to a hypothesis whose error is at most .
2.2.1 Two sources of probability
Consider a distribution over and a hypothesis. Your risk is
In the zero-one loss rating,
This probability is about a new example drawn from . It measures the region of the population in which err.
The algorithm receives a random sample
and returns . As varies, the hypothesis also varies.
contains a second probability, now on the draw of the entire sample. It states that at most a fraction of the samples leads to a hypothesis whose risk exceeds .
Do not confuse $\varepsilon$ and $\delta$
limits the error of hypothesis in the population. limits the probability of the training procedure not achieving this guarantee. One acts within each hypothesis; the other acts on the possible samples.
2.2.2 Reading “probably approximately correct”
In inequality
each word has a role:
- probably: the desired event occurs with probability of at least ;
- approximately: we admit error up to ;
- Correct**:** error is measured in relation to the distribution of interest, not only in the training sample.
If and , the guarantee says: with confidence of at least on the sample collected, the hypothesis produced will be at risk of maximum .
This does not mean that exactly of the predictions will be wrong or that the algorithm will fail exactly once in a hundred. It is a probabilistic bound valid under the theorem hypotheses.
2.2.3 Realizable setting
The simplest form of the theory assumes that there is a perfect hypothesis within the class. This is the case feasible:
A algorithm is a PAC learner for if there is a sample complexity function
such that, for any , any distribution of inputs and any target represented by , any i.i.d. sample with
satisfies
In the feasible case, a consistent algorithm seeks a hypothesis with zero empirical error. The theory needs to show when consistency in the sample implies small risk outside of it.
The hypothesis of achievement is strong. Data may contain noise, classes may overlap and the chosen family may not represent the real mechanism.
2.2.4 Agnostic setting
In the PAC agnostic learning, we do not assume that any hypothesis in is perfect. We compare the algorithm’s result to the best hypothesis available in the class:
Formally, we demand
is now a excess risk. The algorithm may not achieve small absolute error if every class hypothesis is inadequate; it should approximate the best possible performance within .
This formulation separates two components:
Zooming in can reduce representation limitation, but it makes statistical selection more difficult. This is an aspect of the balance between adjustment and complexity.
2.2.5 Sample complexity
The sample complexity is the minimum number of examples sufficient for the desired warranty. It answers a statistical question: how much information is needed?
In general:
- decrease requires more examples;
- decrease requires more examples;
- increasing the complexity of requires more examples.
For a finite class in the feasible case, a typical bound is
Constants and small variations depend on derivation, but the structure is important. Dependency is logarithmic in the number of hypotheses and in , and proportional to .
In the agnostic case, a typical bound is
The dependency reflects the additional difficulty of comparing hypotheses when none is necessarily perfect.
2.2.6 Where does the bound for a finite class come from?
Consider the case feasible and a bad hypothesis with
The probability of hitting all independent examples is at most
There are at most bad hypotheses. By the share of the union, the probability of some bad hypothesis remaining consistent is at most
We want this quantity to be maximum :
Applying logarithms and isolating ,
The derivation shows why we need to simultaneously control the chance of each bad hypothesis surviving and the amount of candidate hypotheses.
2.2.7 A numerical example
Suppose a finite class with
The reimburseable bound provides
Using natural logarithm,
Therefore, the bound asks for at least examples. This value is a guarantee of worse case, not an exact prediction of how many examples will be required in every application.
2.2.8 Infinite classes
Many important classes are infinite. There are infinite straight in the plane and infinite combinations of weights of a neural network. In this case, cannot be used directly.
We need a more refined measure of class capacity. The Vapnik–Chervonenkis dimension, studied below, measures how many classification patterns a family can perform on finite sets. Other tools include coverage numbers, Rademacher complexity and parameters standards.
An infinite class can be PAC-learning if its effective capacity is controlled. Infinite in cardinality does not automatically mean impossible to learn.
2.2.9 Learnability and computational efficiency
Sample complexity and computational complexity are different.
- Statistical Learning: is there an algorithm that achieves the warranty using a finite and controlled number of examples?
- Computer efficiency: does this algorithm run in viable time and memory?
A class may admit good sample complexity, but require computationally intractable search. An efficient PAC apprentice usually requires polynomial time in the relevant parameters of representation, in and in or , according to the formal convention adopted. The central point is that obtaining sufficient information does not guarantee that we will be able to process it efficiently.
2.2.10 What the PAC guarantee does not say
A PAC guarantee depends on conditions.
- i.i.d. data represent any future scenario;
- the distribution will remain stable after implantation;
- the labels are correct;
- the chosen loss represents all relevant impacts;
- the model is causal, fair or safe;
- the bound is tight for a concrete application.
If training and use have different distributions, the derivative warranty for may not describe the actual operation. The theory provides a conditional statement: if the hypotheses are satisfied, then the bound is worth.
2.2.11 Finite example and inductive bias
Consider
and a sample that reveals the labels of five entries.
extensions compatible with the five observed values.
Only the sample does not allow logically to choose an extension. The algorithm needs an inductive bias: prefer simple functions, smooth patterns, linear boundaries or other structure. PAC does not eliminate this need; it analyzes when the class combination, algorithm and amount of data generalizes.
2.2.12 PAC and experimental validation
A theoretical bound and a set of tests answer different questions.
- The PAC bound provides assurance under mathematical hypotheses and often goes in the worst case.
- The test estimates the performance of a concrete hypothesis in an independent sample.
In practice, we use both when available: theory to understand dependencies and limits; experimental evaluation to measure the trained system.
2.2.13 Summary
A PAC method controls two levels of uncertainty:
in the case of achievable, or
in the case of agnostic.
controls approximate quality, controls confidence and informs how many examples are sufficient.
2.2.14 Practice exercises
- Explain, in words, the two odds involved in a PAC guarantee.
- Interpret a warranty with and .
- Differentiate the agnostic case.
- For , and , calculate the achievable bound shown.
- Show the pass to the bound over .
- Why is an infinite class not automatically impossible to learn?
- Give an example in which i.i.d. hypothesis fails.
- Differentiate sample complexity of computational efficiency.
- Explain why a PAC guarantee does not replace a test set.
2.3 Training and Testing
A hypothesis is chosen because it adjusts to the available data. Evaluating it in the same examples used to choose it produces an optimistic estimate: the model has already had the opportunity to adapt to the particularities of this sample. To estimate generalization, we need data that have not participated in the choices.
The usual practice divides the observations into sets with distinct roles:
- training: adjusts model parameters;
- validation: chooses hyperparameters, features, architecture and thresholds;
- test: estimates once the performance of the final configuration.

Figure 2.3. Training data adjust parameters, validation guides choices and the test remains isolated until the final evaluation.
2.3.1 Parameters and hyperparameters
Parameters are learned directly by the training algorithm. In a linear function, are weights and bias.
Hyperparameters control the method, but are not adjusted by the same minimization. Examples include learning rate, regularization intensity, number of layers, depth of a tree and number of neighbors.
Training in produces
where represents a hyperparameter configuration. Validation chooses
Only after fixing did we evaluate the final configuration in the test.
2.3.2 Holdout
In the holdout protocol, we make a single division of data. An illustrative proportion is
There is no universal proportion. With millions of examples, a small fraction can form a precise test. With few data, booking a large part over-reduces training and makes validation unstable.
The division must be made before the exploitation guided by the labels. A registered pseudo-random seed allows to reproduce the partition, but testing many seeds and choosing the most favorable also constitutes a form of overfitting.
Test is not validation
If a decision changes after we observe the test result, then the test participated in the development. It should be considered validation, and a new independent set will be required for final evaluation.
2.3.3 Independence and representativeness
The validity of the holdout depends on training, validation and testing representing the use scenario without sharing undue information. In an i.i.d. random division, we expect the subsets to have similar distributions.
However, simple random division is not adequate in all cases:
- in time series, the future cannot appear in the training of a prediction of the past;
- in patient data, records of the same person should not stay in different subsets;
- in images extracted from a video, neighboring frames are almost duplicated;
- on recommendation, we may want to test users or items not yet observed;
- in geographical implementation, it may be necessary to reserve whole regions.
The unit of independence must correspond to the use. If the prediction will be made for new people, the division must occur per person, not per record.
2.3.4 Stratified split
In unbalanced classification, a purely random division can produce few examples of the rare class. stratification preserves approximately the proportions of the classes in each subset.
If there are examples, of which are positive, a stratified division of places approximately positives in the training and in the test.
Stratifying does not create new information and does not solve an extremely rare class. Nor should it violate groups or time. When there are several restrictions, we use a strategy that first respects the causal structure of the dataset.
2.3.5 Data leakage
Leak occurs when information not available at the actual time of forecast influences training or evaluation. The result looks better than the system will be in production.
Examples:
- normalize using average and deviation calculated on all data;
- choose features observing correlation in the test set;
- assign missing values before division;
- include a variable registered after the expected event;
- keep copies of the same example in training and testing.
All preprocessing that learns some amount should be adjusted only in training.
and are calculated in and then applied, without adjustment, to validation and testing.
A pipeline gathers preprocessing and model for each step to be adjusted within the correct protocol.
2.3.6 Cross validation -fold
When data is limited, a single validation can depend a lot on division. In cross-validation -fold, we separate development data into blocks approximately equal:
For each , we train in all blocks except and evaluate in . The estimate is
where was trained without the block.
Each example participates in validation once and training times. Common values are or , but the choice depends on the computational cost and amount of data.
It is important that the final test remains out of cross-validation. We use folds to choose the configuration; then we train the configuration chosen in the development data and evaluate it in the isolated test.
2.3.7 Stratified and grouped cross-validation
Cross-validation also needs to respect the data structure.
- Strategic**:** preserves class proportions in each fold.
- By groups: keeps all examples of a group in the same fold.
- Temporal: uses blocks that respect order, training in the past and validating in the future.
In time forecast, a progressive form is
followed by
This mimics the way the system will accumulate history and make future predictions.
2.3.8 Repeated random sampling
The holdingout repeated, also called random subsampling, creates several random divisions training-validation . For each repetition , we train a new hypothesis and calculate a metric .
We report, for example,
and variability between repetitions. Unlike -fold, one example can appear in validation several times and another not once.
This protocol measures the sensitivity of the procedure to data division. The values are not entirely independent because the partitions overlap; the dispersion should be interpreted as diagnosis, not automatically as a classic confidence interval.
2.3.9 Nested cross validation
If we use cross-validation both to choose hyperparameters and to estimate performance, we can achieve optimism. nested cross-validation uses two levels:
- internal folds choose hyperparameters;
- an external fold, which did not participate in the choice, evaluates the procedure.
The external cycle estimates the performance of the complete selection process. This method is useful when the set is small and many configurations are compared, although it is computationally more expensive.
2.3.10 Test confusion matrix
For classes, we set the matrix by
In this convention, lines are true classes and columns are predicted classes. The diagonal contains correct answers; elements outside the diagonal show which classes have been confused.
One example is
| target forecast | class 1 | class 2 | class 3 |
|---|---|---|---|
| class 1 | 7 | 2 | 1 |
| class 2 | 1 | 8 | 1 |
| class 3 | 1 | 0 | 9 |
Accuracy is
The matrix is more informative than the isolated accuracy because it reveals the direction of errors.
2.3.11 Uncertainty of the test estimate
The performance observed in the test is still a random estimate. For classification, if test examples are approximately independent and the observed error rate is , an approximate standard error is
With and ,
A small test produces an unstable estimate. For proportions close to or , small samples or dependency between examples, we should use appropriate interval methods instead of relying only on this approximation.
2.3.12 Choice of threshold
Probabilistic models often produce a score. Choosing a threshold based on the test leaks information. The correct procedure is:
- train the model in training;
- choose the threshold in the validation, considering the metric or the cost;
- freeze model and threshold;
- evaluate both in the test.
The same goes for selection of features, regularization, number of seasons and any performance-guided decision.
2.3.13 A recommended protocol
For a typical supervised project:
- set the division unit and reserve the test;
- build a pre-processing and model pipeline;
- use training and validation, or cross-validation, for choices;
- record the final configuration;
- if appropriate, adjust this configuration in more validation training;
- evaluate once in the test;
- report metrics, uncertainty, size of sets and division strategy;
- monitor distribution change after implantation.
Refit in training more validation is allowed after all choices are frozen. The test remains isolated. If the test result motivates a new change, another round of development starts and you will need to get an independent final evaluation.
2.3.14 Reproducibility
A reproducible assessment records:
- version and origin of the data;
- inclusion and exclusion criteria;
- identifiers or indexes of each partition;
- random seed;
- pre-processing steps;
- hyperparameters and selection criteria;
- metrics and their definitions;
- code version and dependencies.
Recording only the seed is not enough if the data or library changes.
2.3.15 Relationship with the theory
The PAC theory asks when the empirical risk approaches the expected risk under certain hypotheses. The training-validation-test protocol provides an operational evaluation for a concrete data set.
This book uses theoretical analyses to understand algorithms, but computational examples should keep separate evaluation whenever they affirm predictive performance. We should not rely only on training error.
Golden rule
Any data used to choose the model belongs to the development process. Only data that remained untouched can support an honest final evaluation.
2.3.16 Practice exercises
- Differentiate parameters, hyperparameters and metrics.
- Explain why normalizing before division causes leakage.
- Propose a suitable division for multiple queries from the same user.
- In what situation is a temporal division necessary?
- Describe the cross-validation procedure -fold.
- Differentiate repeated holdout and cross-validation.
- Why does nested cross-validation reduce selection bias?
- Calculate the accuracy of the presented confusion matrix and the recall of class 2.
- For and , calculate the approximate standard error.
- Explain what to do if the test result motivates a new choice of model.
2.4 Multiple choice exercises
Check the only correct alternative in each question. The comment is collected at the end of the section.
-
The zero-one loss of a classifier is when:
- the forecast is correct.
- the forecast differs from the true label.
- the predicted probability is exactly .
- the test set is empty.
-
In a medical application in which no longer detecting a disease is very serious, What measure deserves special attention?
- Revocation of the positive class.
- Number of features.
- Rounding error.
- Cardinality of the exit space.
-
Compared to the mean squared error, the mean absolute error is generally:
- more sensitive to atypical values.
- less sensitive to atypical values.
- always equals zero.
- applicable only to classification.
-
In binary cross-entropy, assign close to zero probability to the event that actually occurred produces:
- loss close to zero.
- negative loss.
- very high loss.
- no change in loss.
-
In the PAC language, the parameter controls:
- the desired error or precision tolerance.
- the number of classes of the problem.
- the seed of the random generator.
- the cost of a matrix multiplication.
-
In the context of the PAC, represents:
- the rate of learning.
- the level of confidence of the guarantee.
- the exact empirical error.
- the number of hypotheses.
-
If we increase the complexity of the hypothesis class and keep the others factors, the amount of data required for the same warranty tends to:
- decrease to zero.
- always remain identical.
- increase.
- become independent of .
-
What practice characterizes data leakage?
- Adjust the normalizer only with training.
- Choose hyperparameters using validation.
- Calculate mean and deviation with the whole set before division.
- Evaluate once in the test at the end.
-
When several observations belong to the same patient, the safest division is:
- draw each observation independently.
- keep all observations of each patient in the same subset.
- duplicate rare patients in the test.
- use training and testing with the same patients required.
-
After the test set influenced a model choice, it should be treated as:
- part of the development process, and a new final evaluation requires Untouched data.
- a final test still perfectly independent.
- a set without any use.
- a training sample without labels.
Answer key with explanations
- b. Zero-one loss records error with and hit with .
- a. The recall measures the fraction of the real positives that have been detected and, therefore, it shows false negatives.
- b. The square amplifies large residuals; the absolute value grows only linearly.
- c. Logarithm strongly penalizes reliable and incorrect predictions.
- a. expresses how close to desired performance the result should to be.
- b. limits the probability of failure; thus, is the trust.
- c. A richer class requires more evidence to control the selection between Your chances.
- c. Statistics would incorporate information from sets that should Stay independent.
- b. Group separation prevents patient specific information appear simultaneously in training and evaluation.
- a. All information used to decide is integrated into development; the final estimate requires new independent data.