Classification tree 2026-10-14
A classification tree partitions predictor space recursively and attaches a class probability vector to each terminal region. For a categorical response, a fitted leaf commonly uses its observed class proportions and predicts their largest entry. Binary numerical splits compare one coordinate with a threshold. Growing a tree greedily by reducing classification-tree deviance gives an interpretable rule but does not globally optimize the tree. Cost-complexity tree pruning and cross-validation control complexity and assess prediction error.
Generalization is the ability of a fitted prediction rule to perform well on new observations under a specified target probability distribution. It is assessed through prediction error rather than training error. The target distribution and use of data are part of the question: dataset shift can change performance, and data leakage can make an apparent assessment misleading.
Misclassification rate Created 2026-10-14 Updated 2026-10-20
The misclassification rate is the expected zero-one loss of a classification in statistical learning rule. Its empirical version is the fraction of incorrectly labeled observations. Evaluation on the fitting sample gives a training error; evaluation on an independent test set estimates prediction error. For a majority-class leaf of a classification tree, the training error count is , unlike classification-tree deviance, which also uses the fitted class probabilities.
For an intelligent agent that must perceive a changing world and reason about new combinations of objects and goals, a hybrid of learned representations and structured computation is the most defensible choice. The distinction concerns representation and operations, not whether the implementation is a computer or a biological neural network.
In symbolic computation, identifiable tokens stand for entities, properties or relations, and explicit procedures manipulate structured expressions. A planner might represent and apply an action rule with preconditions and consequences. The same rule can apply to different objects by substituting their tokens. Subsymbolic computation instead operates on quantities such as distributed activity vectors and learned connection weights; a concept need not correspond to one independently inspectable token. A neural network can transform an image into an action tendency through many interacting units without an explicit list of logical propositions.
The physical symbol system hypothesis made structured symbolic processing a proposed basis for general intelligence. Its accompanying account of search explains how a system can construct and test candidate solutions. This is a substantive empirical hypothesis about intelligent computation, not a theorem that all intelligent behaviour must have one implementation.[ref]
Symbolic computation has strong advantages when a task already has a reliable relational description. A route planner can combine a newly learned destination with familiar movement rules, enforce a safety constraint explicitly, and revise a plan after a route is blocked. Its intermediate states can expose why an action is permitted. However, perceptual input does not arrive as a clean set of symbols. Identifying objects, deciding which relations matter and connecting tokens to sensory consequences constitute a symbol grounding problem. Large rule sets also face combinatorial search and brittle assumptions about uncertain or changing situations. Explicit representation does not guarantee that the rules are correct or that the search is tractable.
Subsymbolic computation is attractive for perception and motor coordination because statistical learning can exploit regularities in noisy, high-dimensional observations. Shared features allow a learned representation to generalize across similar inputs, and differentiable models can be optimized jointly with a task objective. Yet good interpolation is not the same as compositional generalization. A system can recognize familiar combinations while failing to recombine a familiar operation with a newly learned primitive. A plausible-looking output also need not satisfy a constraint or reflect calibrated uncertainty.
A useful computational test used artificial navigation commands paired with action sequences. Recurrent sequence models generalized well on ordinary splits but much less reliably on splits requiring systematic recombination of primitives and operators. The controlled split is crucial: high accuracy when train and test combinations resemble one another does not test the same claim as transfer to held-out constructions. This result constrains the tested training procedures and inductive biases; it does not prove that every recurrent neural network is incapable of compositional computation.[ref]
Evidence also argues against equating useful symbolic structure with a hand-written, deterministic rule book. In one-shot character learning, a probabilistic model represented a character through a generative drawing program and inferred that program from a small amount of evidence. It was tested on recognizing new examples and generating plausible variations, with comparisons to human performance. The study shows how Bayesian inference, reusable parts and structured generative programs can work together; it does not establish a universal advantage over every future deep learner or solve general agency.[ref]
The two approaches can therefore interact. A learned visual representation can propose objects and uncertain relations; a structured world model can evaluate actions and enforce constraints; sensory prediction errors can revise the representation. Conversely, a neural network can implement operations over structured variables, and a symbolic program can manipulate probabilities and call a learned perceptual module. A binary division into “rules” and “learning” misses these possibilities.
For viability, I would compare intelligent agents under the same sensory inputs, experience budget and action constraints. Tests should include novel combinations, changing goals, noisy observations, transfer after an intervention, and the computational cost of planning. The intelligent agent must learn which aspects of the environment can be trusted and detect when its abstractions fail. Learned distributed computation is particularly useful for acquiring representations; structured, uncertainty-aware computation is particularly useful for flexible recombination and planning. Their integration is a stronger proposal for broad agency than an unsupported claim of universal superiority for either alone.
Learning theory explains pathological behaviour through representations, action selection, controllability and retrieval as well as through prediction errors; mathematical description becomes explanatory only when those quantities are connected to people, environments and interventions. A useful computational psychiatry account identifies the problem a person faces, the information available, the internal representation and the rule selecting an action. A fitted learning rate alone does not establish the cause of a mental disorder.
First, distinguish goal-directed action from habit. A goal-directed controller evaluates outcomes using their current value, whereas a habit can repeat a previously acquired stimulus–response policy despite a changed outcome. An illustrative mixture is
If washing formerly relieved distress, lowering the presently expected benefit need not immediately eliminate washing when the habitual component remains influential. This formulation distinguishes an erroneous threat appraisal from failure to use an accurately represented outcome. Either can produce repetitive behaviour, so persistence alone does not distinguish the mechanisms.
An outcome devaluation experiment makes the distinction testable. In Claire M. Gillan's study, people learned button responses to pictured stimuli for outcomes; instructions then made selected outcomes worthless, and a speeded slips-of-action test required withholding their associated responses. Participants with OCD showed poorer outcome knowledge and greater devaluation-insensitive responding despite acquiring the trained responses. This supports deficient goal-directed control rather than demonstrating exceptionally strong habit acquisition. Medication, task understanding and the difference between laboratory responses and actual compulsions limit the inference.[ref]
Second, action-outcome contingency separates frequent adversity from absent control. Define for an aversive outcome . With experimental action assignment, values indicate that acting protects against the outcome, whereas supplies no such control. A learner who generalises zero control to a new situation may stop trying even when a useful action has become available. This is a route to helpless behaviour without merely asserting a large negative prediction error. Observational conditional probabilities require caution because an action may be chosen precisely when danger is greatest.
The motivating yoked-control logic holds exposure constant while changing whether a response terminates it. In rodent experiments, Jose Amat and colleagues linked the protective effect of control to medial prefrontal cortex regulation of the dorsal raphe nucleus: prefrontal inactivation removed that protection. The circuit findings constrain a purely abstract account of learned helplessness, but neither the rodent procedure nor reduced escape defines human depression.[ref]
Third, negative reinforcement can make avoidance locally successful and globally disabling. Leaving a feared situation removes distress, strengthening escape, while preventing experience that the situation would have been safe. The crucial informational question becomes whether safety is attributed to the environment or to the escape response. In a human conditioning experiment, retaining an avoidance button during otherwise unreinforced cue presentations preserved threat expectancy and skin conductance responses when the button was subsequently unavailable. This supports a mechanism by which safety behavior can obstruct corrective learning.[ref]
Fourth, retrieval is context dependent. An old fear association and subsequent extinction learning can coexist; the action observed depends on which learned association guides responding. In rat conditioned-suppression experiments, extinguishing a cue outside its acquisition context allowed fear renewal on return. Thus relapse can reflect a retrieval change rather than a failure to acquire anything during treatment. The account motivates practising safety across settings and testing retention outside the treatment room.[ref]
Mathematics also exposes ambiguity. For softmax action choice,
The choice-value scale non-identifiability follows because rescaling every value by and replacing by leaves all choice probabilities unchanged. Choice data alone cannot identify both scales. What appears to be low reward valuation may instead be noisy choice, a representation difference or a poorly specified task. Parameter recovery, independent measurements, alternative-model comparison and predictions for new conditions are therefore necessary.
Finally, psychopathology involves suffering, impairment, bodily state, development and social circumstances. The same observed withdrawal can be adaptive in a dangerous environment and disabling elsewhere. A mathematical objective does not decide whose goals matter or whether a preference warrants clinical concern. Accounts must incorporate the person's history and meaning, ascertain distress and functional impact, and test feasible interventions. The strongest explanation combines formal constraints with biological and behavioural evidence and a contextual clinical formulation; a compact equation is a tool, not a diagnosis.
The formula makes species the categorical response and the dot denotes all four other columns as candidate predictors. The classification tree is grown by recursive binary partitioning, not by fitting a linear regression to numerical species codes. At a node , count observations of each class, , and set . These are the multinomial maximum-likelihood probabilities. The classification-tree deviance is
For each candidate predictor and threshold, calculate and choose the largest permitted decrease. Continue recursively until a node is pure or the stopping controls prevent another split, for example because it has too few observations or insufficient deviance to warrant further growth. Only petal length, petal width and sepal length appear in the selected splits; sepal width was available but did not win a split. This greedy construction need not find a globally optimal tree. The default deviance criterion and recursive partitioning are documented in the tree package manual.
Each node number encodes its position: node has left and right children and . The reported sample size is the number reaching the node; its deviance is calculated from that node's class counts. The fitted class is the class with largest fitted probability, with a convention resolving ties. The root's three counts are equal, so its displayed class is only a tie choice. An asterisk marks a terminal node, where prediction stops.
The resulting rule is displayed below. A left edge satisfies the stated strict inequality and a right edge its complement. None of the recorded training values lies exactly at these midpoint thresholds; the diagram adopts the right branch at equality for prediction.
Figure 1.
The fitted six-leaf iris classification tree, with split thresholds and training errors
. Details.
Its six terminal regions have the following derived class counts, in the order setosa, versicolor, virginica:
The root split identifies all 50 setosa observations. Among the remaining specimens, the petal-width split is the principal separation of versicolor from virginica; further petal-length and sepal-length splits refine it. The leaf errors add to . The leaf deviances add to
Dividing by the software's residual degrees-of-freedom convention gives , as reported. The root deviance is . The deviance is a likelihood measure, whereas the error rate counts wrong majority-class predictions; these are different fit summaries.
Both quantities are in-sample, so the low error does not establish prediction accuracy on new specimens. Cost-complexity tree pruning, with tree size chosen by cross-validation, can remove weak splits and reduce overfitting. An independent test set is needed for a final estimate of the selected tree's prediction error.
The association is strongly statistically significant under the reported regression assumptions, but age alone has only moderate predictive ability. The reported confidence interval for the age regression coefficient excludes zero by a wide margin. If it is the usual two-sided 95% interval from a normal linear model with an intercept and one predictor, there are degrees of freedom. Taking gives
Thus the two-sided p-value against zero slope is far below . This conclusion concerns a statistical association in the sampled population; it does not establish an individual growth rate. Clustering by practitioner, nonconstant variance or nonindependent observations would require an appropriate standard error rather than blind reliance on this calculation.
The scatter plot has substantial vertical spread at each age. A narrow slope confidence interval describes uncertainty about the average trend, whereas a prediction interval for a new person's ear length must also include the residual variance. The reported interval even permits an approximate numerical assessment: write and let . In simple linear regression, , while the fitted and residual sums of squares are and . Hence the coefficient of determination is
Under these assumptions, age explains only about 27% of the sample variation; roughly 73% remains unexplained. The calculation is approximate because the printed slope and interval are rounded. For a new individual aged , the usual prediction interval is based on
The leading one represents individual residual variation. The provided summaries do not determine and separately, so they do not supply a numerical prediction interval.
Record sex, height or another measure of body size, ancestry, family characteristics and practitioner or measurement method. Use these covariates in a multiple linear regression, allowing scientifically justified nonlinear age effects or interactions, and assess prediction error on held-out observations. A guessed overall sex proportion cannot replace individual sex measurements or identify sex-adjusted effects.
There is a source inconsistency: the PDF's numerical ear-length summary is ten times the scale of its plotted measurements and fitted line. Indeed, the fitted line at the reported mean age gives about mm, whereas the printed mean is about ten times larger. Missing decimal points in the summary are a plausible explanation. The significance and approximate above use the mutually consistent slope, interval and graph; they do not treat the inconsistent summary as valid data.
The classification form of CART starts with the root rectangle . For any current region , let and let
be its empirical class proportion and Gini impurity. A candidate axis-aligned split partitions into and . Its impurity change is
Among all coordinates and thresholds between consecutive observed coordinates, CART chooses a split minimizing , then applies the same recursive partitioning independently to the children until a stopping rule is met. Each terminal region predicts its majority class. Pruning may then select a smaller subtree by penalizing the number of leaves.
For the resulting classifier , the training error is
while its prediction error is for an independent observation drawn from the target population.
Residual sum of squares Created 2026-09-24 Updated 2026-10-14
The residual sum of squares measures how far the observed responses lie from their fitted values. If is the th regression residual, then
It is the squared Euclidean norm of the regression residual vector. Squaring prevents positive and negative deviations from cancelling and gives large deviations more weight. In the constructed five-point example in linear regression, the regression residuals are , so the residual sum of squares is .
Ordinary least squares minimizes the residual sum of squares over the chosen linear regression family; ridge regression minimizes the residual sum of squares plus a penalty. Consequently the ridge regression fit can have a larger residual sum of squares than the ordinary least squares fit on exactly the same design matrix. For the one-predictor construction in ridge regression, the residual sum of squares rises from to when the penalty changes from to ; that increase is the cost of shrinking the fitted slope.
Dividing the residual sum of squares by gives the training error for squared-error loss, not an estimate based on fresh responses. Its units are squared response units, and it adds across observations, so raw totals need not be comparable across different response scales or sample sizes. Comparing fits to the same responses is useful, but choosing a ridge regression penalty by minimum training residual sum of squares favors the unpenalized fit. Assess prediction error using a validation set or cross-validation instead.[ref]
Statistical learning Created 2026-09-24 Updated 2026-10-14
Statistical learning constructs predictive rules from data and studies their prediction error, generalization, and computational fitting. In supervised learning, training data contain inputs and a response variable : regression analysis predicts a numerical response, while classification in statistical learning predicts a label. Unsupervised learning instead seeks structure without supplied responses, as in cluster analysis and principal component analysis. These tasks connect learning to probability and mathematical optimization. [ref]
For a fitted rule and loss function , the predictive goal is
where is a fresh observation, independent of the training data , from the intended target probability distribution. This prediction error fixes the fitted rule and averages over future observations; averaging again over training data gives the learning procedure's average performance. Its practical beauty is that a rule compresses past observations into useful future predictions. Its central difficulty is that excellent training error need not imply good generalization: cross-validation supports model selection, and a reserved test set assesses the resulting choice.
Statistical learning theory Created 2026-09-24 Updated 2026-10-13
Statistical learning theory studies mathematical guarantees and limitations for learning from data, including how a hypothesis class, loss function, and sample size affect generalization. It distinguishes a particular fitted rule's prediction error from the expected performance of the learning procedure across possible training data.
Test set Created 2026-09-28 Updated 2026-10-14
A test set is held out from both parameter fitting and model selection and is used to estimate the final selected procedure's prediction error. A validation set influences the choice; a test set assesses that choice after it is fixed. The distinction concerns how observations are used, not their file names.
For a fixed rule and an independent test set of size from the target probability distribution,
This test error is an estimate, with sampling uncertainty; it is not a guarantee for each future prediction. Dataset shift changes what performance the estimate represents.
In the overfitting example, all degree choices are fixed in advance, cross-validation uses only training data, and the selected degree is locked before evaluating 400 separate points. Displaying the other curves afterward explains their behavior; it does not authorize selecting by those scores. Repeatedly inspecting a test set and changing the model makes it part of model selection, introducing data leakage and potentially optimistic assessment. [ref]
Training error Created 2026-09-24 Updated 2026-10-14
Training error is the average loss function evaluated on the observations used to fit the prediction rule. It is the empirical risk of the fitted rule on its own training data. With squared-error loss, it is the average squared regression residual, measuring fit to observed responses rather than performance on fresh responses. Flexible fitting usually makes it optimistically biased for prediction error, as quantified by prediction optimism.
For a reproducible polynomial regression example, take , , and the known noiseless target . Construct responses with fixed disturbances
Ordinary least squares over polynomials of polynomial degree at most 1, 2, and 7 gives training errors , , and . The monotone improvement follows because these candidate families are nested: every smaller-degree fit remains available in the larger family. This argument concerns minimum training error, not generalization, and assumes the fitting mathematical optimization is solved. Degrees 2 and 7 fitted instead to the exact noiseless responses have mathematically zero training error; the script obtains approximately and from rounding. Extra flexibility alone does not force overfitting.