ML-08 · MACHINE LEARNING

결정나무·불순도·분할·가지치기Trees, impurity, splitting and pruning

한 질문과 잎 평균에서 실제 전체 자료·정확 가지치기·접힘별 검증까지From one question and a leaf mean to complete actual sources, exact pruning and foldwise validation

실습 6종 · 풀이 포함 연습문제 60개6 labs · 60 exercises with solutions

학부 심화 · 선택Advanced undergraduate · optional

한 질문에서 예측 규칙으로From one question to a prediction rule

친구가 “어떤 고객이 서비스를 그만둘까?”라고 묻는다고 합시다. 모든 고객에게 같은 답을 주는 대신, 먼저 통화 실패 횟수를 묻고, 답에 따라 다음 질문을 다르게 할 수 있습니다. 결정나무는 이렇게 순서가 정해진 질문으로 관측을 작은 집단으로 나눈 뒤, 마지막 집단의 훈련 기록으로 예측하는 규칙입니다. 사람의 성격을 알아내는 마법이 아니라, 정한 자료와 손실에서 만들어진 계산 가능한 규칙입니다.

이 장은 실제 자료 세 종류를 사용합니다. 국가 사례의 목표는 기대수명(년), 개인 사례는 1976년 명목 시급(USD/시간), 기업 사례는 통신 고객의 원래 이탈 표시 0/1입니다. 앞의 두 목표는 수치 예측인 회귀, 마지막은 정해진 범주의 확률을 예측하는 분류입니다. 같은 나무 그림을 쓰더라도 목표와 오차의 단위는 다릅니다.

먼저 네 개의 가정 관측으로 모든 계산을 손으로 해 봅니다. 이후 전체 원자료와 훈련·검증·외부 시험의 경계를 공개한 세 사례로 돌아옵니다. 질문을 많이 하면 훈련 기록을 잘 외울 수 있지만 새 관측을 더 잘 맞힌다는 보장은 없습니다. 이 장의 중심 질문은 “얼마나 복잡하게 나눌 것인가, 그 선택을 어떤 자료로 평가했는가?”입니다.

Imagine asking which customers may leave a service. Instead of giving everyone the same answer, ask about call failures, then choose another question depending on the answer. A decision tree partitions observations through ordered questions and predicts from training records in the final group. It is a reproducible rule for stated data and loss, not a discovery of someone’s essential character.

We use three actual sources: country life expectancy in years, nominal hourly wages in a 1976 male cohort in USD/hour, and a telecom dataset’s recorded churn category 0/1. The first two are regression targets; the last is classification with declared categories. Similar diagrams do not make their targets, units or error costs interchangeable.

Begin with four assumed observations whose calculations fit on paper. Then return to complete source records and explicit training, validation and outer-test boundaries. More questions can memorize training records without improving new predictions. Ask how complex the rule should become and which observations were allowed to choose it.

학부 심화 · 선택Advanced undergraduate · optional

관측·목표·손실·훈련의 경계Observation, target, loss and training boundaries

한 행에는 식별자 id, 예측할 때 사용할 특징 X, 학습할 목표 Y, 선택한 무게 w가 있습니다. 가정 관측의 X가 [1,2,3,4], Y가 [2,4,8,10]이면 X가 작은 쪽과 큰 쪽의 Y가 다르다는 규칙을 찾을 수 있습니다. 새 관측의 Y는 예측할 때 알 수 없으므로, 새 행을 어느 잎으로 보낼지 결정하는 데 넣지 않습니다.

특징에 들어갈 수 있다는 것과 예측 시점에 알 수 있다는 것은 다릅니다. 국가 사례의 같은 해 GDP·물가와 기대수명은 보존 빈티지의 사후 자료입니다. 이 장은 과거 수치로 회귀 규칙을 비교하는 실습이지, 미래 GDP를 미리 안 실제 운영 예측이라는 주장이 아닙니다. 기업 사례도 원 제공자가 밝힌 입력 기록 기간과 이후 이탈 표시의 시간 관계를 따로 확인합니다.

훈련은 문턱과 잎 예측을 만드는 데, 내부 검증은 가지치기 정도를 고르는 데 씁니다. 마지막 외부 시험은 그 선택을 마친 뒤 한 번 평가하는 다른 역할입니다. 외부 목표를 보고 마음에 드는 나무를 다시 고르면 그 표는 더 이상 보지 않은 시험이 아닙니다. 같은 사람·국가가 반복되면 행 순서뿐 아니라 집단과 시간 경계도 기록해야 합니다.

Each row has an identifier, predictor features X, a target Y and a chosen weight w. In an assumed sample X=[1,2,3,4], Y=[2,4,8,10], small and large X values have different outcomes. A new row’s unknown Y cannot determine its route through the tree. Routes use features, while observed training targets determine the rule.

A feature existing in a file does not establish that it was known at issue time. Our country exercise supplies same-year GDP, inflation and life expectancy retrospectively from a retained vintage. It compares historical regression rules, not a deployed forecast with advance knowledge of GDP. The churn example separately records the source’s input and outcome periods.

Training constructs thresholds and leaf predictions; internal validation chooses pruning; an outer test evaluates the resulting choice. Selecting another model after inspecting outer labels consumes the supposedly unseen exam. With repeated people or countries, document group and time boundaries as well as row order.

학부 심화 · 선택Advanced undergraduate · optional

노드·가지·잎과 새 사람의 경로Nodes, branches, leaves and a new person’s path

질문이 시작되는 맨 위를 뿌리(root), 질문이나 예측이 놓인 자리를 노드(node), 답을 따라가는 연결을 가지(branch), 더 묻지 않고 답을 내는 자리를 잎(leaf)이라고 부릅니다. 이 장에서는 뿌리의 깊이를 0으로 셉니다. 뿌리에서 질문 하나를 지나면 깊이 1이며, “잎이 세 개”와 “깊이가 세 단계”는 같은 뜻이 아닙니다.

가정한 규칙이 “X≤5/2이면 왼쪽에서 3, 아니면 오른쪽에서 9”라면, 새 X=2는 왼쪽의 3, X=3은 오른쪽의 9를 받습니다. 문턱과 정확히 같은 X=5/2도 ≤ 약속에 따라 왼쪽입니다. 3과 9는 각각 훈련 Y=[2,4]와 [8,10]의 평균이며 새 사람의 실제 목표를 읽어 만든 답이 아닙니다.

한 경로에는 사용한 특징·문턱·답의 순서를 모두 남길 수 있습니다. 해석하기 쉬운 경로가 곧 인과 설명이라는 뜻은 아닙니다. “이 규칙은 X 때문에 이 잎으로 보냈다”는 계산 설명과 “현실에서 X를 바꾸면 Y가 그렇게 변한다”는 개입 주장은 다른 질문입니다. 실제 사례에서는 각 잎에 어떤 원행이 남았는지도 함께 확인합니다.

The top is the root, a question or prediction occupies a node, answers follow branches, and a leaf stops questioning and produces a prediction. Root depth is zero here; one question takes a route to depth one. Three leaves and depth three describe different properties of a tree.

Consider the assumed rule “if X≤5/2, predict 3; otherwise predict 9.” New X=2 receives 3 and X=3 receives 9. An observation exactly at 5/2 follows the declared ≤ branch. Predictions 3 and 9 are the means of training outcomes [2,4] and [8,10]; the new observation’s actual target was not consulted.

A route records the feature, threshold and answer at every step. A readable computational explanation is not automatically causal: explaining why this rule selected a leaf differs from establishing what an intervention on X would do to Y. Inspect the original training memberships of leaves alongside their routes.

학부 심화 · 선택Advanced undergraduate · optional

평균은 왜 제곱오차를 줄이는가Why a mean minimizes squared loss

한 잎에 Y=[2,4,8,10]이 있고 모두에게 같은 수 a를 예측한다고 합시다. 제곱오차 합은 (2−a)²+(4−a)²+(8−a)²+(10−a)²입니다. 평균 6을 넣으면 16+4+4+16=40, 5를 넣으면 9+1+9+25=44입니다. 작은 수 하나가 아니라 잎 전체의 오차를 줄이는 하나의 대표값을 찾는 문제입니다.

왜 평균이 항상 이기나요? Yᵢ−a=(Yᵢ−평균)+(평균−a)로 나누어 제곱을 전개하면, 평균에서의 편차를 합한 항이 0이라 교차항이 사라집니다. 남는 것은 평균에서의 제곱오차 합에 n(a−평균)²를 더한 식입니다. 두 번째 항은 음수가 아니므로 평균이 최소입니다. 양의 전체 무게 W에서도 같은 논리가 성립합니다.

목표 단위가 USD/시간이면 평균도 USD/시간, SSE는 (USD/시간)²×무게입니다. W로 나눈 MSE는 제곱 단위입니다. 절대오차를 최소화하면 보통 평균이 아니라 중앙값의 문제로 바뀝니다. 이 장의 회귀 나무는 가중 제곱오차와 가중 평균을 한 세트로 사용하므로, 손실 이름을 바꾸지 않은 채 잎의 평균만 다른 수로 바꾸지 않습니다.

yˉw=∑iwiyiW,W=∑iwi>0,∑iwi(yi−a)2=∑iwi(yi−yˉw)2+W(a−yˉw)2\bar y_w=\frac{\sum_iw_iy_i}{W},\quad W=\sum_iw_i>0,\qquad \sum_iw_i(y_i-a)^2=\sum_iw_i(y_i-\bar y_w)^2+W(a-\bar y_w)^2

Put assumed outcomes [2,4,8,10] in one leaf and predict one number a for everyone. Squared-error sum is (2−a)²+(4−a)²+(8−a)²+(10−a)². At the mean 6 it is 40; at 5 it is 44. We seek a representative that minimizes the loss across the whole leaf, not the smallest possible prediction.

Write each residual as (Yᵢ−mean)+(mean−a), then expand its square. The centered deviations sum to zero, eliminating the cross term. What remains is SSE at the mean plus n(a−mean)². The second term cannot be negative. The same argument uses a weighted mean when total nonnegative weight W is positive.

A wage prediction retains USD/hour; SSE has squared wage units times weight, and SSE/W has squared wage units. Absolute-error minimization instead leads to medians. Our regression trees pair weighted squared loss with weighted means, so changing the leaf representative without changing the criterion would define a different algorithm.

yˉw=∑iwiyiW,W=∑iwi>0,∑iwi(yi−a)2=∑iwi(yi−yˉw)2+W(a−yˉw)2\bar y_w=\frac{\sum_iw_iy_i}{W},\quad W=\sum_iw_i>0,\qquad \sum_iw_i(y_i-a)^2=\sum_iw_i(y_i-\bar y_w)^2+W(a-\bar y_w)^2
학부 심화 · 선택Advanced undergraduate · optional

다수결과 확률 벡터는 다르다A majority vote differs from a probability vector

분류의 목표는 숫자의 크기를 맞히는 문제가 아닐 수 있습니다. 잎에 A,A,A,B가 있다면 경험 비율은 (3/4,1/4)입니다. 가장 많은 범주를 하나 고르면 A이지만, 확률 벡터에는 B의 비율도 남습니다. “A라고 분류한다”와 “A의 훈련 비율이 3/4이다”는 다른 출력입니다. A,B를 0,1로 표시해도 1이 더 좋은 고객이라는 뜻은 아닙니다.

범주가 세 개 이상이면 모든 범주의 비율이 필요합니다. A,B,C가 각각 한 번이면 (1/3,1/3,1/3)입니다. 다수결이 동률이면 이 장은 사용자가 미리 선언한 범주 순서에서 앞선 것을 고릅니다. 범주 순서는 문제의 정의이며, 훈련이나 시험에서 많이 나온 순서로 몰래 다시 정하지 않습니다.

그 잎에서 경험 비율이 0이라고 앞으로 그 사건이 불가능한 것은 아닙니다. 작은 표본, 선택된 고객, 시점 변화가 모두 영향을 줍니다. 여기서는 보정이나 평활화를 자동 적용하지 않습니다. 확률 예측의 손실과 실제 확률 보정은 뒤에서 다시 구별하며, 이탈 위험이 높다는 예측만으로 누구에게 어떤 혜택을 주면 이탈이 줄어드는지도 알 수 없습니다.

p^k=∑iwi1{yi=k}W,c^∈arg⁡max⁡kp^k\widehat p_k=\frac{\sum_iw_i\mathbf 1\{y_i=k\}}{W},\qquad \widehat c\in\arg\max_k\widehat p_k

Classification is not necessarily about the magnitude of numeric labels. A leaf with A,A,A,B has empirical vector (3/4,1/4). A majority decision chooses A, but the probability vector retains B’s share. A class decision and an empirical probability are different outputs; coding categories as 0 and 1 supplies no ranking of customer worth.

With three categories, keep every coordinate. One observation of each gives (1/3,1/3,1/3). Majority ties follow the vocabulary order declared before fitting. We do not silently reorder categories by frequencies observed in training or testing.

An empirical zero does not establish that a future event is impossible. Sample size, selection and distribution shifts matter. No automatic smoothing or calibration is claimed. Later sections distinguish probability loss from calibration, and predictive churn risk from the effect of offering a customer an intervention.

p^k=∑iwi1{yi=k}W,c^∈arg⁡max⁡kp^k\widehat p_k=\frac{\sum_iw_i\mathbf 1\{y_i=k\}}{W},\qquad \widehat c\in\arg\max_k\widehat p_k
학부 심화 · 선택Advanced undergraduate · optional

가중치·누락 목표·빈 노드Weights, missing targets and empty nodes

무게 w는 한 행이 계산에 얼마나 기여할지를 나타냅니다. Y=2에 무게 1, Y=8에 무게 3이면 평균은 (2+24)/4=13/2입니다. 단순 평균 5와 다릅니다. 무게가 3이라고 실제 사람이 반드시 세 명 있다는 뜻은 아닙니다. 빈도·표본추출·중요도 무게는 목적이 달라 자료 사전에 의미를 써야 합니다.

목표가 null인 행은 정답을 관측하지 못했으므로 이 장의 감독학습 적합에서 제외합니다. 무게가 0인 행도 평균과 불순도에 기여하지 않습니다. 원행과 제외 이유는 보존합니다. 음의 무게는 허용하지 않고, 제외될 행이라고 잘못된 목표나 무게 토큰을 무시하지 않습니다. impurity 도구는 목표와 무게만 사용해 선택적 X를 읽지 않지만, 분할·나무 적합은 필요한 X도 검증합니다.

유효 목표의 전체 무게가 0이면 평균과 범주 비율은 정의되지 않습니다. 빈 합의 가법적 위험을 0으로 기록하는 것과, 예측이 맞아서 오차가 0인 것은 다릅니다. 그런 잎의 목표를 0으로 만들어서는 안 됩니다. 모든 검증 쌍이 미정의이면 나중의 alpha 선택도 “완벽한 점수 0”이 아니라 선택 불가가 됩니다.

A weight determines a row’s contribution. Outcomes 2 and 8 with weights 1 and 3 have mean (2+24)/4=13/2, not the unweighted mean 5. Weight three need not mean three physical people. Frequency, sampling and importance weights answer different questions and need explicit definitions.

A missing target supplies no observed supervised response; zero weight contributes no mass. Preserve both rows and exclusion reasons. Reject negative weights and malformed target/weight tokens even on excluded rows. The impurity tool uses targets and weights and ignores optional X; split and fitting tools also validate required features.

When eligible target mass is zero, a mean and class proportions are undefined. Recording zero for an empty additive risk sum is not zero error from a correct prediction. Do not invent a zero target. If every validation prediction is unscoreable, alpha selection likewise remains unavailable rather than receiving a perfect score.

학부 심화 · 선택Advanced undergraduate · optional

혼합을 재는 Gini 불순도Gini impurity measures mixture

분류 잎이 얼마나 섞였는지 재는 한 수가 Gini 불순도 G=1−Σpₖ²입니다. A,A,A,B의 비율을 넣으면 1−9/16−1/16=3/8입니다. 모두 A이면 0, A와 B가 절반씩이면 1/2입니다. 두 범주에서 값이 클수록 한 범주로 쉽게 대표하기 어려운 혼합이라는 뜻이지, 고객 집단이 나쁘다는 도덕적 평가가 아닙니다.

같은 잎의 범주 비율에 따라 서로 독립적으로 범주를 두 번 뽑는다고 생각하면, 둘이 같은 범주일 확률은 Σpₖ²이고 다른 범주일 확률은 G입니다. 이것은 훈련 비율을 이용한 가정 추출의 설명입니다. 서로 다른 실제 고객이 독립이라는 사실을 데이터가 보장했다고 해석하지 않습니다.

나무는 부모 G와 두 자식 G를 단순히 더해 비교하지 않습니다. 각 자식의 무게를 곱한 위험 WₗGₗ+WᵣGᵣ을 부모 WG와 비교해야 합니다. 무게 4인 A,A,A,B의 원 위험은 4×3/8=3/2입니다. 범주를 바꿔 부르는 것은 비율의 순서만 바꾸므로 G는 같지만, 범주 개수나 표본 구성이 바뀌면 비교의 뜻도 확인해야 합니다.

G=1−∑k=1Kpk2,Rnode=WGG=1-\sum_{k=1}^{K}p_k^2,\qquad R_{\mathrm{node}}=WG

Gini impurity is G=1−Σpₖ². For A,A,A,B it equals 1−9/16−1/16=3/8; a pure A leaf has zero and a balanced binary leaf has 1/2. A larger value indicates a more mixed classification leaf, not a moral judgment about its members.

Imagine independently drawing two categories from that leaf’s empirical distribution. Matching has probability Σpₖ², so differing has probability G. This is an explanatory sampling experiment based on training shares; it does not establish independence among actual customers.

Compare weight-adjusted risks, not an unweighted sum of child impurities. The parent risk is WG; children contribute WₗGₗ+WᵣGᵣ. For four unit-weight records A,A,A,B, raw risk is 3/2. Relabeling categories preserves G, while changing category count or sample composition can change the interpretation of comparisons.

G=1−∑k=1Kpk2,Rnode=WGG=1-\sum_{k=1}^{K}p_k^2,\qquad R_{\mathrm{node}}=WG
학부 심화 · 선택Advanced undergraduate · optional

엔트로피·0log0·단위 bitsEntropy, zero log zero and bits

엔트로피는 H=−Σpₖ log₂pₖ로 혼합을 재는 다른 수입니다. 균형 이진 잎은 −(1/2)(−1)−(1/2)(−1)=1 bit, 한 범주뿐인 잎은 0 bit입니다. 확률 3/4와 1/4에서는 약 0.811278 bit입니다. 같은 3/8 Gini와 숫자가 다르지만 오류가 아닙니다. 서로 다른 함수와 단위이므로 값을 직접 빼서 어느 기준이 더 좋다고 판단하지 않습니다.

p=0에서 log₂0을 유한한 숫자로 계산하지 않습니다. p가 0에 가까워질 때 −p log₂p의 기여가 0에 가까워지는 연속 확장에 따라 0 log 0의 기여를 0으로 정의합니다. “관측 비율 0”과 “드물지만 양수인 비율이 화면에서 0처럼 반올림됨”은 다르므로 정확 비율과 표시 상태를 함께 봅니다.

일반적으로 로그가 들어간 엔트로피는 유리수 하나로 정확히 표현되지 않습니다. 이 장은 범주 확률의 정확 분수와 로그식을 보존하고 엔트로피 소수를 근삿값으로 표시합니다. 비교 학습을 위해 값을 보여 주지만, 실제 split/tree/prune 계산은 계약에 따라 Gini 위험을 사용합니다. Gini로 고른 나무를 엔트로피로 최적화한 결과라고 바꾸어 부르지 않습니다.

H=−∑k:pk>0pklog⁡2pk,0log⁡20:=0H=-\sum_{k:p_k>0}p_k\log_2p_k,\qquad 0\log_2 0:=0

Entropy H=−Σpₖ log₂pₖ measures mixture differently. A balanced binary leaf has one bit; a pure leaf has zero. Shares 3/4 and 1/4 give about 0.811278 bit. This differs from Gini 3/8 because the functions and units differ, not because one calculation failed.

Do not evaluate log₂0 as a finite number. Define the zero-probability contribution by the limit −p log₂p→0 as p approaches zero. An exact empirical zero also differs from a positive tiny probability that rounds to zero on screen; inspect exact shares and display flags.

Logarithmic entropy generally cannot be represented by one rational number. We preserve exact probability fractions and the logarithmic expression, while labeling its decimal evaluation approximate. Entropy is displayed for comparison; this chapter’s actual split/tree/prune contract uses weighted Gini. A Gini-selected tree is not an entropy-optimized result.

H=−∑k:pk>0pklog⁡2pk,0log⁡20:=0H=-\sum_{k:p_k>0}p_k\log_2p_k,\qquad 0\log_2 0:=0
학부 심화 · 선택Advanced undergraduate · optional

불순도 실습: 같은 평균·다른 구성Impurity lab: equal means, different mixtures

실습 A는 아직 나무를 만들지 않고 한 잎의 통계만 계산합니다. 회귀 모드에서 네 행의 목표를 2,4,8,10, 무게를 모두 1로 두세요. 유효 행 수 4, 전체 무게 4, 평균 6, 원 SSE 40을 먼저 손으로 적고 화면과 비교합니다. 목표를 모두 6으로 바꾸면 평균은 그대로지만 SSE는 0입니다. 평균이 같다는 말과 모든 관측이 같다는 말은 다릅니다.

분류 모드에서는 범주 목록을 0,1로 명시하고 목표 0,0,0,1을 넣습니다. 확률 (3/4,1/4), Gini 3/8, entropy 약 0.811278 bit를 확인합니다. 목표를 0,0,1,1로 바꾸면 균형 분포가 되면서 불순도가 커집니다. 범주 순서를 1,0으로 뒤집으면 다수결 동률의 범주만 바뀌고, Gini와 각 범주에 대응하는 실제 확률은 바뀌지 않아야 합니다.

한 행의 목표를 null, 다른 행의 무게를 0으로 바꾸며 분모를 읽으세요. 무게와 행 수를 같은 수로 외우지 않습니다. 실제 개인 사례에서도 임금 결측 원행을 보존하되 유효 시급만 적합에 사용합니다. 이 실습의 출력은 한 잎의 경험 통계이며 미래 정확도·확률 보정·통계적 유의성을 자동 계산한 결과가 아닙니다.

Lab A computes one leaf before growing a tree. In regression mode use four targets 2,4,8,10 and unit weights. Write down eligible count 4, total mass 4, mean 6 and raw SSE 40 before comparing the screen. Replacing all targets by 6 preserves the mean but reduces SSE to zero; equal means do not imply equal observations.

For classification declare vocabulary 0,1 and targets 0,0,0,1. Check shares (3/4,1/4), Gini 3/8 and entropy about 0.811278 bits. Targets 0,0,1,1 form a more mixed balanced distribution. Reversing vocabulary order changes only the majority tie decision, not Gini or the probability associated with each named category.

Set one target to null and another weight to zero, reading the resulting denominators. Counts and masses need not coincide. Our actual wage case likewise retains missing source records while fitting observed eligible wages. The output is empirical leaf statistics, not an automatic certificate of future accuracy, calibration or statistical significance.

학부 심화 · 선택Advanced undergraduate · optional

회귀의 SSE와 충분한 합계Regression SSE and sufficient sums

분할 후보마다 모든 편차 제곱을 처음부터 더할 필요는 없습니다. 잎의 전체 무게 W, 가중 목표합 S=ΣwY, 제곱합 A=ΣwY²를 알면 평균은 S/W, SSE는 A−S²/W입니다. 네 가정 목표 [2,4,8,10]에서는 W=4,S=24,A=184이므로 184−576/4=40입니다. 서로 다른 W,S,A가 같은 평균을 만들 수 있으므로 평균만 저장해서는 분할의 위험을 복원할 수 없습니다.

정렬된 X에서 문턱을 오른쪽으로 한 칸 옮길 때 왼쪽 합계에 한 묶음을 더하고 오른쪽 합계에서 빼면 모든 후보를 효율적으로 계산할 수 있습니다. 같은 X값의 행들은 한 묶음으로 이동합니다. 이 장은 계산 방법의 효율을 이용하지만, 손으로 검산할 때는 실제 행을 각 후보로 나누어 직접 편차를 계산해 같은 답인지 확인합니다.

큰 수 둘의 차이 A−S²/W는 부동소수에서 작은 SSE를 잃을 수 있습니다. 예를 들어 100000001과100000003의 평균은100000002이고 SSE는 정확히2입니다. 이 장의 핵심 산술은 입력 토큰을 유리수로 보존해 비교하지만, 그 사실이 원 임금이나 경제 지표의 측정 오차를 없애지는 않습니다. 계산 정확도와 자료 정확도는 따로 읽습니다.

W=∑iwi,S=∑iwiyi,A=∑iwiyi2,SSE=A−S2W(W>0)W=\sum_iw_i,\quad S=\sum_iw_iy_i,\quad A=\sum_iw_iy_i^2,\qquad \mathrm{SSE}=A-\frac{S^2}{W}\quad(W>0)

Three sums suffice for squared-error arithmetic: mass W, weighted response sum S and weighted square sum A. Mean is S/W and SSE is A−S²/W. For [2,4,8,10], W=4, S=24, A=184, giving 184−576/4=40. A mean alone cannot reconstruct risk because different masses and square sums can share it.

Moving a threshold across ordered X values updates left sums and subtracts them from right sums. Move all records with the same X together. Efficient cumulative calculations support the implementation; for a hand check, physically partition the records at every candidate and sum centered squared residuals to check agreement.

Subtracting large nearly equal floating-point sums can lose a small SSE. Outcomes 100000001 and 100000003 have mean 100000002 and exact SSE 2. Rational input-token arithmetic preserves these comparisons here, but does not remove measurement error in wages or economic indicators. Numerical exactness and observational accuracy remain distinct.

W=∑iwi,S=∑iwiyi,A=∑iwiyi2,SSE=A−S2W(W>0)W=\sum_iw_i,\quad S=\sum_iw_iy_i,\quad A=\sum_iw_iy_i^2,\qquad \mathrm{SSE}=A-\frac{S^2}{W}\quad(W>0)
학부 심화 · 선택Advanced undergraduate · optional

후보 문턱을 순서대로 만들기Construct ordered candidate thresholds

하나의 수치 특징 X=[1,2,3,4]를 정렬하면 관측 집단을 바꾸는 경계는 1과2,2와3,3과4 사이 세 곳입니다. 이 장은 각 인접한 서로 다른 값의 정확한 중간값 3/2,5/2,7/2를 후보로 씁니다. 왼쪽은 X≤문턱, 오른쪽은 X>문턱입니다. 관측이 없는 구간의 여러 문턱은 같은 훈련 분할을 만들지만 새 관측에는 다른 답을 낼 수 있어 대표 문턱 규칙도 공개합니다.

X=[1,1,2]에서는 같은 값1 사이를 잘라 한 행만 왼쪽에 둘 수 없습니다. 후보는3/2 한 개입니다. 각 행의 원 순서는 결과 계보에 남지만, 원 순서를 이용해 같은 X값의 일부를 다른 쪽으로 보내는 규칙은 아닙니다. 특징이 여러 개면 각 특징의 후보를 따로 계산하고 위험 감소를 비교합니다.

관측 특징값이 모두 같다면 보통의 값 문턱 후보는 없습니다. 그러나 결측과 관측이 함께 있으면 “결측인가?”라는 별도 후보가 있을 수 있습니다. 목표 Y를 정렬하거나 시험 관측의 X를 포함해 후보 문턱을 만드는 것은 이 훈련 절차와 다릅니다. 나중 검증에서는 각 접힘의 훈련 X만으로 후보부터 다시 만듭니다.

sj=x(j)+x(j+1)2,x(j)<x(j+1),L={i:xi≤sj}, R={i:xi>sj}s_j=\frac{x_{(j)}+x_{(j+1)}}2,\qquad x_{(j)}<x_{(j+1)},\qquad L=\{i:x_i\le s_j\},\ R=\{i:x_i>s_j\}

For one feature X=[1,2,3,4], training membership can change at three adjacent gaps. We represent them by exact midpoints 3/2,5/2,7/2, sending X≤threshold left. Several cutpoints inside an empty gap give the same training partition but can disagree on a future value, so the representative-threshold convention matters.

For X=[1,1,2], the duplicate ones cannot be separated by a value threshold; only 3/2 is available. Original order remains in lineage, but is not a hidden tie-break that routes identical X values differently. Multiple features supply separate candidate sets compared on risk reduction.

A constant observed feature supplies no ordinary threshold. With both missing and observed values, however, a missing-only partition may still exist. Sorting targets or borrowing test-feature values to construct cutpoints defines a different training procedure. Cross-validation must rebuild candidates from each fold’s training X.

sj=x(j)+x(j+1)2,x(j)<x(j+1),L={i:xi≤sj}, R={i:xi>sj}s_j=\frac{x_{(j)}+x_{(j+1)}}2,\qquad x_{(j)}<x_{(j+1)},\qquad L=\{i:x_i\le s_j\},\ R=\{i:x_i>s_j\}
학부 심화 · 선택Advanced undergraduate · optional

가중 부모·자식 위험의 차이Compare weighted parent and child risk

가정한 X=[1,2,3,4],Y=[2,4,8,10]에서 부모 SSE는40입니다. 문턱5/2는 왼쪽 평균3, 오른쪽 평균9를 만들고 자식 SSE는2+2=4입니다. 원 위험 감소는36입니다. 원 훈련 무게4로 나누면 부모 위험10이 자식 위험1로 줄어 정규화 이득은9입니다. 같은 분모에서 무엇이 줄었는지 말로 읽으세요.

문턱3/2 또는7/2에서는 한쪽이 한 행, 다른 쪽이 세 행이어서 자식 SSE 합은56/3입니다. 정규화 이득은16/3이며 가운데 문턱의9보다 작습니다. 회귀에서는 각 잎의 평균을 다시 적합해 비교합니다. 부모 평균을 자식에도 그대로 써 놓으면 분할의 이득을 계산한 것이 아닙니다.

분류도 WG라는 가중 위험을 비교합니다. 자식 Gini의 단순 합이나 단순 평균은 서로 다른 자식 크기를 놓칩니다. 깊은 노드에서도 위험과 이득의 분모는 최초 훈련 뿌리 무게 W₀로 고정합니다. 노드마다 다른 분모로 바꾸면 최소 이득과 뒤의 alpha 단위도 달라져 같은 계산이 아닙니다.

Δ=R(t)−R(L)−R(R)W0,ΔSSE=WLWRW0(WL+WR)(yˉL−yˉR)2\Delta=\frac{R(t)-R(L)-R(R)}{W_0},\qquad \Delta_{\mathrm{SSE}}=\frac{W_LW_R}{W_0(W_L+W_R)}(\bar y_L-\bar y_R)^2
네 가정 행의 모든 값 문턱
문턱자식 SSE 합뿌리 정규화 이득
3/256/316/3
5/249
7/256/316/3

With assumed X=[1,2,3,4], Y=[2,4,8,10], parent SSE is 40. Threshold 5/2 creates child means 3 and 9 with combined SSE 2+2=4. Raw reduction is 36. Dividing by original root mass 4 changes normalized risk 10→1, a gain of 9.

At 3/2 or 7/2 the singleton/three-row split has combined child SSE 56/3 and normalized gain 16/3, smaller than 9. Refit each child mean; retaining the parent mean in both children would not evaluate the proposed split.

Classification compares weighted risks WG too. An unweighted child-impurity sum or average ignores different child sizes. Even at deeper nodes, normalize by original training-root mass W₀. Changing denominators across nodes also changes the interpretation of minimum gain and pruning alpha.

Δ=R(t)−R(L)−R(R)W0,ΔSSE=WLWRW0(WL+WR)(yˉL−yˉR)2\Delta=\frac{R(t)-R(L)-R(R)}{W_0},\qquad \Delta_{\mathrm{SSE}}=\frac{W_LW_R}{W_0(W_L+W_R)}(\bar y_L-\bar y_R)^2
Every value threshold for four assumed rows
ThresholdCombined child SSERoot-normalized gain
3/256/316/3
5/249
7/256/316/3
학부 심화 · 선택Advanced undergraduate · optional

최소 잎 크기와 후보의 적격성Minimum leaf sizes and candidate eligibility

가능한 문턱이 모두 허용되는 것은 아닙니다. 최소 잎 행 수 minLeaf=2이면 네 단위 무게 행에서 1행/3행 분할은 부적격이고 2행/2행만 가능합니다. 이 행 수는 목표가 관측되고 무게가 양수인 행을 셉니다. 목표 null인 원행을 더해 작은 잎을 큰 잎처럼 만드는 것은 아닙니다.

minLeafWeight는 행 수와 다른 제한입니다. 한쪽에 두 행이 있어도 각각 무게1/100이면 전체 무게는1/50입니다. 최소 무게1을 충족하지 못합니다. 반대로 무게100인 한 행은 무게 조건을 통과할 수 있어도 최소 행 수2는 충족하지 못합니다. 관측 수와 무게를 따로 읽어야 합니다.

이 장은 부적격 후보도 이유와 함께 표시해 “점수가 나쁘다”와 “조건상 사용할 수 없다”를 구분합니다. 뿌리 자체가 minLeaf보다 작아도 나무를 만들지 못한다는 뜻은 아닙니다. 더 나누지 않는 뿌리 잎으로 남을 수 있습니다. 작은 잎 제한은 복잡도 조절 장치이지 각 잎 예측의 신뢰구간을 보장하는 정리는 아닙니다.

Not every threshold is eligible. With minLeaf=2 and four unit-weight target-observed rows, a one/three split is forbidden while two/two can be used. The count includes positive-weight observed targets, not missing-target records added to make a leaf look larger.

Minimum leaf mass is a separate constraint. Two rows with weights 1/100 each have mass 1/50 and fail a mass minimum of one. Conversely, one row weighted 100 can satisfy a mass constraint but fail a two-row minimum. Keep record counts distinct from statistical mass.

The public candidate display retains ineligible choices and reasons, distinguishing poor scores from forbidden partitions. A root smaller than minLeaf may remain an unsplit root leaf; the constraint applies to prospective children. Minimum size controls complexity, not a theorem guaranteeing confidence intervals or representative leaves.

학부 심화 · 선택Advanced undergraduate · optional

같은 값·같은 점수의 동률 규칙Tied values and deterministic split ties

두 특징이 완전히 같은 열이면 같은 훈련 분할과 같은 이득을 만들 수 있습니다. 이 장은 특징 번호가 작은 것부터, 같은 특징에서는 문턱이 작은 것부터 후보를 비교하고, 같은 최적 위험이면 먼저 만난 것을 유지합니다. 값 문턱 후보 뒤에 결측 여부 후보를 둡니다. 이 약속은 같은 입력에서 같은 설명을 재현하게 하지만, 먼저 고른 특징이 본질적으로 더 중요한 원인이라는 뜻은 아닙니다.

같은 X의 행은 한 번에 이동하며, 범주 다수결 동률에는 앞에서 선언한 범주 순서를 사용합니다. 이것은 분할 특징 동률과 다른 종류의 동률입니다. 가지치기 alpha 문턱에서 작은 나무를 고르는 약속도 따로 있습니다. “동률 처리”라는 한 말로 서로 다른 단계의 결정을 숨기지 않습니다.

화면에 반올림한 두 이득이 같아 보여도 정확한 값은 다를 수 있습니다. 예를 들어1/3과333333/1000000은 여섯 자리 근사에서 비슷하지만 전자가 조금 큽니다. 이 장의 선택은 화면의 소수가 아니라 정확 유리수 비교로 수행합니다. 다른 소프트웨어의 무작위 동률이나 결측 규칙과 결과가 다를 수 있어 동일한 구현이라고 주장하지 않습니다.

Identical feature columns can yield the same partitions and gains. We inspect features in ascending index, thresholds in ascending order, and keep the first exact best candidate. Missing-only candidates follow value thresholds. Determinism makes results reproducible; it does not make the first chosen feature a more important cause.

Equal X values move as a group. Majority-class ties follow declared vocabulary order, which is a different decision from split-feature ties. Pruning breakpoints later use a smaller-subtree equality rule. Identify the particular stage instead of hiding all conventions under “tie handling.”

Rounded gains can look tied while exact values differ: 1/3 exceeds 333333/1000000. Decisions here compare exact rational values, not displayed decimals. Other libraries may use different tie or missingness conventions; we make no claim of identical implementation behavior.

학부 심화 · 선택Advanced undergraduate · optional

결측 방향과 결측 자체의 분할Missing routing and missing-only splits

결측 X는 숫자0이라는 뜻이 아닙니다. 이 장은 각 문턱에서 결측을 왼쪽 또는 오른쪽으로 보내는 훈련 후보를 비교할 수 있습니다. X=[1,null,3],Y=[0,1,1], 단위 무게와 범주[0,1]에서 문턱2를 보세요. 결측을 왼쪽에 보내면 왼쪽 [0,1]이 섞여 원 위험1, 오른쪽에 보내면 [0]과[1,1]로 순수해져 원 위험0입니다.

“결측인가?”만 묻는 후보도 따로 있습니다. 이 예에서는 결측 [1]과 관측 [0,1]로 나뉘어 원 자식 위험1입니다. 따라서 결측 오른쪽의 값 문턱이 더 좋습니다. 어느 방향이 항상 최선인지 미리 정한 자연 법칙은 없습니다. 측정 누락이 집단 정보를 담을 수 있지만, 결측의 원인이나 앞으로도 같은 누락 방식이 유지될지는 다른 문제입니다.

훈련에 결측이 하나도 없으면 결측 방향을 목표 손실로 비교할 근거가 없습니다. best 규칙은 유효 양의 무게 행 수가 더 많은 자식으로 미래 결측을 보내고, 행 수도 동률이면 왼쪽입니다. 무게가 더 큰 쪽이라는 뜻은 아닙니다. 이 fallback은 공개한 계산 약속이며 새 결측 관측에 대한 정확도 보증이 아닙니다. 시험 결과를 본 뒤 방향을 다시 선택하지 않습니다.

Missing X is not numeric zero. At a threshold, training can compare routing missing values left or right. For unit-weight X=[1,null,3], Y=[0,1,1] and vocabulary [0,1], threshold 2 has raw child risk one when missing goes left, but zero for the pure groups [0] and [1,1] when missing goes right.

A separate missing-only question partitions missing [1] from observed [0,1], also giving child risk one. Thus the missing-right value threshold wins here. No natural law makes one direction universally best. Missingness can carry information, but its cause and future stability require separate evidence.

With no training missingness, target loss cannot identify a preferred missing route. Our best fallback uses the child with more eligible positive-weight rows, choosing left on a count tie; this is not a comparison of total weight. It is a declared rule, not an accuracy guarantee. Never choose that direction using outer-test outcomes.

학부 심화 · 선택Advanced undergraduate · optional

분할 실습: 모든 후보를 직접 비교Split lab: compare every candidate

실습 B에서 단위 무게 X=[1,2,3,4],Y=[2,4,8,10], 회귀, minLeaf=1, 최소 잎 무게0, 결측 방향 best로 시작합니다. 세 문턱과 각 자식 평균·행·원 위험·정규화 이득을 모두 보세요. 문턱5/2의 이득9가 선택되어야 합니다. 최적 후보만 외우지 말고 양 끝 후보의56/3 SSE를 직접 계산합니다.

minLeaf를2로 바꾸면 가운데 후보만 적격이고,3으로 바꾸면 분할 가능한 후보가 없습니다. 다음에는 분류·범주[0,1]과 목표[0,0,1,1]로 바꿉니다. 손실 단위가 달라져 이득을 회귀의9와 직접 비교할 수 없지만, 가운데에서 순수한 두 잎을 만든다는 분할은 같습니다. 분류의 정규화 이득은1/2입니다.

마지막으로 앞 절의 세 행 결측 예제를 넣고 방향별 후보와 결측 여부 후보를 비교하세요. 이 공개 도구는 모든 후보를 읽을 수 있게 원행 수256개로 제한합니다. 실제 전체 자료의 나무 적합은 별도 절차로 더 많은 행을 처리하며 선택된 질문·계보를 남깁니다. 원자료 일부만 골랐을 때는 그 작은 실습을 전체 자료 최적 분할이라고 부르지 않습니다.

In Lab B start with unit-weight X=[1,2,3,4], Y=[2,4,8,10], regression, minLeaf=1, minimum leaf mass zero and best missing routing. Inspect all three thresholds, child means, memberships, risks and gains. Threshold 5/2 should win with normalized gain 9; independently calculate the endpoint alternatives’ SSE 56/3.

At minLeaf=2 only the middle candidate is eligible; at three none can split. Switch to classification with vocabulary [0,1] and targets [0,0,1,1]. The central partition is unchanged, but its normalized Gini gain is 1/2, which is not comparable in units with regression gain 9.

Finally enter the three-row missingness example and compare routing and missing-only alternatives. This public tool limits input to 256 rows to expose every candidate. Full-source tree fitting handles more rows separately and retains chosen questions and lineage. A selected small practice subset is not claimed the full dataset’s optimal split.

학부 심화 · 선택Advanced undergraduate · optional

직사각형 영역과 계단 함수Rectangular regions and step functions

두 특징을 가로·세로축에 놓으면 한 질문은 종이나 지도를 한 줄로 자르는 것과 비슷합니다. “교육연수≤12” 뒤에 “나이≤25”를 묻는 경로는 두 조건의 교집합을 만듭니다. 수치 특징을 하나씩 비교하는 이 장의 잎은 축과 나란한 직사각형 영역이며, 고차원에서는 그와 같은 상자입니다. 모든 방향의 사선 경계를 직접 찾는 알고리즘은 아닙니다.

각 상자 안에서는 같은 훈련 평균이나 같은 범주 확률을 예측합니다. 회귀 곡선이 매끈한 선보다 계단처럼 보이는 이유입니다. X가 문턱을 넘지 않으면 조금 바뀌어도 같은 답이고, 문턱을 조금 넘으면 다른 잎의 답으로 갑자기 바뀔 수 있습니다. 이 불연속은 표를 잘못 그려서 생긴 선이 아니라 모형 규칙의 일부입니다.

나라·사람을 상자에 넣는 그림은 이해를 돕지만, 같은 잎에 들어간 관측이 경제적으로 모두 같아졌다는 뜻은 아닙니다. 나무가 쓰지 않은 특성이나 그 집단 안의 오차는 남습니다. 실제 사례에서는 잎의 원행 수·목표 분포·선택 특징·미사용 특징을 함께 읽고, 잎 번호를 사람의 고정된 유형처럼 취급하지 않습니다.

f^(x)=∑ℓ∈L(T)c^ℓ1{x∈Aℓ}\widehat f(x)=\sum_{\ell\in\mathcal L(T)}\widehat c_\ell\mathbf1\{x\in A_\ell\}

Place two features on horizontal and vertical axes. A question cuts the map along one axis. Asking schooling≤12 and then age≤25 forms an intersection of conditions. Leaves in this numeric one-feature-at-a-time tree are axis-aligned rectangles, or boxes in higher dimensions; the algorithm does not directly search arbitrary oblique boundaries.

Within each box, prediction is one training mean or one class-probability vector. Regression therefore looks like a step function rather than a smooth line. Small feature changes within a region preserve the answer; crossing a threshold can cause a jump. This discontinuity is part of the model, not a plotting defect.

Sharing a leaf does not make observations economically identical. Unused characteristics and within-leaf residuals remain. Inspect original memberships, target distributions and selected or unused features. A fitted leaf number is not a permanent human type.

f^(x)=∑ℓ∈L(T)c^ℓ1{x∈Aℓ}\widehat f(x)=\sum_{\ell\in\mathcal L(T)}\widehat c_\ell\mathbf1\{x\in A_\ell\}
학부 심화 · 선택Advanced undergraduate · optional

단위 변환과 단조 변환의 경계Units and the boundary of monotone invariance

특징의 양의 선형 단위 변환 X′=aX+b는 순서와 중간값을 함께 보존합니다. 원 문턱 s가 as+b로 바뀌어 같은 새 관측도 같은 쪽으로 갑니다. 국가 자료에서 1인당 GDP를 10000으로 나누어 읽는 것은 이런 고정 단위 변환입니다. 목표·무게·적격 조건이 같다면 이 장의 정확 산술에서 훈련 분할과 경로는 단위 이름 때문에 달라지지 않습니다.

모든 엄격한 증가 변환에도 새 관측의 답까지 항상 같다고 확대하면 틀립니다. 훈련 X=1,9의 중간값은5입니다. 제곱근 변환을 먼저 하면 값1,3의 중간값은2이고, 원 단위로 돌아오면 경계4입니다. 훈련 두 행은 똑같이 나뉘지만 새 X=4.5는 원 나무에서는 왼쪽, 변환한 나무에서는 오른쪽입니다. 빈 구간의 대표 문턱을 중간값으로 정했기 때문입니다.

따라서 “순서 기반이라 변환에 강하다”는 말에는 어느 관측·어느 문턱 규칙인지가 붙어야 합니다. 같은 훈련 분할, 새 질의의 예측, 결측 방향, 반올림된 구현 결과는 구분합니다. 변환을 자료에서 추정해야 한다면 그 적합도 훈련 안에서 해야 합니다. 이 장의 GDP 단위 나누기는 전체 목표를 보고 고른 추정 변환이 아닙니다.

A positive affine feature conversion X′=aX+b preserves ordering and transforms midpoint s to as+b, so the same new query follows the same side. Dividing GDP per capita by 10,000 is a fixed unit change. With identical targets, weights and eligibility constraints, exact arithmetic does not change routes merely because units change.

Do not extend this to identical new-query predictions under every strictly increasing transformation. Training X=1,9 has midpoint 5. After a square-root transformation, values 1,3 have midpoint 2, corresponding to original value 4. Training membership is unchanged, but a new X=4.5 is left in the original tree and right in the transformed tree.

The distinction arises from representative cutpoints in empty training gaps. Separate training partitions, future predictions, missing routing and floating-point behavior. Any learned transformation must also be trained within the proper boundary. Our fixed GDP unit conversion is not a transform selected from all target outcomes.

학부 심화 · 선택Advanced undergraduate · optional

탐욕 분할은 전역 최적이 아니다Greedy splitting is not global optimization

나무를 만드는 탐욕(greedy) 규칙은 지금 이 노드에서 가장 큰 즉시 위험 감소를 고릅니다. 그 뒤 각 자식에서 같은 일을 반복합니다. 모든 가능한 질문 순서와 모든 완성 나무를 미리 만들어 비교하는 것이 아닙니다. 첫 질문이 좋아 보여도 두세 단계 뒤의 전체 결과까지 가장 좋다는 보장은 없습니다.

왜 탐욕을 쓰나요? 여러 특징과 수많은 문턱에서 모든 깊이의 조합을 나열하면 가능한 나무 수가 매우 빠르게 늘기 때문입니다. 한 단계의 명확한 기준으로 계산을 진행하면 실제 자료를 다룰 수 있고 경로도 기록하기 쉽습니다. 계산 가능한 선택과 전역 최적이라는 수학적 인증은 서로 다른 성질입니다.

뒤에서 배우는 비용-복잡도 가지치기는 “이미 자란 이 큰 나무의 부분나무 중”이라는 비교 범위를 갖습니다. 처음 자랄 때 탐욕 규칙이 놓친 다른 뿌리 질문이나 새로운 가지를 만들어 주지는 않습니다. 이 한계를 먼저 알고 있어야 가지치기의 최적성 정리를 모든 나무에 대한 보장으로 오해하지 않습니다.

A greedy tree chooses the largest immediate risk reduction at the current node, then repeats within each child. It does not enumerate every question order and completed tree in advance. An attractive first split need not produce the best final rule several levels later.

Exhaustive combinations of features, thresholds and depths grow rapidly. Local criteria make computation and route recording manageable on actual data. Computational feasibility and a mathematical certificate of global optimality are distinct properties.

Cost-complexity pruning later compares subtrees of the particular grown tree. It does not invent a different root question or add branches that greedy growth missed. Keep this domain explicit when reading its optimality claim.

학부 심화 · 선택Advanced undergraduate · optional

XOR와 양의 이득 정지의 반례XOR and stopping at zero gain

두 이진 특징의 가정 관측 (0,0)→0,(0,1)→1,(1,0)→1,(1,1)→0을 봅시다. 같은 값이면 목표0, 서로 다르면1인 XOR입니다. 뿌리는 두 범주가 절반씩이므로 Gini1/2입니다. 어느 특징을 먼저 1/2에서 나누어도 각 자식은0과1이 한 번씩 있어 Gini1/2입니다. 즉시 정규화 이득은0입니다.

이 장은 양의 이득이 없으면 멈추므로 뿌리 하나를 반환합니다. 그런데 첫 질문을 허용하고 각 자식에서 다른 특징을 한 번 더 물으면 네 잎이 모두 순수해집니다. 깊이2면 설명할 수 있는 상호작용이지만 첫 단계에서 이득을 요구하는 탐욕 규칙은 찾지 못한 것입니다. maxDepth만5로 늘려도 첫 질문에서 멈추는 규칙은 바뀌지 않습니다.

이 반례는 나무가 상호작용을 표현할 수 없다는 주장이 아닙니다. 나무의 표현 능력과 정한 성장 알고리즘이 실제로 찾는 모형을 구분합니다. 원본 XOR 목표를 임의로 조금 흔들어 이득을 만들어 성공한 척하지 않습니다. 다른 탐색·특징 구성·앙상블이 언제 도움이 되는지는 다음 장의 질문으로 남깁니다.

가정한 XOR 네 행
X₁X₂목표
000
011
101
110

Consider assumed XOR observations (0,0)→0,(0,1)→1,(1,0)→1,(1,1)→0. Equal feature values give zero and differing values one. The root is balanced with Gini 1/2. Either first threshold at 1/2 leaves both children balanced, producing immediate normalized gain zero.

Our positive-gain rule stops at a stump. Yet allowing that first question and then asking the other feature in each child creates four pure leaves at depth two. The tree class can represent the interaction, while this greedy search misses it. Raising the allowed depth to five alone cannot overcome its zero-gain stopping rule.

This is a distinction between representational capacity and the algorithm that searches it, not proof that trees cannot express interactions. Do not perturb the supplied targets merely to manufacture a favorable first split. Alternative search, features and ensembles motivate later questions.

Four assumed XOR records
X₁X₂Target
000
011
101
110
학부 심화 · 선택Advanced undergraduate · optional

깊이·잎 수·최소 이득을 구분Distinguish depth, leaf count and gain

뿌리 깊이가0인 이진 나무에서 최대 깊이 d는 잎 수를 최대2ᵈ개로 제한합니다. d=0이면 잎1개, d=1이면 최대2개, d=2이면 최대4개입니다. 꽉 찬 깊이5 나무는 잎32개, 전체 노드63개입니다. 실제로는 목표가 순수하거나 적격 분할이 없어 그보다 작을 수 있습니다.

minLeaf는 자식의 최소 관측 수, minLeafWeight는 최소 무게, minGain은 뿌리 무게로 정규화한 최소 이득입니다. 서로 다른 제한입니다. 이 장의 분할은 이득이 양수이고 minGain보다도 엄격하게 커야 합니다. 네 회귀 행의 뿌리 이득9에서 minGain=9이면 멈추고,8이면 분할할 수 있습니다. 같음의 처리도 재현 조건입니다.

규제 숫자만 많이 바꾸며 가장 작은 시험 오차를 찾으면 시험을 모형 선택에 사용하게 됩니다. 나무를 자라게 할 설정과 검증 계획을 먼저 정하고, 어느 제한 때문에 각 노드가 멈췄는지 읽으세요. 같은 잎 수라도 나누는 특징·깊이·불균형한 모양이 다를 수 있어 복잡도를 숫자 하나로 완전히 설명할 수는 없습니다.

With root depth zero, a binary tree of maximum depth d has at most 2ᵈ leaves. Depths zero, one and two permit at most one, two and four leaves. A full depth-five tree has 32 leaves and 63 total nodes; purity or absent eligible splits can make the actual tree smaller.

Minimum child count, minimum mass and minimum root-normalized gain impose different constraints. Here a chosen gain must be strictly positive and strictly greater than minGain. A root gain of 9 stops at minGain=9 but may split at eight. Equality conventions matter for reproduction.

Trying many controls against the outer test converts that exam into model-selection data. Prespecify growth and validation, then inspect each stopping reason. Equal leaf counts can still hide different features, depths and unbalanced structures.

학부 심화 · 선택Advanced undergraduate · optional

훈련 적합·불안정성·일반화Training fit, instability and generalization

이미 자란 나무의 잎을 적격한 양의 이득 질문으로 더 나누면 훈련 위험은 줄어듭니다. 각 자식이 부모의 예측을 그대로 쓰는 선택도 가능하고, 실제로는 자식의 최적 대표값을 다시 적합하므로 더 나빠질 필요가 없습니다. 하지만 이 말은 그 확장을 평가한 훈련 자료에 대한 것입니다. 보지 않은 표본의 오차가 반드시 줄어든다는 결론은 아닙니다.

나무는 자료의 작은 변화에 경로가 달라질 수 있습니다. 비슷한 두 후보의 이득이 거의 같으면 행 하나가 바뀌어 첫 질문이 뒤집히고 그 아래의 많은 가지가 달라질 수 있습니다. 또 고정 나무에서도 새 X가 문턱 양쪽으로 아주 조금 이동하면 예측이3에서9로 뛰어갈 수 있습니다. 정확 산술은 이 모형의 불연속 자체를 없애지 않습니다.

검증은 이 불안정성과 복잡도 선택을 경험적으로 조사합니다. 표본이 작거나 집단·시간이 다른 자료에서는 한 번의 분할 결과가 우연에 민감할 수 있습니다. 많은 규칙을 시도한 뒤 가장 좋았던 성적만 남기지 말고, 접힘별 손실과 선택 alpha, 외부 시험의 분모까지 남깁니다. 배깅은 이런 변동성을 다루는 한 방법이지만 모든 편향을 해결하는 보증은 아닙니다.

Extending a fixed tree by eligible positive-gain splits reduces training risk. Each child could retain the parent prediction, while refitting its own optimum can only improve that training objective. This statement concerns the observations used to evaluate the extension, not guaranteed improvement on unseen records.

Trees can be unstable. One changed row may reverse two nearly tied root candidates and alter many descendants. Even a fixed tree can jump from prediction 3 to 9 when a new X barely crosses a threshold. Exact arithmetic does not smooth the model’s discontinuity.

Validation investigates instability and complexity selection. Small samples and group/time shifts can make one split sensitive to chance. Preserve fold losses, selected alpha and outer-test denominators rather than only the best result after many trials. Bagging addresses some variance, not every source of bias.

학부 심화 · 선택Advanced undergraduate · optional

나무 실습: 경로와 잎의 원자료Tree lab: paths and actual leaf membership

실습 C에서 네 회귀 행, 단위 무게, maxDepth=1,minLeaf=1,minGain=0으로 시작합니다. 뿌리 문턱5/2, 두 잎의 평균3과9, 전체 정규화 위험1을 확인합니다. 새 질의 X=0,2,5/2,3,10을 넣으면 예측은3,3,3,9,9입니다. 훈련 범위 밖에서도 기존 경로를 적용할 뿐, 직선을 연장해 증가량을 예측하지 않습니다.

깊이를2로 늘리면 왼쪽에서3/2, 오른쪽에서7/2를 물어 네 훈련 목표를 그대로 맞히는 잎을 만들 수 있습니다. 이때 minLeaf를2로 두면 각 두 행 잎을 다시 나누지 못합니다. 무엇을 바꾸었는지 한 번에 하나씩 기록하고, 각 노드의 원행 ID·무게·깊이·정지 이유를 비교하세요.

분류 모드의 XOR 네 행도 실행해 보세요. 깊이는2 이상 허용하되 minGain=0이어도 양의 이득 조건 때문에 뿌리에서 멈춰야 합니다. 실패를 숨기지 않고 왜 그런지 경로와 후보 이득으로 설명합니다. 실제 국가·임금·이탈 자료에는 더 많은 행이 있으므로 계산 버튼과 취소 상태를 읽으며 전체 원행을 작은 가정 예제와 구분합니다.

In Lab C use the four regression records, unit weights, maxDepth=1, minLeaf=1 and minGain=0. Check root threshold 5/2, leaf means 3 and 9 and normalized risk one. Queries X=0,2,5/2,3,10 receive 3,3,3,9,9. Outside the training range, the rule follows existing branches rather than extrapolating a linear slope.

At depth two, left threshold 3/2 and right threshold 7/2 can produce four leaves matching training outcomes. Setting minLeaf=2 instead prevents those two-row leaves from splitting. Change one setting at a time and compare original IDs, masses, depths and stopping reasons.

Also run the four XOR classification records. Even with depth at least two and minGain=0, the strictly positive-gain rule should stop at the root. Explain this through candidate gains rather than concealing the failure. Full actual sources contain many more records; distinguish them from assumed examples and read calculation/cancellation status.

학부 심화 · 선택Advanced undergraduate · optional

사전 정지와 사후 가지치기Pre-stopping and post-pruning

사전 정지는 나무를 자라게 할 때 깊이·최소 잎 크기·최소 이득으로 질문을 막습니다. 사후 가지치기는 정한 설정으로 먼저 자란 나무에서 일부 가지를 통째로 잎으로 바꿉니다. 둘 다 작은 나무를 만들 수 있지만 같은 탐색이 아닙니다. 사전 정지로 없어진 질문을 사후 가지치기가 새로 발명하지 않습니다.

네 회귀 행을 깊이2,minLeaf=1로 끝까지 나누면 잎4개·정규화 훈련 위험0입니다. 양쪽 아래 질문을 없애면 잎2개·위험1이고, 뿌리도 없애면 잎1개·위험10입니다. 큰 나무가 훈련을 더 잘 맞히는 대신 질문 수가 늘었습니다. 다음 절의 alpha는 위험과 잎 수 사이의 명시적인 교환 비율입니다.

이 장의 prune 도구는 외부에서 임의의 나무 JSON을 받아 믿는 대신 같은 훈련 자료와 성장 설정으로 큰 나무를 내부 적합한 뒤 가지치기합니다. 재현하려면 목표·무게·범주·결측 규칙·성장 설정이 같아야 합니다. alpha만 바꾸는 비교와 처음부터 minLeaf를 바꾸어 다른 큰 나무를 만든 비교를 구분하세요.

Pre-stopping blocks questions during growth through depth, size or gain limits. Post-pruning replaces entire branches of a fixed grown tree by leaves. Both can simplify a rule, but they search differently; pruning cannot invent a question previously blocked during growth.

Growing the four regression records to depth two with minLeaf=1 gives four leaves and normalized risk zero. Removing both bottom questions yields two leaves and risk one; removing the root question yields one leaf and risk ten. Alpha in the next section states a tradeoff between fit and leaf count.

Our prune tool refits the declared training problem internally rather than trusting an arbitrary supplied tree object. Reproduction requires the same targets, weights, vocabulary, missingness and growth settings. Varying alpha on one grown tree differs from changing minLeaf and constructing another tree.

학부 심화 · 선택Advanced undergraduate · optional

R(T)+alpha|T|의 단위Units in cost-complexity risk

훈련을 가장 잘 맞히는 큰 나무만 고르지 않기 위해 목적함수 R(T)+α|L(T)|를 씁니다. R(T)는 모든 잎의 가중 원 위험을 최초 뿌리 무게 W₀로 나눈 합, |L(T)|는 잎 수입니다. α≥0은 잎 하나를 유지하는 비용입니다. 예측이 조금 좋아져도 잎을 많이 늘려야 한다면 큰 alpha에서 그 가지는 매력적이지 않습니다.

네 회귀 행에서 잎4개·위험0, 잎2개·위험1, 잎1개·위험10을 비교하세요. alpha=1/4이면 목적값1,3/2,41/4로 네 잎이 좋고, alpha=1이면4,3,11로 두 잎이 좋습니다. alpha=10이면40,21,20으로 뿌리 하나가 좋습니다. 위험과 잎 수를 따로 보여 주면 무엇 때문에 선택이 달라졌는지 이해할 수 있습니다.

alpha의 단위는 정규화 손실 단위입니다. 회귀 목표가 시급이면 제곱 시급 단위이고, Gini 위험은 범주 확률의 무차원 단위입니다. 나라의 수명 나무와 임금 나무에 숫자가 같은 alpha를 넣는다고 같은 규제 강도라는 뜻이 아닙니다. 좋은 숫자를 외우기보다 어떤 위험과 분모를 쓰는지 먼저 적습니다.

R(T)=1W0∑ℓ∈L(T)Rraw(ℓ),Cα(T)=R(T)+α∣L(T)∣,α≥0R(T)=\frac1{W_0}\sum_{\ell\in\mathcal L(T)}R_{\mathrm{raw}}(\ell),\qquad C_\alpha(T)=R(T)+\alpha|\mathcal L(T)|,\quad \alpha\ge0

Cost-complexity pruning minimizes R(T)+α|L(T)|. R(T) sums raw weighted leaf risks divided by original root mass W₀; |L(T)| counts leaves. Nonnegative alpha prices one retained leaf. A small fit improvement requiring many leaves can be unattractive at large alpha.

For the four regression records compare risks/leaves (0,4),(1,2),(10,1). Alpha 1/4 gives costs 1,3/2,41/4; alpha 1 gives 4,3,11; alpha 10 gives 40,21,20. The preferred tree changes from four leaves to two to one. Showing risk separately from leaf count makes the tradeoff inspectable.

Alpha has normalized-loss units: squared wage units in wage regression, and dimensionless probability-risk units for Gini. The same numeric alpha in longevity and wage problems does not express the same regularization strength. State risk definitions and denominators before choosing values.

R(T)=1W0∑ℓ∈L(T)Rraw(ℓ),Cα(T)=R(T)+α∣L(T)∣,α≥0R(T)=\frac1{W_0}\sum_{\ell\in\mathcal L(T)}R_{\mathrm{raw}}(\ell),\qquad C_\alpha(T)=R(T)+\alpha|\mathcal L(T)|,\quad \alpha\ge0
학부 심화 · 선택Advanced undergraduate · optional

가지 하나의 약한 고리 alphaThe effective alpha of one branch

한 내부 노드 t 아래에 잎 m개인 가지 Tₜ가 있다고 합시다. 그 가지를 잎 하나로 바꾸면 위험은 ρ(t)−R(Tₜ)만큼 늘고 잎 수는 m−1만큼 줄어듭니다. 두 목적값이 같아지는 alpha는 그 위험 증가를 없앤 잎 수로 나눈 값입니다. 작을수록 잎 하나를 아끼는 대가가 작은 “약한 고리”입니다.

네 행을 끝까지 나눈 나무에서 아래 두 행 노드 하나의 원 SSE는2, 뿌리 무게는4입니다. 노드 하나로 줄인 위험은1/2, 그 아래 두 순수 잎의 위험은0이므로 유효 alpha는(1/2−0)/(2−1)=1/2입니다. 같은 큰 나무의 뿌리는(10−0)/(4−1)=10/3입니다. 당장 약한 것은 아래 질문들입니다.

여기서 ρ(t)도 원 뿌리 무게로 정규화합니다. 노드 자신의 두 행으로 나누면1이 되어 다른 alpha를 계산하게 됩니다. 위험 증가와 잎 감소를 한 줄에 놓고 단위를 확인하세요. 잎 하나인 노드에는 m−1=0이므로 이 내부 가지 비교식을 적용하지 않습니다.

αeff(t)=ρ(t)−R(Tt)∣L(Tt)∣−1,ρ(t)=Rraw(t)W0\alpha_{\mathrm{eff}}(t)=\frac{\rho(t)-R(T_t)}{|\mathcal L(T_t)|-1},\qquad \rho(t)=\frac{R_{\mathrm{raw}}(t)}{W_0}

An internal branch Tₜ with m leaves can be replaced by one leaf at node t. Risk rises by ρ(t)−R(Tₜ) while leaf count falls by m−1. Dividing the risk increase by removed leaves gives the alpha where the two objectives tie. Smaller values identify a cheaper weak link.

In the fully grown four-record tree, a bottom two-row node has raw SSE 2 and root mass 4, so its collapsed risk is 1/2. Its two pure descendants have risk zero: effective alpha is 1/2. The original root instead has (10−0)/(4−1)=10/3, making the lower questions weaker initially.

Normalize ρ(t) by original root mass, not its own node mass; using two would incorrectly double that bottom alpha. Compare risk increase with leaf decrease and check units. A terminal node has m−1=0 and is not an internal branch to which this quotient applies.

αeff(t)=ρ(t)−R(Tt)∣L(Tt)∣−1,ρ(t)=Rraw(t)W0\alpha_{\mathrm{eff}}(t)=\frac{\rho(t)-R(T_t)}{|\mathcal L(T_t)|-1},\qquad \rho(t)=\frac{R_{\mathrm{raw}}(t)}{W_0}
학부 심화 · 선택Advanced undergraduate · optional

주어진 큰 나무의 부분나무 최적성Subtree optimality within a fixed grown tree

왜 이 비교가 성립하는지 고정 alpha에서 생각해 봅니다. 노드 t의 선택은 두 가지입니다. t를 잎으로 바꾸어 ρ(t)+alpha를 내거나, 원 큰 나무의 왼쪽·오른쪽 가지를 유지하며 각각의 최적 비용을 더합니다. 아래에서 위로 두 비용의 작은 것을 고르면 고정된 큰 나무의 모든 뿌리 부분나무를 빠짐없이 비교한 것과 같습니다.

이 동적 계획 원리는 잎 위험과 잎별 비용이 더해진다는 구조를 이용합니다. 동률에는 잎으로 줄인 선택이 더 작은 나무입니다. 직접 작은 큰 나무의 부분나무를 모두 나열해 이 식과 약한 고리 경로를 검산할 수도 있습니다. 연습문제의 깊이2 나무에서는 다섯 부분나무를 직접 나열해 같은 최소 목적값인지 확인해 보세요.

비교 영역을 바꾸면 정리도 달라집니다. 새 특징이나 새 문턱을 발명한 나무, 다른 최초 성장 설정의 나무는 이 부분나무 집합 밖입니다. 또 이 목적함수는 훈련 위험과 복잡도 비용이지 모집단의 예측 위험 그 자체가 아닙니다. alpha를 정하는 검증과 남겨 둔 시험 자료가 필요한 이유입니다.

Cα(t)=min⁡{ρ(t)+α, Cα(tL)+Cα(tR)},Cα(ℓ)=ρ(ℓ)+αC_\alpha(t)=\min\{\rho(t)+\alpha,\ C_\alpha(t_L)+C_\alpha(t_R)\},\qquad C_\alpha(\ell)=\rho(\ell)+\alpha

At fixed alpha, each node offers two choices: collapse it for cost ρ(t)+alpha, or retain the original left/right branches and add their optimal subtree costs. Choosing the smaller recursively from leaves upward compares all rooted subtrees of the fixed grown tree.

The argument uses additive leaf risk and additive leaf cost. At equality collapse to the smaller tree. On a small grown tree, independently enumerate all rooted subtrees and compare with this dynamic program and weakest-link selection; for the depth-two exercise, list all five rooted subtrees and verify the same minimum cost.

Trees with new thresholds, new features or different original growth lie outside this comparison set. Furthermore, penalized training risk is not population predictive risk. Validation chooses alpha and a separate test evaluates the resulting choice.

Cα(t)=min⁡{ρ(t)+α, Cα(tL)+Cα(tR)},Cα(ℓ)=ρ(ℓ)+αC_\alpha(t)=\min\{\rho(t)+\alpha,\ C_\alpha(t_L)+C_\alpha(t_R)\},\qquad C_\alpha(\ell)=\rho(\ell)+\alpha
학부 심화 · 선택Advanced undergraduate · optional

가지치기 실습: 문턱에서 작은 나무Pruning lab: smaller trees at breakpoints

실습 D에서 네 회귀 행을 maxDepth=2,minLeaf=1,minGain=0으로 키웁니다. alpha=0에서 잎4개·위험0인지 확인하고 전체 가지치기 경로를 펼칩니다. alpha를1/2보다 작게,정확히1/2로 바꾸어 문턱에서 잎2개로 이동하는지 보세요. 정확 분수 입력은 표시 소수의 반올림과 별개입니다.

alpha=9 직전에는 잎2개·위험1이고,정확히9에서는 뿌리1개·위험10이어야 합니다. 두 목적값은19로 같지만 더 작은 나무를 고르기 때문입니다. 새 X=2는 큰 나무에서4,두 잎 나무에서3,뿌리만 남으면6을 받습니다. 어떤 가지를 제거했는지가 개별 예측에 어떻게 이어지는지도 확인합니다.

XOR의 성장 결과가 뿌리뿐이면 같은 실습에서 alpha를 바꾸어도 숨은 상호작용 가지가 생기지 않습니다. 과정을 읽을 때 “최적”이라는 말 옆에 성장 설정·부분나무 집합·정규화 위험·alpha·동률 규칙을 함께 적으세요. 경로의 작은 나무가 검증에서도 가장 좋은지는 다음 단계에서 별도로 채점합니다.

In Lab D grow the four regression rows with maxDepth=2, minLeaf=1 and minGain=0. Check four leaves/risk 0 at alpha 0, then open the complete pruning path. Values just below 1/2 and exactly 1/2 should distinguish the transition to two leaves; exact rational input is separate from rounded display.

Just below 9 there are two leaves with risk 1; at 9 choose the one-leaf root with risk 10. Both objectives are 19, but the smaller tree wins. Query X=2 receives 4 in the full tree,3 with two leaves and 6 at the stump. Connect removed questions to changed individual predictions.

An XOR-grown stump cannot acquire hidden interaction branches when alpha changes. Record growth settings, comparison set, normalization and tie rules alongside any “optimal” label. Whether a path member also predicts best on validation data is a separate scoring question.

학부 심화 · 선택Advanced undergraduate · optional

가중 잎·분모·정규화의 일관성Weights, leaves and consistent denominators

뿌리 무게 W₀는 원 성장 자료의 유효 무게입니다. 가지를 줄일 때마다 남은 잎의 수로 다시 나누거나 각 노드의 무게를 새 분모로 쓰지 않습니다. 네 행에서 W₀=4는 잎4개·2개·1개를 비교하는 동안 그대로입니다. 그래야 위험 차이와 alpha를 한 단위에서 비교할 수 있습니다.

모든 무게를 같은 양수 c배 하면 원 SSE나 원 Gini 위험도 c배,뿌리 무게도 c배이므로 정규화 위험은 같습니다. 잎 평균과 확률도 같습니다. 단,최소 잎 무게 같은 적격 조건도 같은 배율로 맞추거나 원래 비활성이어야 같은 큰 나무라는 결론이 유지됩니다. 무게만 바꾸고 고정된 질량 문턱을 그대로 두면 허용 분할 자체가 바뀔 수 있습니다.

목표를 0이 아닌 a배(a≠0) 하는 회귀에서는 중심 제곱손실이 a²배입니다. 같은 위험-복잡도 교환을 유지하려면 alpha와 정규화 최소 이득도 a²배 합니다. 이 단위 논리는 y 단위 변환에 관한 것이며 분류 범주 이름을 숫자로 바꾸어 제곱 크기를 붙이는 근거가 아닙니다.

Root mass W₀ is eligible mass in the original growth sample. Do not renormalize by remaining leaf count or by each internal node’s mass during pruning. The four-record example keeps W₀=4 while comparing four, two and one leaves.

Multiplying all weights by positive c multiplies raw risk and root mass equally, preserving normalized risk, means and shares. Equivalent growth additionally requires scaling minimum-mass eligibility thresholds or leaving them inactive. Otherwise the allowed splits can change.

Multiplying regression targets by a nonzero a scales squared losses by a². Preserve the same complexity tradeoff by scaling alpha and normalized minimum gain accordingly. This target-unit argument does not justify imposing numeric magnitudes on arbitrary classification category names.

학부 심화 · 선택Advanced undergraduate · optional

검증 손실과 훈련 불순도 구분Validation loss differs from training impurity

훈련 불순도는 나무를 만들 때 이미 본 목표에서 계산한 적합입니다. 검증 손실은 그 접힘의 적합에 쓰지 않은 목표와 예측을 비교합니다. 두 값이 다르다고 계산 오류는 아닙니다. 훈련에서 순수한 분류 잎도 새 고객에게 틀릴 수 있고,표본 평균은 앞으로의 참 평균과 다를 수 있습니다.

회귀 검증에서는 제곱오차와 절대오차를 모두 보여 주되 alpha 선택의 주 손실은 가중 MSE입니다. 분류는 전체 범주 확률 벡터의 Brier 합을 사용하고,다수결의 0/1 오차는 다른 열로 남깁니다. 낮은 다수결 오차와 좋은 확률 예측이 같은 순서로 모형을 정렬할 필요는 없습니다.

검증 예측을 만든 뒤 목표를 읽어 채점하는 것은 필요하지만,그 목표가 분할·잎의 확률·가지치기 경로를 만드는 데 먼저 들어가면 누출입니다. 원 관측 ID,훈련 접힘,선택 alpha와 채점 가능 여부를 각 예측에 남겨 어느 역할로 목표를 썼는지 추적할 수 있게 합니다.

Training impurity measures fit on targets already used to construct the tree. Validation loss compares predictions with targets excluded from that fold’s fitting. A difference is not an error: a pure training leaf can misclassify a new customer, and its sample mean need not equal the future conditional mean.

Regression displays squared and absolute losses but chooses alpha by pooled weighted MSE. Classification chooses by the sum of Brier terms across all categories; majority 0/1 error is another column. Accuracy and probability quality need not rank models identically.

Reading validation targets after predicting is required for scoring. Using them earlier to construct splits, leaf probabilities or pruning paths leaks information. Retain original IDs, fold, alpha and scoreability for every prediction so their roles remain auditable.

학부 심화 · 선택Advanced undergraduate · optional

다중 Brier와 이진 Brier의 두 배Multiclass Brier and twice the binary Brier

한 관측의 실제 범주를 한 칸만1인 벡터 eᵧ로 쓰고,예측 확률을 q로 쓰면 다중 Brier는 Σₖ(qₖ−eᵧ,ₖ)²입니다. 두 범주에서는 q₁=q,q₀=1−q이므로 이 합은2(q−y)²입니다. 흔히 양성 범주 하나만 쓰는 이진 Brier의 두 배이며,어느 정의인지 꼭 밝혀야 합니다.

예측 확률(3/4,1/4)에서 실제 범주가0이면 손실은1/16+1/16=1/8,실제1이면9/16+9/16=9/8입니다. 다수결이 맞아도 확률 손실은0이 아닐 수 있습니다. 원 잎의 세0·한1에 평균하면(3×1/8+9/8)/4=3/8로 Gini와 같습니다. 훈련 Gini가 경험 비율의 최적 Brier 위험과 연결되는 이유입니다.

모집단 확률 p에서 예상 손실은 1−Σp²+Σ(q−p)²여서 q=p에서 최소입니다. 하지만 작은 잎의 경험 비율이 실제 p와 같다고 데이터가 보장하지는 않습니다. 이 적절한 확률 손실의 성질과,추정한 확률의 보정·일반화·인과 해석은 서로 다른 주장입니다.

ℓ(y,q)=∑k=1K(qk−1{y=k})2,ℓK=2(y,q)=2(q−y)2\ell(y,q)=\sum_{k=1}^{K}(q_k-\mathbf1\{y=k\})^2,\qquad \ell_{K=2}(y,q)=2(q-y)^2
Ep[ℓ(Y,q)]=1−∑kpk2+∑k(qk−pk)2\mathbb E_p[\ell(Y,q)]=1-\sum_kp_k^2+\sum_k(q_k-p_k)^2

Represent the observed category by a one-hot vector eᵧ and the predicted probabilities by q. Multiclass Brier is Σₖ(qₖ−eᵧ,ₖ)². For two categories this equals 2(q−y)², twice the common positive-category-only binary convention. State which score is reported.

Prediction (3/4,1/4) loses 1/8 on category 0 and 9/8 on category 1. Correct majority classification need not have zero probability loss. Averaging over the original three zeros and one one yields 3/8, equal to Gini: empirical leaf proportions minimize the leaf’s Brier training risk.

At population probability p, expected loss is 1−Σp²+Σ(q−p)² and is minimized at q=p. This proper-score property does not establish that an estimated small-leaf share equals p. Calibration, generalization and causality remain separate questions.

ℓ(y,q)=∑k=1K(qk−1{y=k})2,ℓK=2(y,q)=2(q−y)2\ell(y,q)=\sum_{k=1}^{K}(q_k-\mathbf1\{y=k\})^2,\qquad \ell_{K=2}(y,q)=2(q-y)^2
Ep[ℓ(Y,q)]=1−∑kpk2+∑k(qk−pk)2\mathbb E_p[\ell(Y,q)]=1-\sum_kp_k^2+\sum_k(q_k-p_k)^2
학부 심화 · 선택Advanced undergraduate · optional

교차검증마다 새 나무·새 경로Refit trees and pruning paths in every fold

교차검증은 큰 나무를 전체 자료에 한 번 맞춘 뒤 행 몇 개를 가리는 절차가 아닙니다. 각 접힘에서 훈련 ID와 검증 ID를 분리하고,훈련 목표·특징만으로 후보 문턱·분할·잎의 평균과 확률·가지치기 경로를 새로 만듭니다. 이미 전체 목표로 고른 질문은 검증 행을 나중에 표에서 지워도 그 정보를 잊지 않습니다.

같은 alpha라도 접힘별로 자란 나무와 경로의 문턱은 다를 수 있습니다. 경로의 “세 번째 나무”를 같은 복잡도라고 맞추는 대신,같은 손실 단위의 alpha 후보를 각 훈련 경로에 적용합니다. 각 검증 행을 그 접힘의 나무에 통과시킨 뒤에만 목표를 읽고 손실을 계산합니다.

이 장의 도구는 훈련·검증 ID가 접힘 안에서 겹치면 거절합니다. 하지만 같은 행을 여러 접힘에서 평가하도록 명시할 수는 있습니다. 그 경우 여러 예측 사건으로 분모에 반복 포함되며 독립 표본 수가 그만큼 늘었다고 해석하지 않습니다. 모든 접힘과 예측의 원 ID를 보존하는 이유입니다.

Cross-validation does not fit one tree to all data and merely hide selected rows afterwards. For each fold, training IDs alone construct thresholds, splits, leaf statistics and the pruning path. Removing validation rows from a displayed table cannot erase information already used to choose questions.

A common alpha can select different structures from different fold-specific paths. Compare alpha in common loss units rather than matching each path’s “third tree.” Route each validation observation through its fold-trained model before consulting its target for scoring.

Training and testing IDs within a fold must be disjoint. Repeated testing of an ID across different folds is allowed only as an explicit protocol; it contributes multiple prediction events, not additional independent people. Preserve fold and original ID for every score.

학부 심화 · 선택Advanced undergraduate · optional

alpha 선택·동률·최종 재적합Alpha selection, ties and final refitting

각 alpha의 주 검증 손실은 채점 가능한 모든 예측의 가중 손실 합을 그 무게 합으로 나눈 값입니다. 접힘마다 관측 수가 다른데 접힘별 MSE를 단순 평균하면 다른 질문이 됩니다. 이 장은 합친 예측 사건의 가중 MSE 또는 다중 Brier를 기준으로 선택하고 MAE·분류 오차·분모도 함께 보여 줍니다.

가장 작은 정확 손실이 동률이면 더 큰 alpha를 대표로 고릅니다. 서로 다른 문자열1/2와0.5는 같은 정확 값이므로 alpha 후보를 두 개로 세지 않습니다. 어떤 후보도 채점 가능한 양의 무게가 없으면 선택 alpha와 최종 모형은 미정의입니다. 첫 번째 alpha를 임의로 선택해 완벽한 모형처럼 보이지 않습니다.

선택 후에는 정한 최종 훈련 ID 전체로 큰 나무와 경로를 다시 적합하고 선택 alpha를 적용합니다. 어느 접힘의 나무 하나를 그대로 가져오는 것이 아닙니다. 실제 사례의 최종 훈련 ID에는 외부 시험이 들어가지 않습니다. 최종 나무의 모양이나 잎 수가 접힘마다의 나무와 달라도 재적합의 자연스러운 결과입니다.

L^(α)=∑f∑i∈Vfscorewiℓ(yi,f^α,−f(xi))∑f∑i∈Vfscorewi\widehat L(\alpha)=\frac{\sum_{f}\sum_{i\in V_f^{\mathrm{score}}}w_i\ell(y_i,\widehat f_{\alpha,-f}(x_i))}{\sum_{f}\sum_{i\in V_f^{\mathrm{score}}}w_i}

For each alpha, pool the weighted losses of scoreable predictions and divide by their total weight. Simply averaging fold MSEs answers another question when fold masses differ. We choose by pooled MSE or multiclass Brier and display MAE, classification error and denominators separately.

Exact lowest-score ties select the larger alpha. Equivalent tokens 1/2 and 0.5 are one exact candidate, not two. If no alpha has scoreable positive mass, selection and the final model remain undefined rather than defaulting to the first candidate.

Refit a fresh grown tree and path on the declared final training IDs, then apply the selected alpha. Do not reuse one fold’s tree. Actual-source final IDs exclude outer testing, and the final tree can naturally differ in shape or leaf count from fold models.

L^(α)=∑f∑i∈Vfscorewiℓ(yi,f^α,−f(xi))∑f∑i∈Vfscorewi\widehat L(\alpha)=\frac{\sum_{f}\sum_{i\in V_f^{\mathrm{score}}}w_i\ell(y_i,\widehat f_{\alpha,-f}(x_i))}{\sum_{f}\sum_{i\in V_f^{\mathrm{score}}}w_i}
학부 심화 · 선택Advanced undergraduate · optional

시간·집단·외부 시험의 경계Time, groups and the outer holdout

국가 사례는2020~2023년을 최종 훈련,2024년을 외부 시험으로 고정합니다. 내부 세 접힘은2020→2021,2020~2021→2022,2020~2022→2023으로 훈련보다 뒤의 연도를 평가합니다. 같은 나라가 여러 해에 반복되므로 새 나라에 대한 일반화와 새 해의 같은 나라 예측을 구분합니다. 같은 해 GDP·물가는 사후 제공되어 실제 당시 예측 정보까지 복원한 것은 아닙니다.

개인·기업 사례는 원 행 번호를 이용한 체계적 보류 규칙을 공개합니다. 원 번호를5로 나눈 나머지가0인 적격 행은 외부 시험,나머지는 훈련이며 훈련 안에서는4로 나눈 나머지로 접힘을 정합니다. 원 순서가 무작위라는 증거는 없으므로 이를 새 무작위 IID 표본 분할이라고 부르지 않습니다. 누가 남았는지 전부 내려받을 수 있습니다.

실무에서 지점·가구·사용자별 반복 행이 있으면 같은 집단이 훈련과 시험 양쪽에 새 정보처럼 들어가는지도 확인해야 합니다. 이 장의 고정 분할은 하나의 공개된 비교 계약입니다. 분포 이동이나 새 모집단 성능의 보증이 아니라,어떤 관측으로 어떤 결정을 했는지 독자가 추적할 수 있는 경계입니다.

The country case fixes 2020–2023 as final training and 2024 as outer testing. Inner folds use 2020→2021,2020–2021→2022 and 2020–2022→2023. Repeated countries distinguish later-year prediction from generalization to unseen countries. Same-year macro predictors are supplied retrospectively, not reconstructed real-time information.

Person and business cases disclose a systematic source-order split. Eligible rows with sourceRow modulo 5 equal to zero form the outer test; others train, with modulo 4 inner folds. Source order is not certified random, so this is not described as a new IID random partition. Every membership remains downloadable.

For repeated branches, households or users, examine whether the same group enters both sides as if it were new independent information. Our fixed splits are transparent comparison contracts, not guarantees against distribution shift or certificates of new-population accuracy.

학부 심화 · 선택Advanced undergraduate · optional

검증 실습: 원점·접힘·전체 점수Validation lab: folds, origins and pooled loss

실습 E는 가정한 여섯 행 X=[1,2,3,4,5,6],Y=[1,3,5,7,9,11]에 ID a~f를 붙입니다. 첫 접힘은 a~d로 훈련해 e,f를 평가하고,둘째는 c~f로 훈련해 a,b를 평가합니다. maxDepth=2,minLeaf=1,minGain=0,alpha 후보0,1,10입니다. 훈련 범위 밖의 검증이 많은 의도적인 작은 예제이며 실제 시간 예측의 분할이라고 주장하지 않습니다.

첫 접힘의 alpha0 나무는 e,f에 모두7을 예측해 제곱오차4,16을 냅니다. alpha1의 두 잎 나무는6을 예측해9,25,alpha10 뿌리는4를 예측해25,49입니다. 둘째 접힘에서도 대칭적으로 같은 제곱오차 합을 얻어 합친 MSE는10,17,37이고 alpha0을 고릅니다. 숫자를 먼저 적은 뒤 도구와 비교하세요.

최종 적합은 a~f 여섯 행으로 다시 합니다. 같은 깊이2라도 잎 예측은1,4,7,10이고 훈련 MSE는2/3입니다. 검증 MSE10과 다른 것은 행·분모·역할이 다르기 때문입니다. 누출 점검에서는 한 접힘을 고정합니다. 그 접힘의 검증 목표만 바꾸어도 그 접힘의 훈련 나무는 같아야 합니다. 같은 행이 다른 접힘에서는 훈련에 들어가면 그 다른 나무는 바뀔 수 있습니다.

Lab E labels six assumed rows X=[1,2,3,4,5,6], Y=[1,3,5,7,9,11] as a–f. Fold one trains a–d and tests e,f; fold two trains c–f and tests a,b. Use maxDepth=2, minLeaf=1, minGain=0 and alphas 0,1,10. This deliberately tests outside fold feature ranges, not an asserted real forecasting protocol.

In fold one, alpha 0 predicts 7 twice, with squared errors 4,16. Alpha 1 predicts 6, giving 9,25; alpha 10 predicts 4, giving 25,49. The second fold is symmetric. Pooled MSEs are 10,17,37, selecting alpha 0. Calculate them before using the tool.

Final fitting uses all six rows. At the same depth two, leaf predictions are 1,4,7,10 and training MSE is 2/3. Its difference from validation MSE 10 reflects different records and roles. For leakage checks hold one fold fixed: changing only its validation labels must preserve that fold’s trained tree. Those rows may train other folds, whose fitted trees can legitimately change.

학부 심화 · 선택Advanced undergraduate · optional

확률은 경험 비율이지 보정 보증이 아니다Empirical proportions do not guarantee calibration

한 잎의 두 관측이 모두 이탈하지 않았다고 경험 이탈 비율0이 실제 이탈 확률0을 입증하지는 않습니다. 실제 확률이1/10이어도 두 번 모두0을 관측할 확률은(9/10)²=81/100입니다. 작은 표본의 확신과 모집단의 불가능성은 다릅니다. 정확 분수0이라는 산술은 그 통계적 불확실성을 없애지 않습니다.

보정(calibration)은 비슷한 확률을 낸 관측들의 실제 빈도가 그 예측과 어떻게 맞는지 묻습니다. 구분력은 높은 위험과 낮은 위험을 얼마나 잘 나누는지 묻는 다른 성질입니다. Brier가 작아지는 것은 확률 예측에 유용한 평가지만 한 번의 작은 시험으로 모든 확률 구간의 보정이 보장되지는 않습니다.

평활화나 별도 보정기를 추가한다면 그 선택과 적합도 검증 경계 안에서 해야 합니다. 외부 시험 목표를 보며 보정식을 맞춘 뒤 같은 시험을 최종 성적으로 다시 부르지 않습니다. 이 장의 웹 나무는 경험 비율을 그대로 반환하며 보정기를 구현했다고 주장하지 않습니다. 추가 절차의 필요성과 현재 구현의 범위를 구별합니다.

Two nonchurn observations give empirical churn share zero, not proof that the true probability is zero. Even with true probability 1/10, two zeros occur with probability 81/100. Exact fraction zero does not eliminate statistical uncertainty.

Calibration asks how observed frequencies align among observations receiving comparable probabilities. Discrimination asks how well forecasts distinguish high from low risk. Brier is useful, but one small test does not guarantee calibration in every probability range.

Additional smoothing or calibration must be fitted within the proper selection boundary. Do not fit a calibrator to outer labels and reuse that same exam as a final score. Our tool returns empirical shares without claiming an implemented calibration procedure.

학부 심화 · 선택Advanced undergraduate · optional

중요도·상관 특징·고유값 수 편향Importance, correlated features and cardinality bias

불순도 감소 중요도는 어떤 특징의 질문에서 줄인 뿌리 정규화 위험을 더한 수입니다. 모든 특징의 감소를 합하면 뿌리 위험−최종 잎 위험으로 망원 합처럼 정리됩니다. 전체 감소가0이면 나눌 총량도0이므로 근거 없는100% 중요도를 만들지 않습니다. 이 수는 이 훈련 나무가 어디서 적합을 개선했는지 설명합니다.

완전히 같은 두 특징 열이 있으면 먼저 고른 열이 감소를 가져가고 다른 열은0일 수 있습니다. 열 순서를 바꾸면 이름이 뒤집힐 수 있어0인 열에 정보가 없다는 뜻도 아닙니다. 또 값 종류가 많은 특징은 시험할 후보가 많아 유한 표본 잡음에 맞출 기회도 많습니다. 높은 훈련 중요도를 자동으로 현실의 원인 크기나 미래 유용성이라고 읽지 않습니다.

별도 검증 자료에서 특징을 섞어 손실 변화를 보는 순열 중요도 같은 확장도 가능하지만,상관 특징을 섞으면 현실에 드문 조합이 생길 수 있습니다. 무엇을 보존하며 섞었는지·어떤 손실과 모집단을 평가했는지 추가로 적어야 합니다. 이 장의 기본 출력은 불순도 감소와 원 질문 계보이며 인과 중요도 인증이 아닙니다.

Impurity-decrease importance sums root-normalized risk reductions assigned to questions using a feature. Summing across features telescopes to root risk minus final leaf risk. If total reduction is zero, do not manufacture a100% allocation. The quantity explains training-fit improvement in this particular tree.

Duplicate feature columns may assign all reduction to the first selected one and zero to the other; reordering can swap names. Zero therefore need not mean no predictive information. Features with many distinct values also offer more candidate opportunities to fit finite-sample noise.

Permutation importance on separate evaluation data is a possible extension, but disturbing correlated predictors can create rare combinations. State what was permuted, the population and the loss. Our basic output is impurity reduction and question lineage, not causal importance.

학부 심화 · 선택Advanced undergraduate · optional

관측 규칙을 개입 법칙으로 읽지 않기Do not turn observational rules into interventions

기업 나무가 통화 실패 기록이 많은 고객을 높은 이탈 비율 잎으로 보냈다고 합시다. 그 경로는 보존 기록의 예측 규칙입니다. 서비스 품질을 개선해 실패를 줄이면 이탈도 같은 양만큼 줄어든다는 인과효과를 직접 계산한 것은 아닙니다. 사용량·지역·상품·고객 선택이 함께 관련될 수 있습니다.

경영 질문을 효과 평가로 바꾸려면 무엇을 누구에게 언제 제공하는지,비교하지 않았을 때의 결과를 어떻게 추정하는지 별도 설계가 필요합니다. 위험이 높은 고객과 개입 이익이 큰 고객은 같지 않을 수 있습니다. 예측 확률·개입 비용·효과의 증거·서비스 목표를 같은 숫자 하나에 숨기지 않습니다.

가치중립적인 검토는 관측 사실과 정책 선호를 구별하는 일입니다. 어느 손실을 선택했는지와 누가 평가에 포함되지 않았는지 밝혀야 다른 의사결정자가 결과를 재해석할 수 있습니다. 같은 원자료를 썼다는 사실만으로 원 연구의 인과 추정이나 운영 효과를 재현했다고 주장하지 않습니다.

Suppose the churn tree routes customers with more recorded call failures to a high-churn leaf. This is a predictive rule for retained records, not an identified estimate of how much improving service would reduce churn. Usage, geography, packages and selection may also matter.

An intervention question needs a defined offer, target group, timing and counterfactual comparison. High predicted risk need not equal large treatment benefit. Keep forecast probability, cost, effect evidence and service objectives separate.

A neutral review distinguishes observations from policy preferences. Disclose the chosen loss and excluded populations so other decision makers can reinterpret the evidence. Reusing a source does not reproduce its original causal analysis or establish operational effectiveness.

대학원 연결Graduate bridge

선택된 나무·복잡도·일치성의 조건Selected trees, complexity and consistency conditions

대학원에서는 표본이 커질 때 추정한 규칙이 어떤 모집단 목표에 가까워지는지 묻습니다. 국소 평균을 생각하면 가까운 X끼리 묶는 영역의 크기는 작아지고,각 영역에서 평균을 추정할 유효 관측은 많아져야 한다는 긴장이 보입니다. 상자를 너무 크게 고정하면 편향이 남고,너무 작게 나누면 표본 변동이 큽니다.

이 직관 두 문장만으로 적응적으로 선택한 CART의 일치성을 증명한 것은 아닙니다. 표본의 독립·분포 조건과 적률,자료를 보고 고른 분할의 복잡도 통제,정직한 분할-추정 표본 분리 또는 다른 규칙성이 추가로 필요합니다. 무게를 쓰면 어떤 가중 모집단을 목표로 하는지도 정해야 합니다. 고정 분할의 평균 법칙을 목표로 고른 나무에 그대로 붙이지 않습니다.

이 장의 유한 계산은 깊이5·최대32잎 등 공개한 한계를 갖습니다. 표본이 늘었다는 이유만으로 이 고정된 모형 집합이 모든 복잡한 함수에 보편적으로 일치한다고 보장하지 않습니다. 검증으로 alpha를 골랐다는 사실도 그런 정리를 대신하지 않습니다. 다음 장에서는 여러 나무를 평균하는 목적을 배우되 계산·표현·추정·인과의 주장을 계속 나눠 읽습니다.

Graduate analysis asks what population target a fitted rule approaches as sample size grows. Local averaging suggests a tension: regions should become sufficiently local while retaining enough effective observations to estimate their means. Fixed broad boxes leave approximation bias; tiny boxes can have large sampling variability.

These intuitions alone do not prove consistency of adaptively selected CART. Additional distribution, dependence and moment assumptions, complexity control, honest partition/estimation separation or other regularity are needed. Weighting also changes the population target. A law for a fixed partition cannot simply be attached to a target-selected tree.

Our finite tool has stated caps, including depth five and at most 32 leaves. More observations do not make this fixed class universally consistent for every complex function, and cross-validated alpha is not a substitute proof. The next chapter studies averaging trees while preserving distinctions among computation, representation, estimation and causality.

학부 심화 · 선택Advanced undergraduate · optional

국가 사례: 실제 성장·물가·수명Country case: actual growth, inflation and longevity

국가 사례는 보존한 World Bank2026-10-08 빈티지에서 16개국·2020~2024년의80개 국가-연도 자리를 사용합니다. 목표는 출생 시 기대수명(년),특징은 1인당 실질 GDP(2015년 불변 USD)를10000으로 나눈 값,GDP 증가율%,CPI 상승률%입니다. 네 지표의 원본320행을 보존하므로320개 나라가 있다는 뜻은 아닙니다.

기대수명은 그 시점의 연령별 사망 양상이 계속된다는 조건의 기간 생명표 지표입니다. 현재 태어난 한 개인의 실제 사망 나이를 관측하거나 미래 의료 변화를 예언한 수가 아닙니다. 공식 정의는 생명표·추정·연간화한 계열의 한계도 밝힙니다. 예를 들어 보존 AUS:2020의 목표416/5=83.2년은 공표 지표이며 개인별 수명 기록이 아닙니다.

2020~2023년64행으로 최종 적합하고2024년16행을 외부 시험에 둡니다. 내부 훈련-미래연도 검증에서 후보 alpha0,1/100,1/10,1 중1을 고른 기본 결과는 잎4개이며 외부 MSE는 약3.915866년²입니다. 이 유한 비교는 같은 해의 사후 거시자료를 조건으로 하며,GDP를 올리는 정책의 수명 효과나 세계 모든 국가에 대한 대표 성능을 식별하지 않습니다.

World Bank · 기대수명 원 정의와 측정 한계

국가 · 경제 지표와 기간 기대수명

소득이 높은 나라의 기대수명도 높은지 살피되, 나라 이름을 보고 등급을 만들지 않고 세 경제 지표에서 예측 규칙을 배웁니다. 표적은 해당 연도 사망 패턴을 가상 신생아에게 적용한 기간 기대수명입니다. 실제 2020년 출생 집단을 평생 추적한 수명이 아닙니다.

보존 자료는 World Bank 2026-10-08 개정판에서 16개국의 2020~2024년 네 지표를 새로 읽은 것입니다. 국가별 같은 해 GDP·성장률·물가를 입력으로 제공한 사후 비교이며, 그해에 미리 알 수 있었던 빈티지의 실시간 예보라고 주장하지 않습니다.

2020~2023년 64행에서만 나무·알파를 고르고 2024년 16행은 마지막 시험에만 씁니다. 안쪽 검증은 2021·2022·2023년을 차례로 시험하며 매번 그 이전 연도로 나무를 다시 적합합니다.

원자료·제작자 설명 읽기

무엇을 어떤 단위로 읽나

자료 사전
변수의미·단위
X11인당 GDP / 10,000 · 2015 고정 USD 1만 단위
X2총 GDP 연간 증가율 · %
X3소비자물가 상승률 · %
Y년
weight각 행 1
서로 다른 분모
범위행 수
원 지표 행320
달력/개인/고객 단위 행80
완전·적격 행80
보존한 불완전 행0
훈련64
바깥 시험16
접힘 수3
원순서 앞 12행 · 축약 미리보기
ID역할X1X2X3Y
AUS:2020train5.837777
정확한 원값 전체291888835258901/50000000000000
-0.1335319
정확한 원값 전체-5341276172191/40000000000000
0.8469007
정확한 원값 전체846900734607273/1000000000000000
83.2
AUS:2021train5.946554
정확한 원값 전체14866383917841/2500000000000
2.006948
정확한 원값 전체100347422167517/50000000000000
2.863913
정확한 원값 전체143195642354659/50000000000000
83.3
AUS:2022train6.120046
정확한 원값 전체612004588964781/100000000000000
4.253046
정확한 원값 전체106326139809683/25000000000000
6.594097
정확한 원값 전체659409658717841/100000000000000
83.2
AUS:2023train6.186908
정확한 원값 전체3866817656161/625000000000
3.583821
정확한 원값 전체358382100798981/100000000000000
5.597018
정확한 원값 전체559701792296707/100000000000000
83.05122
정확한 원값 전체830512195121951/10000000000000
AUS:2024outer-test6.148638
정확한 원값 전체768579768443/125000000000
1.373408
정확한 원값 전체5493630934639/4000000000000
3.166567
정확한 원값 전체316656665428797/100000000000000
83.05122
정확한 원값 전체830512195121951/10000000000000
BRA:2020train0.8435011
정확한 원값 전체421750571627489/500000000000000
-3.276759
정확한 원값 전체-511993561949/156250000000
3.211768
정확한 원값 전체20073550237711/6250000000000
74.506
BRA:2021train0.8799229
정확한 원값 전체879922945810901/1000000000000000
4.762604
정확한 원값 전체3720784671161/781250000000
8.30166
정확한 원값 전체830165975585673/100000000000000
73.038
BRA:2022train0.9032085
정확한 원값 전체903208481566299/1000000000000000
3.016694
정확한 원값 전체60333887078603/20000000000000
9.280106
정확한 원값 전체116001326119609/12500000000000
74.872
BRA:2023train0.9288027
정확한 원값 전체928802701470069/1000000000000000
3.241655
정확한 원값 전체324165532906981/100000000000000
4.593563
정확한 원값 전체459356282283203/100000000000000
75.848
BRA:2024outer-test0.9566745
정확한 원값 전체956674518687619/1000000000000000
3.419315
정확한 원값 전체170965758250953/50000000000000
4.367464
정확한 원값 전체27296650478271/6250000000000
76.023
CAN:2020train4.236617
정확한 원값 전체84732342187053/20000000000000
-5.038233
정확한 원값 전체-503823342794087/100000000000000
0.7169996
정확한 원값 전체716999632307827/1000000000000000
81.53
CAN:2021train4.463924
정확한 원값 전체446392381171993/100000000000000
5.950528
정확한 원값 전체595052804984759/100000000000000
3.395193
정확한 원값 전체339519318527527/100000000000000
81.45146
정확한 원값 전체407257317073171/5000000000000

미리보기만으로 적합하지 않습니다. 아래 결과는 선언한 전체 훈련 행과 모든 접힘을 사용합니다.

모형 선택은 시험 자료 밖에서

깊이 상한은 3, 잎의 최소 적격 행 수는 4입니다. 모든 후보 알파에서 접힘별 나무를 다시 적합하고, 각 접힘의 검증 행에서 구한 손실 합을 그 검증 무게 합으로 나눈 통합 손실을 비교합니다. 같은 통합 손실이면 큰 알파를 택합니다. 검증 행이 많은 접힘을 작은 접힘과 같은 무게로 단순 평균하지 않습니다.

모든 알파의 통합 검증
α손실 합무게 합통합 손실선택
0493.4513
정확한 원값 전체20124759264126157014766164993425123/40783680000000000000000000000000
4810.28024
정확한 원값 전체20124759264126157014766164993425123/1957616640000000000000000000000000
0.01493.4513
정확한 원값 전체20124759264126157014766164993425123/40783680000000000000000000000000
4810.28024
정확한 원값 전체20124759264126157014766164993425123/1957616640000000000000000000000000
0.1486.3246
정확한 원값 전체396682119923698031648837325853134721/815673600000000000000000000000000
4810.13176
정확한 원값 전체396682119923698031648837325853134721/39152332800000000000000000000000000
1475.5882
정확한 원값 전체335575045589755421357426795976397/705600000000000000000000000000
489.908088
정확한 원값 전체335575045589755421357426795976397/33868800000000000000000000000000
예
선택 알파의 모든 접힘
접힘훈련 행시험 행잎 수손실 합평균 손실
rolling-202116163186.6284
정확한 원값 전체537489834930743527444632956609/2880000000000000000000000000
11.66428
정확한 원값 전체537489834930743527444632956609/46080000000000000000000000000
rolling-202232163150.3404
정확한 원값 전체3683340161884664894409387269673/24500000000000000000000000000
9.396276
정확한 원값 전체3683340161884664894409387269673/392000000000000000000000000000
rolling-202348164138.6194
정확한 원값 전체138619386861458203195155000341/1000000000000000000000000000
8.663712
정확한 원값 전체138619386861458203195155000341/16000000000000000000000000000

전체 훈련에서 다시 적합한 나무

전체 훈련 나무의 정확 가지치기 경로
α 경계잎 수훈련 위험
073.627752
정확한 원값 전체111444541538274995879148126131/30720000000000000000000000000
0.0350959463.662848
정확한 원값 전체112522688798274995879148126131/30720000000000000000000000000
0.5916244
정확한 원값 전체272620500993218246017751338489/460800000000000000000000000000
54.254472
정확한 원값 전체980230416483671592102486615227/230400000000000000000000000000
0.801251
정확한 원값 전체1846082259549379149668233194529/2304000000000000000000000000000
45.055723
정확한 원값 전체3882795474795365023564366448933/768000000000000000000000000000
1.640632
정확한 원값 전체2520010961/1536000000
28.336988
정확한 원값 전체6402806435795365023564366448933/768000000000000000000000000000
25.61748
정확한 원값 전체157393792910029848849114098750761/6144000000000000000000000000000
133.95447
정확한 원값 전체2781549925285236920501720404563/81920000000000000000000000000

훈련 위험은 원래 뿌리 무게로 정규화합니다. 경계에서 작은 나무를 고릅니다. 이 경로의 최적성은 이미 자란 이 나무의 부분나무 안에서만 성립하며, 모든 가능한 나무 중 전역 최적이라는 뜻은 아닙니다.

선택한 최종 나무의 전체 노드
노드깊이행원 위험잎 예측입력문턱왼쪽오른쪽
n00642173.086
정확한 원값 전체2781549925285236920501720404563/1280000000000000000000000000
77.54899
정확한 원값 전체49631356097560977/640000000000000
X11.040403
정확한 원값 전체104040317164931/100000000000000
n1n8
n1124339.276671.01479X10.7110938
정확한 원값 전체711093824299857/1000000000000000
n2n5
n2216234.159169.80312X10.4881114
정확한 원값 전체976222884353453/2000000000000000
n3n4
n331284.55148
정확한 원값 전체1014617819/12000000
71.50808————
n43410.0772864.68825————
n52834.6469373.43812————
n8140194.2906
정확한 원값 전체777162356098455007854788816311/4000000000000000000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
————

숨겨 둔 시험 행에서 확인하기

바깥 시험의 손실과 단위
지표값
시험 행 수16
시험 손실 합62.65385
정확한 원값 전체3007384715079700804544711481667/48000000000000000000000000000
년²3.915866
정확한 원값 전체3007384715079700804544711481667/768000000000000000000000000000
MAE · 년1.708457
정확한 원값 전체16401187804877989/9600000000000000

가로축은 자료 행의 순서입니다. 잇는 선은 시간 경로나 정책의 효과가 아닙니다. 모든 보존한 결과와 결측 칸을 웹 그래프에 남기며, 바깥 시험 그래프는 관측과 예측을 함께 표시합니다.

바깥 시험 16행의 관측·예측·손실 전체
모든 바깥 시험 행 · 원순서
ID관측예측 / 이탈확률잎오차손실
AUS:202483.05122
정확한 원값 전체830512195121951/10000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n81.581704
정확한 원값 전체632681707317063/400000000000000
2.501788
정확한 원값 전체400286142773633769233610945969/160000000000000000000000000000
BRA:202476.02373.43812n52.5848756.681579
CAN:202482.10805
정확한 원값 전체410540243902439/5000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n80.6385335
정확한 원값 전체255413414634143/400000000000000
0.4077251
정확한 원값 전체65236012375072653590541344449/160000000000000000000000000000
CHN:202478.01781.46952
정확한 원값 전체32587806097560977/400000000000000
n8-3.452515
정확한 원값 전체-1381006097560977/400000000000000
11.91986
정확한 원값 전체1907177841500598723868233194529/160000000000000000000000000000
DEU:202480.79268
정확한 원값 전체807926829268293/10000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n8-0.6768323
정확한 원값 전체-270732926829257/400000000000000
0.458102
정확한 원값 전체73296317669535824719631172049/160000000000000000000000000000
FRA:202482.98049
정확한 원값 전체829804878048781/10000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n81.510973
정확한 원값 전체604389024390263/400000000000000
2.283038
정확한 원값 전체365286092803413923498929209169/160000000000000000000000000000
GBR:202481.38685
정확한 원값 전체406934268292683/5000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n8-0.08266159
정확한 원값 전체-33064634146337/400000000000000
0.006832938
정확한 원값 전체1093270031231114712730517569/160000000000000000000000000000
IDN:202471.28871.50808n3-0.22008330.04843667
IND:202472.23571.50808n30.72691670.5284078
JPN:202484.03634
정확한 원값 전체420181707317073/5000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n82.566826
정확한 원값 전체1026730487804863/400000000000000
6.588597
정확한 원값 전체1054175494588011929564366448769/160000000000000000000000000000
KOR:202483.62927
정확한 원값 전체836292682926829/10000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n82.159753
정확한 원값 전체863901219512183/400000000000000
4.664533
정확한 원값 전체746325317074636997364485425489/160000000000000000000000000000
MEX:202475.26473.43812n51.8258753.33382
SGP:202483.34634
정확한 원값 전체416731707317073/5000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n81.876826
정확한 원값 전체750730487804863/400000000000000
3.522477
정확한 원값 전체563596265319727553564366448769/160000000000000000000000000000
USA:202478.89024
정확한 원값 전체78890243902439/1000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
n8-2.579271
정확한 원값 전체-1031708536585377/400000000000000
6.652641
정확한 원값 전체1064422504463140191698810232129/160000000000000000000000000000
VNM:202474.73671.50808n33.22791710.41945
ZAF:202466.31264.68825n41.623752.636564

손으로 확인하는 한 행

첫 시험 행 AUS:2024의 관측−예측을 제곱한 값이 아래 손실입니다. 평균 손실을 구할 때는 이 한 행을 대표로 삼지 않고 전체 시험 손실을 모두 더한 뒤 16로 나눕니다.

첫 시험 행 재계산
IDy예측 / p손실
AUS:202483.05122
정확한 원값 전체830512195121951/10000000000000
81.46952
정확한 원값 전체32587806097560977/400000000000000
2.501788
정확한 원값 전체400286142773633769233610945969/160000000000000000000000000000

실습·읽기와 해석의 한계

실습에서는 최소 잎 수를 올려 잎이 어떻게 합쳐지는지 먼저 예측한 뒤 계산합니다. 알파를 손으로 고정한 시험과 안쪽 검증으로 고른 시험을 구분합니다. 바깥 시험을 여러 번 본 뒤 설정을 고치면 그 자료를 더는 처음 보는 시험이라고 부르지 않습니다.

공개 Python은 Fraction으로, 별도 base R은 유한 정밀도로 전체 자료·접힘·예측을 다시 계산합니다. Python의 정확한 계산이 자료의 측정 오차·선택 편향·미래 변화까지 없애 주지는 않습니다. 원자료 보존 파일을 이 작업에서 다시 읽었으며 새 HTTP 다운로드라고 주장하지 않습니다.

The country case uses 80 country-year positions for 16 countries in 2020–2024 from the retained World Bank 2026-10-08 vintage. Target is life expectancy at birth in years; features are GDP/person in constant 2015 USD divided by 10,000, annual GDP growth and CPI inflation. Four indicator rows per position produce 320 original rows, not 320 countries.

Period life expectancy summarizes prevailing mortality patterns under their continuation, rather than observing an individual newborn’s eventual age at death. Official definitions also discuss life-table estimation and annual-series limitations. Retained AUS:2020 target 416/5=83.2 years is a published statistic, not individual lifespan microdata.

Final training has 64 records in 2020–2023 and the outer test 16 in 2024. Rolling-year validation selects alpha 1 from 0,1/100,1/10,1 in the default study, producing four leaves and outer MSE about 3.915866 years². Retrospective same-year macro inputs do not identify a GDP intervention’s longevity effect or representative global performance.

World Bank · Original life-expectancy definition and limitations

Countries · Economic indicators and period life expectancy

Ask whether economic indicators help predict life expectancy, without turning country names into official grades. The outcome is period life expectancy: a hypothetical newborn faces that period’s mortality pattern throughout life. It is not a lifetime follow-up of the actual 2020 birth cohort.

The retained World Bank 2026-10-08 revised vintage supplies four indicators for sixteen countries in 2020–2024. Same-year GDP, growth and inflation are retrospectively supplied inputs. This is not a real-time forecast using only releases available before that year.

Only the 64 rows from 2020–2023 choose the tree and alpha. The sixteen 2024 rows are outer tests. Inner tests are 2021, 2022 and 2023; each tree is freshly fitted using only earlier years.

Read the original source and creator documentation

What each variable means

Data dictionary
VariableMeaning and unit
X1GDP per person / 10,000 · 10,000 constant-2015 USD
X2Annual total-GDP growth · %
X3CPI inflation · %
Yyears
weightOne for every row
Distinct denominators
FrameRows
Original indicator records320
Country-year/person/customer rows80
Complete eligible rows80
Retained incomplete rows0
Training64
Outer test16
Inner folds3
First twelve source-order rows · preview
IDRoleX1X2X3Y
AUS:2020train5.837777
Full exact value291888835258901/50000000000000
-0.1335319
Full exact value-5341276172191/40000000000000
0.8469007
Full exact value846900734607273/1000000000000000
83.2
AUS:2021train5.946554
Full exact value14866383917841/2500000000000
2.006948
Full exact value100347422167517/50000000000000
2.863913
Full exact value143195642354659/50000000000000
83.3
AUS:2022train6.120046
Full exact value612004588964781/100000000000000
4.253046
Full exact value106326139809683/25000000000000
6.594097
Full exact value659409658717841/100000000000000
83.2
AUS:2023train6.186908
Full exact value3866817656161/625000000000
3.583821
Full exact value358382100798981/100000000000000
5.597018
Full exact value559701792296707/100000000000000
83.05122
Full exact value830512195121951/10000000000000
AUS:2024outer-test6.148638
Full exact value768579768443/125000000000
1.373408
Full exact value5493630934639/4000000000000
3.166567
Full exact value316656665428797/100000000000000
83.05122
Full exact value830512195121951/10000000000000
BRA:2020train0.8435011
Full exact value421750571627489/500000000000000
-3.276759
Full exact value-511993561949/156250000000
3.211768
Full exact value20073550237711/6250000000000
74.506
BRA:2021train0.8799229
Full exact value879922945810901/1000000000000000
4.762604
Full exact value3720784671161/781250000000
8.30166
Full exact value830165975585673/100000000000000
73.038
BRA:2022train0.9032085
Full exact value903208481566299/1000000000000000
3.016694
Full exact value60333887078603/20000000000000
9.280106
Full exact value116001326119609/12500000000000
74.872
BRA:2023train0.9288027
Full exact value928802701470069/1000000000000000
3.241655
Full exact value324165532906981/100000000000000
4.593563
Full exact value459356282283203/100000000000000
75.848
BRA:2024outer-test0.9566745
Full exact value956674518687619/1000000000000000
3.419315
Full exact value170965758250953/50000000000000
4.367464
Full exact value27296650478271/6250000000000
76.023
CAN:2020train4.236617
Full exact value84732342187053/20000000000000
-5.038233
Full exact value-503823342794087/100000000000000
0.7169996
Full exact value716999632307827/1000000000000000
81.53
CAN:2021train4.463924
Full exact value446392381171993/100000000000000
5.950528
Full exact value595052804984759/100000000000000
3.395193
Full exact value339519318527527/100000000000000
81.45146
Full exact value407257317073171/5000000000000

The preview is not the fitting sample. Results below use every declared training row and every fold.

Select the model before the outer test

Maximum depth is three and minimum eligible rows per leaf is 4. At every alpha, refit each fold’s training tree and pool validation loss sums over validation weight. Exact tied pooled losses choose the larger alpha. Do not average a large and small fold as if their masses were equal.

Pooled validation at every alpha
AlphaLoss sumWeightPooled lossSelected
0493.4513
Full exact value20124759264126157014766164993425123/40783680000000000000000000000000
4810.28024
Full exact value20124759264126157014766164993425123/1957616640000000000000000000000000
0.01493.4513
Full exact value20124759264126157014766164993425123/40783680000000000000000000000000
4810.28024
Full exact value20124759264126157014766164993425123/1957616640000000000000000000000000
0.1486.3246
Full exact value396682119923698031648837325853134721/815673600000000000000000000000000
4810.13176
Full exact value396682119923698031648837325853134721/39152332800000000000000000000000000
1475.5882
Full exact value335575045589755421357426795976397/705600000000000000000000000000
489.908088
Full exact value335575045589755421357426795976397/33868800000000000000000000000000
Yes
Every fold at the selected alpha
FoldTrain rowsTest rowsLeavesLoss sumMean loss
rolling-202116163186.6284
Full exact value537489834930743527444632956609/2880000000000000000000000000
11.66428
Full exact value537489834930743527444632956609/46080000000000000000000000000
rolling-202232163150.3404
Full exact value3683340161884664894409387269673/24500000000000000000000000000
9.396276
Full exact value3683340161884664894409387269673/392000000000000000000000000000
rolling-202348164138.6194
Full exact value138619386861458203195155000341/1000000000000000000000000000
8.663712
Full exact value138619386861458203195155000341/16000000000000000000000000000

Refit the tree using all training rows

Exact pruning path of the full-training grown tree
Alpha breakpointLeavesTraining risk
073.627752
Full exact value111444541538274995879148126131/30720000000000000000000000000
0.0350959463.662848
Full exact value112522688798274995879148126131/30720000000000000000000000000
0.5916244
Full exact value272620500993218246017751338489/460800000000000000000000000000
54.254472
Full exact value980230416483671592102486615227/230400000000000000000000000000
0.801251
Full exact value1846082259549379149668233194529/2304000000000000000000000000000
45.055723
Full exact value3882795474795365023564366448933/768000000000000000000000000000
1.640632
Full exact value2520010961/1536000000
28.336988
Full exact value6402806435795365023564366448933/768000000000000000000000000000
25.61748
Full exact value157393792910029848849114098750761/6144000000000000000000000000000
133.95447
Full exact value2781549925285236920501720404563/81920000000000000000000000000

Normalize training risk by the original root weight and choose the smaller tree at equality. Path optimality holds among subtrees of this already-grown tree, not among all possible trees.

All nodes of the selected final tree
NodeDepthRowsRaw riskLeaf predictionFeatureThresholdLeftRight
n00642173.086
Full exact value2781549925285236920501720404563/1280000000000000000000000000
77.54899
Full exact value49631356097560977/640000000000000
X11.040403
Full exact value104040317164931/100000000000000
n1n8
n1124339.276671.01479X10.7110938
Full exact value711093824299857/1000000000000000
n2n5
n2216234.159169.80312X10.4881114
Full exact value976222884353453/2000000000000000
n3n4
n331284.55148
Full exact value1014617819/12000000
71.50808————
n43410.0772864.68825————
n52834.6469373.43812————
n8140194.2906
Full exact value777162356098455007854788816311/4000000000000000000000000000
81.46952
Full exact value32587806097560977/400000000000000
————

Check the held-out outer rows

Outer-test loss and units
MetricValue
Scored outer rows16
Outer loss sum62.65385
Full exact value3007384715079700804544711481667/48000000000000000000000000000
years²3.915866
Full exact value3007384715079700804544711481667/768000000000000000000000000000
MAE · years1.708457
Full exact value16401187804877989/9600000000000000

The horizontal axis is record order. Connecting marks do not represent a time trajectory or a policy effect. The web plot retains all recorded outcomes and missing slots; the outer plot shows observed and predicted outcomes together.

All 16 outer-test observed values, predictions and losses
All outer-test rows in source order
IDObservedPrediction / churn probabilityLeafErrorLoss
AUS:202483.05122
Full exact value830512195121951/10000000000000
81.46952
Full exact value32587806097560977/400000000000000
n81.581704
Full exact value632681707317063/400000000000000
2.501788
Full exact value400286142773633769233610945969/160000000000000000000000000000
BRA:202476.02373.43812n52.5848756.681579
CAN:202482.10805
Full exact value410540243902439/5000000000000
81.46952
Full exact value32587806097560977/400000000000000
n80.6385335
Full exact value255413414634143/400000000000000
0.4077251
Full exact value65236012375072653590541344449/160000000000000000000000000000
CHN:202478.01781.46952
Full exact value32587806097560977/400000000000000
n8-3.452515
Full exact value-1381006097560977/400000000000000
11.91986
Full exact value1907177841500598723868233194529/160000000000000000000000000000
DEU:202480.79268
Full exact value807926829268293/10000000000000
81.46952
Full exact value32587806097560977/400000000000000
n8-0.6768323
Full exact value-270732926829257/400000000000000
0.458102
Full exact value73296317669535824719631172049/160000000000000000000000000000
FRA:202482.98049
Full exact value829804878048781/10000000000000
81.46952
Full exact value32587806097560977/400000000000000
n81.510973
Full exact value604389024390263/400000000000000
2.283038
Full exact value365286092803413923498929209169/160000000000000000000000000000
GBR:202481.38685
Full exact value406934268292683/5000000000000
81.46952
Full exact value32587806097560977/400000000000000
n8-0.08266159
Full exact value-33064634146337/400000000000000
0.006832938
Full exact value1093270031231114712730517569/160000000000000000000000000000
IDN:202471.28871.50808n3-0.22008330.04843667
IND:202472.23571.50808n30.72691670.5284078
JPN:202484.03634
Full exact value420181707317073/5000000000000
81.46952
Full exact value32587806097560977/400000000000000
n82.566826
Full exact value1026730487804863/400000000000000
6.588597
Full exact value1054175494588011929564366448769/160000000000000000000000000000
KOR:202483.62927
Full exact value836292682926829/10000000000000
81.46952
Full exact value32587806097560977/400000000000000
n82.159753
Full exact value863901219512183/400000000000000
4.664533
Full exact value746325317074636997364485425489/160000000000000000000000000000
MEX:202475.26473.43812n51.8258753.33382
SGP:202483.34634
Full exact value416731707317073/5000000000000
81.46952
Full exact value32587806097560977/400000000000000
n81.876826
Full exact value750730487804863/400000000000000
3.522477
Full exact value563596265319727553564366448769/160000000000000000000000000000
USA:202478.89024
Full exact value78890243902439/1000000000000
81.46952
Full exact value32587806097560977/400000000000000
n8-2.579271
Full exact value-1031708536585377/400000000000000
6.652641
Full exact value1064422504463140191698810232129/160000000000000000000000000000
VNM:202474.73671.50808n33.22791710.41945
ZAF:202466.31264.68825n41.623752.636564

Verify one row by hand

For the first outer row AUS:2024, square observed minus predicted to obtain the loss below. This one row is not a representative replacement for the sample. Sum every outer loss and divide by 16 to obtain mean loss.

Recompute the first outer row
IDyPrediction / pLoss
AUS:202483.05122
Full exact value830512195121951/10000000000000
81.46952
Full exact value32587806097560977/400000000000000
2.501788
Full exact value400286142773633769233610945969/160000000000000000000000000000

Practice, reading and interpretation

Predict what increasing minimum leaf size will do before calculating. Distinguish a manually fixed alpha from one selected by inner validation. If repeated outer-test inspection changes settings, those records are no longer an untouched test.

Public Python uses Fraction arithmetic; the separate base-R program recomputes the full samples, folds and predictions in finite precision. Exact Python arithmetic does not remove measurement error, selection bias or future change. Retained originals were freshly reread for this task; this is not a claim of a new HTTP download.

학부 심화 · 선택Advanced undergraduate · optional

개인 사례: 실제 학력·나이·임금Person case: actual schooling, age and wages

개인 사례는 원 NLS 남성 코호트 자료3613행의52개 원 필드를 모두 보존하고,1976년 시급·교육연수·나이가 완전한3017명을 사용합니다. 목표는 원 시급 센트를100으로 나눈 명목 USD/시간이며 로그 임금이나 상하위 임금을 잘라 만든 목표가 아닙니다. 원자료1행(원 id 2)은 교육7년·나이29·시급548센트=5.48 USD/시간입니다.

적격 원 번호의5 나머지 규칙으로 훈련2413명·외부 시험604명을 분리합니다. 훈련 안의 네 검증 접힘 크기는603,604,603,603명입니다. 기본 성장 설정은 깊이3·최소 잎50이고,후보0,1/100,1/10,1에서 선택 alpha1/100·최종 잎7개를 얻습니다. 외부 MSE는 약4.902418 (USD/시간)²입니다.

학교를 더 다닌 사람을 다른 잎으로 나누었다고 교육의 인과수익률을 추정한 것은 아닙니다. 경력·가정·지역·직업 선택과 결측 구성이 남습니다. 고정 단위 무게와 원 순서의 체계적 보류는 미국 전체 인구 대표 정확도도 보장하지 않습니다. 실제 원행·제외 이유·각 잎의 수와 전체 예측을 보고 결과가 어느 사람들에 관한 것인지 확인합니다.

개인 · 교육·나이와 1976년 원시 임금

같은 교육 연수라도 임금은 사람마다 다릅니다. 나무는 교육·나이 두 질문으로 비슷한 사람들을 묶고 각 잎의 평균 원시 임금을 예측합니다. 표적은 wage76의 센트/시간을 100으로 나눈 1976년 명목 USD/시간이며 로그 임금·현재 구매력·인과적 교육 수익률이 아닙니다.

Card가 공개한 NLS 남성 코호트 3,613행의 원래 52필드를 보존합니다. 임금·교육·나이가 완전한 3,017행만 이 실습 적합에 쓰며 불완전한 596행을 원본에서 지우지 않습니다. 분석 무게는 1로 같고, 원래 조사 무게를 쓴 대표 인구 추정이라고 부르지 않습니다.

완전 행 중 원행 번호를 5로 나눈 나머지가 0인 604행이 바깥 시험이고 나머지 2,413행이 훈련입니다. 안쪽은 훈련 원행 번호를 4로 나눈 나머지로 네 접힘을 만듭니다. 재현 가능한 자료 순서 분할이며 임의 추출·독립성을 보장하지 않습니다.

원자료·제작자 설명 읽기

무엇을 어떤 단위로 읽나

자료 사전
변수의미·단위
X11976년 교육 연수 · 년
X21976년 나이 · 세
Y명목 USD/시간
weight각 행 1
서로 다른 분모
범위행 수
원 기록3613
달력/개인/고객 단위 행3613
완전·적격 행3017
보존한 불완전 행596
훈련2413
바깥 시험604
접힘 수4
원순서 앞 12행 · 축약 미리보기
ID역할X1X2X3Y
person:1train729해당 없음5.48
person:2train1227해당 없음4.81
person:3train1234해당 없음7.21
person:4train1127해당 없음2.5
person:5outer-test1234해당 없음7.29
person:6train1226해당 없음5
person:7train1833해당 없음5.65
person:8train1429해당 없음6.08
person:9train1228해당 없음4.25
person:10outer-test1229해당 없음5.15
person:11train928해당 없음2.25
person:12train1226해당 없음4

미리보기만으로 적합하지 않습니다. 아래 결과는 선언한 전체 훈련 행과 모든 접힘을 사용합니다.

모형 선택은 시험 자료 밖에서

깊이 상한은 3, 잎의 최소 적격 행 수는 50입니다. 모든 후보 알파에서 접힘별 나무를 다시 적합하고, 각 접힘의 검증 행에서 구한 손실 합을 그 검증 무게 합으로 나눈 통합 손실을 비교합니다. 같은 통합 손실이면 큰 알파를 택합니다. 검증 행이 많은 접힘을 작은 접힘과 같은 무게로 단순 평균하지 않습니다.

모든 알파의 통합 검증
α손실 합무게 합통합 손실선택
014511.27
정확한 원값 전체725708718213436102255226569132477355947375818497655088880692922126697905449/50009998295257512644039242155310670857050625894082078124405375456000000
24136.013789
정확한 원값 전체725708718213436102255226569132477355947375818497655088880692922126697905449/120674125886456378010066691320764648778063160282420054514190170975328000000
0.0114499.72
정확한 원값 전체63054879169721828191300460467364143672773965665828962900271186027989674851/4348695503935435882090368883070493118004402251659311141252641344000000
24136.009002
정확한 원값 전체63054879169721828191300460467364143672773965665828962900271186027989674851/10493402250996206783484060114849099893744622633253917783842623563072000000
예
0.114694
정확한 원값 전체27234491485959459649681418267800772207840424882227506389133/1853442557902660725713481439819499056113928648128000000
24136.089517
정확한 원값 전체27234491485959459649681418267800772207840424882227506389133/4472356892219120331146630714284451222402909827932864000000
117131.76
정확한 원값 전체73467662596676602447/4288390001640000
24137.099776
정확한 원값 전체73467662596676602447/10347885073957320000
선택 알파의 모든 접힘
접힘훈련 행시험 행잎 수손실 합평균 손실
source-remainder-0181060373496.23
정확한 원값 전체7218181013865011086935141260069159357/2064561078895959653654161572496000
5.79806
정확한 원값 전체7218181013865011086935141260069159357/1244930330574263671153459428215088000
source-remainder-1180960473638.932
정확한 원값 전체11524806173095271215047011/3167084362504608000000
6.024723
정확한 원값 전체11524806173095271215047011/1912918954952783232000000
source-remainder-2181060373241.332
정확한 원값 전체18039966967318351288063813/5565602834409024000000
5.375343
정확한 원값 전체18039966967318351288063813/3356058509148641472000000
source-remainder-3181060374123.228
정확한 원값 전체44387302160098335249975666017/10765182837427259158440000
6.837857
정확한 원값 전체44387302160098335249975666017/6491405250968637272539320000

전체 훈련에서 다시 적합한 나무

전체 훈련 나무의 정확 가지치기 경로
α 경계잎 수훈련 위험
085.830228
정확한 원값 전체212953443816600952134247/36525750725777677560000
0.008507952
정확한 원값 전체70446183889/8280040590000
75.838736
정확한 원값 전체19913558873646954858501/3410594355719459720000
0.04673509
정확한 원값 전체831359180521/17788756650000
65.885471
정확한 원값 전체1770530299317184844309/300830702424234600000
0.07796121
정확한 원값 전체411820825370161/5282380824600000
55.963432
정확한 원값 전체11781061058796750471/1975550510497630000
0.08984656
정확한 원값 전체236360296561/2630710512000
46.053279
정확한 원값 전체113725549947681227/18787430558160000
0.2013139
정확한 원값 전체37415132137681/185854713380000
36.254592
정확한 원값 전체5563343673494927/889481411280000
0.3992865
정확한 원값 전체287680888445/720487361664
26.653879
정확한 원값 전체233706119931687/35123290180000
0.4414242
정확한 원값 전체37411802775273481/84752499204340000
17.095303
정확한 원값 전체206564459321/29112845000

훈련 위험은 원래 뿌리 무게로 정규화합니다. 경계에서 작은 나무를 고릅니다. 이 경로의 최적성은 이미 자란 이 나무의 부분나무 안에서만 성립하며, 모든 가능한 나무 중 전역 최적이라는 뜻은 아닙니다.

선택한 최종 나무의 전체 노드
노드깊이행원 위험잎 예측입력문턱왼쪽오른쪽
n00241317120.97
정확한 원값 전체206564459321/12065000
5.743303X227.5n1n8
n1111995316.249
정확한 원값 전체31870912199/5995000
5.074762X111.5n2n5
n22179605.29274.129218————
n5210204522.836
정확한 원값 전체46132925219/10200000
5.240696X226.5n6n7
n637843087.7435.058265————
n732361322.3215.846737————
n81121410739.56
정확한 원값 전체26075653897/2428000
6.403583X115.5n9n12
n928545649.4535.825176X111.5n10n11
n103232849.09484.590259————
n1136224314.5886.285788————
n1223604126.637.775694X231.5n13n14
n1332262093.6147.178142————
n1431341816.2168.783507————

숨겨 둔 시험 행에서 확인하기

바깥 시험의 손실과 단위
지표값
시험 행 수604
시험 손실 합2961.06
정확한 원값 전체118310353123573313501594092498053851/39955400646228276710439613472000
(명목 USD/시간)²4.902418
정확한 원값 전체118310353123573313501594092498053851/24133061990321879133105526537088000
MAE · 명목 USD/시간1.709097
정확한 원값 전체2918141464090973433/1707417315254499520

가로축은 자료 행의 순서입니다. 잇는 선은 시간 경로나 정책의 효과가 아닙니다. 모든 보존한 결과와 결측 칸을 웹 그래프에 남기며, 바깥 시험 그래프는 관측과 예측을 함께 표시합니다.

바깥 시험 604행의 관측·예측·손실 전체
모든 바깥 시험 행 · 원순서
ID관측예측 / 이탈확률잎오차손실
person:57.296.285788n111.0042121.008442
정확한 원값 전체975375361/967210000
person:105.156.285788n11-1.1357881.290014
정확한 원값 전체1247714329/967210000
person:158.947.178142n131.7618583.104145
정확한 원값 전체396368281/127690000
person:205.754.129218n21.6207822.626935
person:257.266.285788n110.97421220.9490894
정확한 원값 전체229492201/241802500
person:3035.058265n6-2.0582654.236456
person:352.085.058265n6-2.9782658.870064
person:409.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:453.244.129218n2-0.88921790.7907084
정확한 원값 전체253350889/320410000
person:506.54.590259n101.9097413.647112
정확한 원값 전체490755409/134560000
person:556.217.178142n13-0.96814160.9372981
person:655.387.178142n13-1.7981423.233313
정확한 원값 전체412861761/127690000
person:705.925.058265n60.86173470.7425867
person:805.386.285788n11-0.90578780.8204515
person:8575.058265n61.9417353.770334
person:902.835.058265n6-2.2282654.965166
person:955.54.590259n100.90974140.8276294
정확한 원값 전체111365809/134560000
person:1006.255.058265n61.1917351.420232
person:1058.656.285788n112.3642125.589499
정확한 원값 전체5406219729/967210000
person:1106.255.058265n61.1917351.420232
person:1157.697.178142n130.51185840.261999
person:12011.546.285788n115.25421227.60675
정확한 원값 전체6675380209/241802500
person:1306.827.178142n13-0.35814160.1282654
person:13510.058.783507n141.2664931.604003
정확한 원값 전체288014841/179560000
person:1405.296.285788n11-0.99578780.9915933
정확한 원값 전체959078961/967210000
person:1456.256.285788n11-0.035787780.001280765
person:1509.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:15526.285788n11-4.28578818.36798
정확한 원값 전체1110355684/60450625
person:1607.937.178142n130.75185840.5652911
person:1656.946.285788n110.65421220.4279936
정확한 원값 전체103489929/241802500
person:170145.058265n68.94173579.95462
정확한 원값 전체7678841641/96040000
person:1803.855.058265n6-1.2082651.459905
person:1852.855.846737n7-2.9967378.980434
정확한 원값 전체5001742729/556960000
person:1957.955.846737n72.1032634.423714
정확한 원값 전체2463831769/556960000
person:2006.736.285788n110.44421220.1973245
person:2055.766.285788n11-0.52578780.2764528
person:2105.145.058265n60.081734690.00668056
person:2202.895.058265n6-2.1682654.701374
person:2309.955.846737n74.10326316.83676
정확한 원값 전체9377404569/556960000
person:2356.866.285788n110.57421220.3297197
person:2407.696.285788n111.4042121.971812
정확한 원값 전체1907156241/967210000
person:2505.056.285788n11-1.2357881.527171
정확한 원값 전체1477095489/967210000
person:25511.547.178142n134.36185819.02581
정확한 원값 전체2429405521/127690000
person:26025.058265n6-3.0582659.352987
person:2655.885.058265n60.82173470.6752479
person:2709.297.178142n132.1118584.459946
person:2753.895.058265n6-1.1682651.364844
person:2802.025.058265n6-3.0382659.231056
person:2854.815.058265n6-0.24826530.06163566
person:2904.764.590259n100.16974140.02881214
person:29574.590259n102.4097415.806854
정확한 원값 전체781370209/134560000
person:3007.65.058265n62.5417356.460415
person:30544.590259n10-0.59025860.3484052
person:3105.775.846737n7-0.076737290.005888611
person:3157.75.058265n62.6417356.978762
person:3256.156.285788n11-0.13578780.01843832
person:3307.55.058265n62.4417355.962068
person:3353.134.129218n2-0.99921790.9984364
person:3457.56.285788n111.2142121.474311
정확한 원값 전체356492161/241802500
person:3505.916.285788n11-0.37578780.1412165
정확한 원값 전체136585969/967210000
person:3554.885.058265n6-0.17826530.03177852
person:3659.868.783507n141.0764931.158836
person:3706.156.285788n11-0.13578780.01843832
person:3754.625.058265n6-0.43826530.1920765
person:3806.45.846737n70.55326270.3060996
정확한 원값 전체170485249/556960000
person:38510.15.058265n65.04173525.41909
정확한 원값 전체2441249281/96040000
person:39013.876.285788n117.58421257.52027
정확한 원값 전체55634185161/967210000
person:4004.818.783507n14-3.97350715.78876
person:4055.796.285788n11-0.49578780.2458055
정확한 원값 전체237745561/967210000
person:4109.626.285788n113.33421211.11697
정확한 원값 전체2688111409/241802500
person:4204.85.058265n6-0.25826530.06670097
person:4254.175.058265n6-0.88826530.7890153
person:4307.216.285788n110.92421220.8541682
정확한 원값 전체826160049/967210000
person:43510.587.178142n133.40185811.57264
정확한 원값 전체1477710481/127690000
person:4409.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:45510.17.178142n132.9218588.537257
정확한 원값 전체1090122289/127690000
person:46055.058265n6-0.058265310.003394846
person:47014.426.285788n118.13421266.16541
정확한 원값 전체15998961169/241802500
person:4755.385.058265n60.32173470.1035132
person:4805.615.058265n60.55173470.3044112
person:4854.375.846737n7-1.4767372.180753
정확한 원값 전체1214592201/556960000
person:4957.56.285788n111.2142121.474311
정확한 원값 전체356492161/241802500
person:5005.555.846737n7-0.29673730.08805302
person:5057.455.058265n62.3917355.720395
person:5108.657.178142n131.4718582.166367
person:5155.295.058265n60.23173470.05370097
person:5208.897.178142n131.7118582.930459
person:5257.755.058265n62.6917357.245436
person:5303.335.058265n6-1.7282652.986901
person:53511.548.783507n142.7564937.598251
정확한 원값 전체1364341969/179560000
person:5409.898.783507n141.1064931.224326
정확한 원값 전체219839929/179560000
person:5455.716.285788n11-0.57578780.3315316
정확한 원값 전체320660649/967210000
person:5603.885.058265n6-1.1782651.388309
person:56510.446.285788n114.15421217.25748
정확한 원값 전체1043225401/60450625
person:5705.775.058265n60.71173470.5065663
person:5756.257.178142n13-0.92814160.8614468
person:5805.245.058265n60.18173470.0330275
person:5854.266.285788n11-2.0257884.103816
정확한 원값 전체992313001/241802500
person:5903.255.846737n7-2.5967376.743045
정확한 원값 전체3755606089/556960000
person:5954.885.058265n6-0.17826530.03177852
person:6003.756.285788n11-2.5357886.43022
정확한 원값 전체6219372769/967210000
person:6056.386.285788n110.094212220.008875942
person:6106.297.178142n13-0.88814160.7887955
person:6206.395.058265n61.3317351.773517
person:625104.590259n105.40974129.2653
정확한 원값 전체3937939009/134560000
person:6301.595.058265n6-3.46826512.02886
정확한 원값 전체1155252121/96040000
person:6355.535.058265n60.47173470.2225336
person:64014.426.285788n118.13421266.16541
정확한 원값 전체15998961169/241802500
person:6458.896.285788n112.6042126.781921
정확한 원값 전체6559542081/967210000
person:6556.928.783507n14-1.8635073.47266
정확한 원값 전체623550841/179560000
person:6605.66.285788n11-0.68578780.4703049
person:6655.985.058265n60.92173470.8495948
person:6705.066.285788n11-1.2257881.502556
정확한 원값 전체363321721/241802500
person:6755.576.285788n11-0.71578780.5123521
정확한 원값 전체495552121/967210000
person:6805.845.058265n60.78173470.6111091
person:6856.96.285788n110.61421220.3772566
person:6903.565.058265n6-1.4982652.244799
person:6957.46.285788n111.1142121.241469
person:7002.395.058265n6-2.6682657.11964
person:7056.928.783507n14-1.8635073.47266
정확한 원값 전체623550841/179560000
person:7105.175.058265n60.11173470.01248464
person:7155.966.285788n11-0.32578780.1061377
person:7204.815.058265n6-0.24826530.06163566
person:7257.697.178142n130.51185840.261999
person:7303.776.285788n11-2.5157886.329188
정확한 원값 전체6121654081/967210000
person:7357.166.285788n110.87421220.764247
person:7406.255.058265n61.1917351.420232
person:7454.627.178142n13-2.5581426.544088
정확한 원값 전체835614649/127690000
person:7556.456.285788n110.16421220.02696565
person:7605.255.058265n60.19173470.03676219
person:7655.685.058265n60.62173470.386554
person:7805.816.285788n11-0.47578780.226374
정확한 원값 전체218951209/967210000
person:78556.285788n11-1.2857881.65325
person:79065.058265n60.94173470.8868642
person:8002.435.058265n6-2.6282656.907779
person:80546.285788n11-2.2857885.224826
person:81010.436.285788n114.14421217.17449
person:8155.755.846737n7-0.096737290.009358103
person:8206.625.058265n61.5617352.439015
person:8259.474.590259n104.87974123.81188
person:8302.44.129218n2-1.7292182.990194
정확한 원값 전체958088209/320410000
person:8357.274.129218n23.1407829.864512
person:8407.55.846737n71.6532632.733278
정확한 원값 전체1522326289/556960000
person:8456.416.285788n110.12421220.01542868
person:8503.085.058265n6-1.9782653.913534
person:8604.098.783507n14-4.69350722.02901
정확한 원값 전체3955529449/179560000
person:86510.825.846737n74.97326324.73334
정확한 원값 전체13775482161/556960000
person:8706.735.058265n61.6717352.794697
person:8754.817.178142n13-2.3681425.608095
person:8805.778.783507n14-3.0135079.081227
정확한 원값 전체1630625161/179560000
person:89510.556.285788n114.26421218.18351
정확한 원값 전체17587268689/967210000
person:9006.735.846737n70.88326270.780153
person:9104.945.058265n6-0.11826530.01398668
person:9156.015.058265n60.95173470.9057989
person:9206.437.178142n13-0.74814160.5597158
person:9256.677.178142n13-0.50814160.2582079
person:9303.115.846737n7-2.7367377.489731
정확한 원값 전체4171480569/556960000
person:9355.776.285788n11-0.51578780.266037
정확한 원값 전체257313681/967210000
person:94012.028.783507n143.23649310.47488
정확한 원값 전체1880870161/179560000
person:9458.056.285788n111.7642123.112445
정확한 원값 전체3010387689/967210000
person:9508.556.285788n112.2642125.126657
정확한 원값 전체4958553889/967210000
person:9555.615.846737n7-0.23673730.05604454
person:9606.735.058265n61.6717352.794697
person:96555.058265n6-0.058265310.003394846
person:9707.556.285788n111.2642121.598233
정확한 원값 전체1545826489/967210000
person:97565.058265n60.94173470.8868642
person:98065.058265n60.94173470.8868642
person:985104.129218n25.87078234.46608
정확한 원값 전체11043277569/320410000
person:9907.076.285788n110.78421220.6149888
정확한 원값 전체594823321/967210000
person:99513.228.783507n144.43649319.68247
정확한 원값 전체3534183601/179560000
person:100064.590259n101.4097411.987371
정확한 원값 전체267420609/134560000
person:100545.058265n6-1.0582651.119925
person:10105.455.058265n60.39173470.1534561
person:10155.496.285788n11-0.79578780.6332782
정확한 원값 전체612513001/967210000
person:102096.285788n112.7142127.366948
person:102555.846737n7-0.84673730.716964
정확한 원값 전체399320289/556960000
person:103012.648.783507n143.85649314.87253
정확한 원값 전체2670512329/179560000
person:10359.837.178142n132.6518587.032353
person:10404.445.058265n6-0.61826530.382252
person:104555.846737n7-0.84673730.716964
정확한 원값 전체399320289/556960000
person:10507.266.285788n110.97421220.9490894
정확한 원값 전체229492201/241802500
person:105510.948.783507n142.1564934.65046
정확한 원값 전체835036609/179560000
person:10606.565.058265n61.5017352.255207
person:10707.025.058265n61.9617353.848403
person:10856.495.058265n61.4317352.049864
person:10905.567.178142n13-1.6181422.618382
person:10957.815.058265n62.7517357.572044
person:11009.625.058265n64.56173520.80942
person:11059.386.285788n113.0942129.574149
person:11108.187.178142n131.0018581.00372
정확한 원값 전체128165041/127690000
person:11156.157.178142n13-1.0281421.057075
person:11201.925.058265n6-3.1382659.848709
person:11254.385.058265n6-0.67826530.4600438
person:11354.475.058265n6-0.58826530.3460561
person:11455.75.846737n7-0.14673730.02153183
person:11555.295.058265n60.23173470.05370097
person:11608.656.285788n112.3642125.589499
정확한 원값 전체5406219729/967210000
person:11657.977.178142n130.79185840.6270397
person:11703.935.058265n6-1.1282651.272983
person:11754.815.058265n6-0.24826530.06163566
person:11800.964.590259n10-3.63025913.17878
정확한 원값 전체1773336321/134560000
person:11852.265.058265n6-2.7982657.830289
person:11904.65.058265n6-0.45826530.2100071
person:11953.785.058265n6-1.2782651.633962
person:12004.915.058265n6-0.14826530.0219826
person:12155.067.178142n13-2.1181424.486524
person:12205.886.285788n11-0.40578780.1646637
person:12308.318.783507n14-0.47350750.2242093
person:12459.648.783507n140.85649250.7335795
정확한 원값 전체131721529/179560000
person:12506.096.285788n11-0.19578780.03833286
person:126055.846737n7-0.84673730.716964
정확한 원값 전체399320289/556960000
person:12653.36.285788n11-2.9857888.914929
정확한 원값 전체2155652041/241802500
person:12703.595.058265n6-1.4682652.155803
person:12756.536.285788n110.24421220.05963961
person:12806.227.178142n13-0.95814160.9180353
정확한 원값 전체117223929/127690000
person:12855.756.285788n11-0.53578780.2870685
정확한 원값 전체277655569/967210000
person:129035.058265n6-2.0582654.236456
person:13008.175.058265n63.1117359.682893
person:130555.058265n6-0.058265310.003394846
person:13105.255.058265n60.19173470.03676219
person:13156.045.846737n70.19326270.03735048
person:13207.146.285788n110.85421220.7296785
정확한 원값 전체176438089/241802500
person:13256.567.178142n13-0.61814160.382099
person:13356.735.058265n61.6717352.794697
person:13407.67.178142n130.42185840.1779645
person:13454.756.285788n11-1.5357882.358644
정확한 원값 전체2281304169/967210000
person:13602.255.058265n6-2.8082657.886354
person:13658.177.178142n130.99185840.9837831
person:13708.974.129218n24.84078223.43317
person:13759.298.783507n140.50649250.2565347
person:13802.665.058265n6-2.3982655.751676
person:13858.014.590259n103.41974111.69463
정확한 원값 전체1573629561/134560000
person:139067.178142n13-1.1781421.388018
정확한 원값 전체177235969/127690000
person:14006.585.058265n61.5217352.315676
person:14055.964.129218n21.8307823.351763
정확한 원값 전체1073938441/320410000
person:14107.215.058265n62.1517354.629962
person:14155.636.285788n11-0.65578780.4300576
person:14204.75.058265n6-0.35826530.128354
person:14253.894.129218n2-0.23921790.05722519
person:14306.54.590259n101.9097413.647112
정확한 원값 전체490755409/134560000
person:14407.597.178142n130.41185840.1696273
person:14459.155.058265n64.09173516.74229
정확한 원값 전체1607929801/96040000
person:14502.674.129218n2-1.4592182.129317
person:14557.217.178142n130.031858410.001014958
person:14604.236.285788n11-2.0557884.226263
person:14654.15.846737n7-1.7467373.051091
정확한 원값 전체1699335729/556960000
person:14704.55.058265n6-0.55826530.3116602
person:14758.176.285788n111.8842123.550256
정확한 원값 전체3433842801/967210000
person:14859.136.285788n112.8442128.089543
person:14903.965.846737n7-1.8867373.559778
정확한 원값 전체1982653729/556960000
person:14954.627.178142n13-2.5581426.544088
정확한 원값 전체835614649/127690000
person:15005.496.285788n11-0.79578780.6332782
정확한 원값 전체612513001/967210000
person:15053.854.129218n2-0.27921790.07796262
person:15106.167.178142n13-1.0181421.036612
person:15154.35.058265n6-0.75826530.5749663
person:1520115.846737n75.15326326.55612
정확한 원값 전체14790694689/556960000
person:15259.216.285788n112.9242128.551017
정확한 원값 전체8270629249/967210000
person:15304.115.846737n7-1.7367373.016256
정확한 원값 전체1679934169/556960000
person:15404.234.590259n10-0.36025860.1297863
person:154566.285788n11-0.28578780.08167466
person:15504.497.178142n13-2.6881427.226105
person:15605.715.058265n60.65173470.4247581
person:15657.218.783507n14-1.5735072.475926
person:15707.135.058265n62.0717354.292085
person:15752.66.285788n11-3.68578813.58503
person:15806.25.846737n70.35326270.1247945
person:15858.085.846737n72.2332634.987462
person:15906.935.058265n61.8717353.503391
person:160045.058265n6-1.0582651.119925
person:160577.178142n13-0.17814160.03173443
person:161010.556.285788n114.26421218.18351
정확한 원값 전체17587268689/967210000
person:16156.485.846737n70.63326270.4010217
person:16254.255.058265n6-0.80826530.6532928
person:1630115.058265n65.94173535.30421
정확한 원값 전체3390616441/96040000
person:163575.058265n61.9417353.770334
person:16403.354.129218n2-0.77921790.6071805
person:16456.255.058265n61.1917351.420232
person:16505.56.285788n11-0.78578780.6174624
정확한 원값 전체149303961/241802500
person:16607.135.058265n62.0717354.292085
person:16656.335.058265n61.2717351.617309
person:16708.327.178142n131.1418581.303841
정확한 원값 전체166487409/127690000
person:16757.226.285788n110.93421220.8727525
정확한 원값 전체211033729/241802500
person:16803.935.058265n6-1.1282651.272983
person:16905.24.590259n100.60974140.3717845
person:17004.756.285788n11-1.5357882.358644
정확한 원값 전체2281304169/967210000
person:17105.777.178142n13-1.4081421.982863
person:17154.55.846737n7-1.3467371.813701
정확한 원값 전체1010159089/556960000
person:17206.236.285788n11-0.055787780.003112277
person:17257.216.285788n110.92421220.8541682
정확한 원값 전체826160049/967210000
person:17353.636.285788n11-2.6557887.053209
person:17408.796.285788n112.5042126.271079
정확한 원값 전체6065450161/967210000
person:17453.255.058265n6-1.8082653.269823
person:17502.645.846737n7-3.20673710.28316
정확한 원값 전체5727311041/556960000
person:17559.86.285788n113.51421212.34969
person:17604.634.590259n100.039741380.001579377
person:17654.045.058265n6-1.0182651.036864
person:17709.136.285788n112.8442128.089543
person:17756.155.058265n61.0917351.191885
person:17802.384.129218n2-1.7492183.059763
정확한 원값 전체980378721/320410000
person:17853.655.058265n6-1.4082651.983211
person:17904.625.058265n6-0.43826530.1920765
person:18007.55.058265n62.4417355.962068
person:18104.625.058265n6-0.43826530.1920765
person:18155.65.846737n7-0.24673730.06087929
person:18204.116.285788n11-2.1757884.734052
정확한 원값 전체4578822889/967210000
person:18257.755.846737n71.9032633.622409
정확한 원값 전체2017536889/556960000
person:18308.755.058265n63.69173513.62891
정확한 원값 전체1308920041/96040000
person:18353.46.285788n11-2.8857888.327771
person:184015.028.783507n146.23649338.89384
정확한 원값 전체6983777761/179560000
person:18453.315.058265n6-1.7482653.056432
person:18557.595.058265n62.5317356.409681
person:18605.686.285788n11-0.60578780.3669788
person:18656.256.285788n11-0.035787780.001280765
person:18706.244.590259n101.6497412.721647
정확한 원값 전체366224769/134560000
person:18756.748.783507n14-2.0435074.175923
정확한 원값 전체749828689/179560000
person:18803.276.285788n11-3.0157889.094976
정확한 원값 전체8796751681/967210000
person:18853.854.590259n10-0.74025860.5479828
person:18907.456.285788n111.1642121.35539
정확한 원값 전체1310946849/967210000
person:18957.458.783507n14-1.3335071.778242
정확한 원값 전체319301161/179560000
person:19005.455.058265n60.39173470.1534561
person:19055.777.178142n13-1.4081421.982863
person:19108.655.846737n72.8032637.858282
정확한 원값 전체4376748649/556960000
person:191555.058265n6-0.058265310.003394846
person:19207.55.058265n62.4417355.962068
person:19256.856.285788n110.56421220.3183354
정확한 원값 전체307897209/967210000
person:19353.975.058265n6-1.0882651.184321
person:19409.626.285788n113.33421211.11697
정확한 원값 전체2688111409/241802500
person:19455.46.285788n11-0.88578780.78462
person:19503.65.058265n6-1.4582652.126538
person:19557.267.178142n130.081858410.006700799
person:19603.754.590259n10-0.84025860.7060345
person:19656.496.285788n110.20421220.04170263
person:19703.154.590259n10-1.4402592.074345
정확한 원값 전체279123849/134560000
person:19756.934.590259n102.3397415.47439
정확한 원값 전체736633881/134560000
person:198045.058265n6-1.0582651.119925
person:19859.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:19954.575.058265n6-0.48826530.238403
person:20003.634.129218n2-0.49921790.2492185
person:20054.276.285788n11-2.0157884.0634
정확한 원값 전체3930161481/967210000
person:20103.756.285788n11-2.5357886.43022
정확한 원값 전체6219372769/967210000
person:20153.554.590259n10-1.0402591.082138
정확한 원값 전체145612489/134560000
person:20204.437.178142n13-2.7481427.552282
person:20254.814.590259n100.21974140.04828627
person:20302.55.846737n7-3.34673711.20065
정확한 원값 전체6238314289/556960000
person:203513.747.178142n136.56185843.05799
정확한 원값 전체5498074201/127690000
person:20404.445.058265n6-0.61826530.382252
person:20453.15.058265n6-1.9582653.834803
person:20506.736.285788n110.44421220.1973245
person:20603.085.058265n6-1.9782653.913534
person:20657.698.783507n14-1.0935071.195759
정확한 원값 전체214710409/179560000
person:20707.367.178142n130.18185840.03307248
person:20757.216.285788n110.92421220.8541682
정확한 원값 전체826160049/967210000
person:20952.876.285788n11-3.41578811.66761
정확한 원값 전체11285025361/967210000
person:21005.486.285788n11-0.80578780.6492939
person:21053.756.285788n11-2.5357886.43022
정확한 원값 전체6219372769/967210000
person:211011.556.285788n115.26421227.71193
정확한 원값 전체26803256089/967210000
person:21154.166.285788n11-2.1257884.518974
person:21203.755.058265n6-1.3082651.711558
person:21254.54.590259n10-0.090258620.008146619
person:21301.985.058265n6-3.0782659.475717
person:21351.674.129218n2-2.4592186.047753
person:21403.985.058265n6-1.0782651.162656
person:214534.590259n10-1.5902592.528922
정확한 원값 전체340291809/134560000
person:215534.129218n2-1.1292181.275133
정확한 원값 전체408565369/320410000
person:21602.445.846737n7-3.40673711.60586
정확한 원값 전체6463999201/556960000
person:21704.956.285788n11-1.3357881.784329
정확한 원값 전체1725820849/967210000
person:218035.058265n6-2.0582654.236456
person:21852.64.129218n2-1.5292182.338507
정확한 원값 전체749281129/320410000
person:219054.590259n100.40974140.167888
person:21953.855.058265n6-1.2082651.459905
person:22002.675.058265n6-2.3882655.703811
person:22156.254.590259n101.6597412.754741
정확한 원값 전체370678009/134560000
person:222065.058265n60.94173470.8868642
person:22255.56.285788n11-0.78578780.6174624
정확한 원값 전체149303961/241802500
person:2230106.285788n113.71421213.79537
person:223511.427.178142n134.24185817.99336
정확한 원값 전체2297572489/127690000
person:22452.55.058265n6-2.5582656.544721
person:225034.129218n2-1.1292181.275133
정확한 원값 전체408565369/320410000
person:22555.586.285788n11-0.70578780.4981364
person:22602.44.129218n2-1.7292182.990194
정확한 원값 전체958088209/320410000
person:22654.135.058265n6-0.92826530.8616765
person:227510.976.285788n114.68421221.94184
정확한 원값 전체21222371041/967210000
person:22805.777.178142n13-1.4081421.982863
person:22851.966.285788n11-4.32578818.71244
정확한 원값 전체1131178689/60450625
person:22909.455.058265n64.39173519.28733
정확한 원값 전체1852355521/96040000
person:22954.26.285788n11-2.0857884.350511
person:23005.55.058265n60.44173470.1951295
person:23057.54.129218n23.37078211.36217
정확한 원값 전체3640553569/320410000
person:23104.756.285788n11-1.5357882.358644
정확한 원값 전체2281304169/967210000
person:23152.636.285788n11-3.65578813.36478
person:23203.464.590259n10-1.1302591.277485
정확한 원값 전체171898321/134560000
person:23253.194.590259n10-1.4002591.960724
정확한 원값 전체263835049/134560000
person:23302.34.129218n2-1.8292183.346038
정확한 원값 전체1072104049/320410000
person:23355.196.285788n11-1.0957881.200751
정확한 원값 전체1161378241/967210000
person:23403.165.058265n6-1.8982653.603411
person:23454.518.783507n14-4.27350718.26287
person:23508.556.285788n112.2642125.126657
정확한 원값 전체4958553889/967210000
person:23554.055.058265n6-1.0082651.016599
person:23604.525.058265n6-0.53826530.2897295
person:23703.755.058265n6-1.3082651.711558
person:23756.256.285788n11-0.035787780.001280765
person:238055.058265n6-0.058265310.003394846
person:23854.95.058265n6-0.15826530.02504791
person:239045.058265n6-1.0582651.119925
person:23953.255.846737n7-2.5967376.743045
정확한 원값 전체3755606089/556960000
person:24006.196.285788n11-0.095787780.009175299
person:24053.256.285788n11-3.0357889.216007
정확한 원값 전체8913814569/967210000
person:24106.865.058265n61.8017353.246248
person:24154.624.129218n20.49078210.2408671
person:242044.590259n10-0.59025860.3484052
person:24252.826.285788n11-3.46578812.01168
정확한 원값 전체2904455449/241802500
person:24309.596.285788n113.30421210.91782
정확한 원값 전체10559823121/967210000
person:24354.755.058265n6-0.30826530.0950275
person:24456.736.285788n110.44421220.1973245
person:24503.754.590259n10-0.84025860.7060345
person:245517.637.178142n1310.45186109.2413
정확한 원값 전체3487256809/31922500
person:24602.754.590259n10-1.8402593.386552
정확한 원값 전체455694409/134560000
person:24655.074.129218n20.94078210.885071
person:247010.687.178142n133.50185812.26301
정확한 원값 전체1565864041/127690000
person:24757.55.058265n62.4417355.962068
person:24854.625.846737n7-1.2267371.504884
정확한 원값 전체838160401/556960000
person:25008.946.285788n112.6542127.044843
정확한 원값 전체1703460529/241802500
person:25052.414.590259n10-2.1802594.753528
정확한 원값 전체639634681/134560000
person:25105.655.058265n60.59173470.3501499
person:25154.134.129218n20.00078212296.117162e-07
person:25257.785.846737n71.9332633.737505
person:25353.54.129218n2-0.62921790.3959151
정확한 원값 전체126855169/320410000
person:25408.667.178142n131.4818582.195904
person:25451.485.058265n6-3.57826512.80398
정확한 원값 전체1229694489/96040000
person:25506.928.783507n14-1.8635073.47266
정확한 원값 전체623550841/179560000
person:25558.657.178142n131.4718582.166367
person:25607.127.178142n13-0.058141590.003380445
person:25657.386.285788n111.0942121.1973
person:25708.696.285788n112.4042125.780236
정확한 원값 전체5590702441/967210000
person:25754.628.783507n14-4.16350717.33479
정확한 원값 전체3112635681/179560000
person:25807.76.285788n111.4142121.999996
정확한 원값 전체483604081/241802500
person:25857.135.058265n62.0717354.292085
person:25907.216.285788n110.92421220.8541682
정확한 원값 전체826160049/967210000
person:259545.058265n6-1.0582651.119925
person:26005.535.058265n60.47173470.2225336
person:260534.129218n2-1.1292181.275133
정확한 원값 전체408565369/320410000
person:26107.515.058265n62.4517356.011003
person:261510.588.783507n141.7964933.227385
정확한 원값 전체579509329/179560000
person:26255.386.285788n11-0.90578780.8204515
person:26306.54.590259n101.9097413.647112
정확한 원값 전체490755409/134560000
person:26402.865.058265n6-2.1982654.83237
person:26502.775.846737n7-3.0767379.466312
정확한 원값 전체5272357321/556960000
person:26556.736.285788n110.44421220.1973245
person:266014.436.285788n118.14421266.32819
정확한 원값 전체2566131649/38688400
person:26654.794.129218n20.66078210.436633
person:26706.256.285788n11-0.035787780.001280765
person:26806.155.058265n61.0917351.191885
person:26858.435.058265n63.37173511.36859
정확한 원값 전체1091839849/96040000
person:269010.147.178142n132.9618588.772605
정확한 원값 전체1120173961/127690000
person:27007.456.285788n111.1642121.35539
정확한 원값 전체1310946849/967210000
person:271057.178142n13-2.1781424.744301
정확한 원값 전체605799769/127690000
person:27159.626.285788n113.33421211.11697
정확한 원값 전체2688111409/241802500
person:27256.756.285788n110.46421220.215493
정확한 원값 전체208426969/967210000
person:273011.758.783507n142.9664938.800078
정확한 원값 전체1580142001/179560000
person:273510.296.285788n114.00421216.03372
정확한 원값 전체15507969961/967210000
person:27403.54.590259n10-1.0902591.188664
정확한 원값 전체159946609/134560000
person:27457.285.058265n62.2217354.936105
person:27509.838.783507n141.0464931.095147
정확한 원값 전체196644529/179560000
person:27553.135.058265n6-1.9282653.718207
person:276045.846737n7-1.8467373.410439
정확한 원값 전체1899477889/556960000
person:27702.555.058265n6-2.5082656.291395
person:27757.696.285788n111.4042121.971812
정확한 원값 전체1907156241/967210000
person:27859.066.285788n112.7742127.696253
정확한 원값 전체1860973321/241802500
person:27905.925.058265n60.86173470.7425867
person:28004.427.178142n13-2.7581427.607345
정확한 원값 전체971381889/127690000
person:28057.246.285788n110.95421220.910521
person:28105.776.285788n11-0.51578780.266037
정확한 원값 전체257313681/967210000
person:28255.776.285788n11-0.51578780.266037
정확한 원값 전체257313681/967210000
person:28306.255.058265n61.1917351.420232
person:28357.36.285788n111.0142121.028626
정확한 원값 전체248724441/241802500
person:28404.115.058265n6-0.94826530.8992071
person:28507.217.178142n130.031858410.001014958
person:28553.255.058265n6-1.8082653.269823
person:28608.526.285788n112.2342124.991704
person:286510.688.783507n141.8964933.596684
정확한 원값 전체645820569/179560000
person:28758.016.285788n111.7242122.972908
정확한 원값 전체2875426129/967210000
person:28807.98.783507n14-0.88350750.7805854
정확한 원값 전체140161921/179560000
person:29005.316.285788n11-0.97578780.9521618
정확한 원값 전체920940409/967210000
person:29054.866.285788n11-1.4257882.032871
정확한 원값 전체491553241/241802500
person:29106.255.058265n61.1917351.420232
person:292076.285788n110.71421220.5100991
person:29254.85.058265n6-0.25826530.06670097
person:29307.236.285788n110.94421220.8915367
person:293512.025.058265n66.96173548.46575
person:29404.816.285788n11-1.4757882.17795
정확한 원값 전체2106534609/967210000
person:29454.57.178142n13-2.6781427.172442
정확한 원값 전체915849169/127690000
person:29502.755.058265n6-2.3082655.328089
person:29553.55.058265n6-1.5582652.428191
person:29602.54.129218n2-1.6292182.654351
정확한 원값 전체850480569/320410000
person:29655.785.058265n60.72173470.520901
person:29704.826.285788n11-1.4657882.148534
정확한 원값 전체519520849/241802500
person:29751.454.129218n2-2.6792187.178208
person:29809.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:29852.35.058265n6-2.7582657.608027
person:29904.56.285788n11-1.7857883.189038
정확한 원값 전체771117361/241802500
person:29957.55.058265n62.4417355.962068
person:30003.884.590259n10-0.71025860.5044673
person:30102.355.846737n7-3.49673712.22717
정확한 원값 전체6810045529/556960000
person:301545.058265n6-1.0582651.119925
person:30203.85.058265n6-1.2582651.583232
person:30255.966.285788n11-0.32578780.1061377
person:30308.66.285788n112.3142125.355578
person:30403.24.129218n2-0.92921790.8634459
정확한 원값 전체276656689/320410000
person:30451.94.129218n2-2.2292184.969412
정확한 원값 전체1592249409/320410000
person:30505.385.058265n60.32173470.1035132
person:305510.265.846737n74.41326319.47689
정확한 원값 전체10847847409/556960000
person:30603.54.590259n10-1.0902591.188664
정확한 원값 전체159946609/134560000
person:30653.16.285788n11-3.18578810.14924
정확한 원값 전체2454112521/241802500
person:30754.796.285788n11-1.4957882.237381
정확한 원값 전체2164017361/967210000
person:30804.235.058265n6-0.82826530.6860234
person:30855.295.058265n60.23173470.05370097
person:30903.814.590259n10-0.78025860.6088035
person:30952.65.058265n6-2.4582656.043068
person:31002.54.129218n2-1.6292182.654351
정확한 원값 전체850480569/320410000
person:310535.058265n6-2.0582654.236456
person:31103.754.590259n10-0.84025860.7060345
person:31154.575.058265n6-0.48826530.238403
person:31206.55.058265n61.4417352.078599
person:312544.129218n2-0.12921790.01669726
person:31307.347.178142n130.16185840.02619814
person:31355.777.178142n13-1.4081421.982863
person:31403.646.285788n11-2.6457887.000193
person:31453.85.058265n6-1.2582651.583232
person:31502.576.285788n11-3.71578813.80708
정확한 원값 전체13354344721/967210000
person:31554.335.058265n6-0.72826530.5303704
person:31604.334.590259n10-0.26025860.06773455
person:31653.755.058265n6-1.3082651.711558
person:31708.486.285788n112.1942124.814567
person:31806.495.058265n61.4317352.049864
person:31855.925.846737n70.073262710.005367425
person:31909.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:31953.596.285788n11-2.6957887.267272
정확한 원값 전체7028977921/967210000
person:32054.626.285788n11-1.6657882.774849
정확한 원값 전체670965409/241802500
person:321034.590259n10-1.5902592.528922
정확한 원값 전체340291809/134560000
person:32153.54.590259n10-1.0902591.188664
정확한 원값 전체159946609/134560000
person:32202.754.590259n10-1.8402593.386552
정확한 원값 전체455694409/134560000
person:32251.635.058265n6-3.42826511.753
정확한 원값 전체1128758409/96040000
person:32305.654.129218n21.5207822.312778
person:32356.425.058265n61.3617351.854321
person:324045.058265n6-1.0582651.119925
person:32454.454.129218n20.32078210.1029012
person:32504.195.058265n6-0.86826530.7538846
person:32653.86.285788n11-2.4857886.179141
person:32707.695.058265n62.6317356.926027
person:32804.755.058265n6-0.30826530.0950275
person:32852.65.846737n7-3.24673710.5413
정확한 원값 전체5871084129/556960000
person:32908.037.178142n130.85185840.7256627
person:32954.174.129218n20.040782120.001663182
person:33002.655.058265n6-2.4082655.799742
person:33055.65.058265n60.54173470.2934765
person:33152.254.590259n10-2.3402595.47681
정확한 원값 전체736959609/134560000
person:33205.776.285788n11-0.51578780.266037
정확한 원값 전체257313681/967210000
person:33254.065.846737n7-1.7867373.19243
정확한 원값 전체1778055889/556960000
person:33305.776.285788n11-0.51578780.266037
정확한 원값 전체257313681/967210000
person:33357.275.058265n62.2117354.89177
person:33453.857.178142n13-3.32814211.07653
person:33552.55.058265n6-2.5582656.544721
person:33604.325.846737n7-1.5267372.330927
정확한 원값 전체1298232961/556960000
person:33653.315.846737n7-2.5367376.435036
정확한 원값 전체3584057689/556960000
person:33703.856.285788n11-2.4357885.933062
정확한 원값 전체5738517009/967210000
person:33808.015.846737n72.1632634.679706
정확한 원값 전체2606408809/556960000
person:33853.614.129218n2-0.51921790.2695872
person:33904.866.285788n11-1.4257882.032871
정확한 원값 전체491553241/241802500
person:33954.486.285788n11-1.8057883.26087
person:34052.64.590259n10-1.9902593.961129
정확한 원값 전체533009569/134560000
person:34102.55.846737n7-3.34673711.20065
정확한 원값 전체6238314289/556960000
person:34201.925.058265n6-3.1382659.848709
person:34253.535.058265n6-1.5282652.335595
person:34309.736.285788n113.44421211.8626
person:343544.129218n2-0.12921790.01669726
person:34454.385.058265n6-0.67826530.4600438
person:34502.455.058265n6-2.6082656.803048
person:34552.895.058265n6-2.1682654.701374
person:34606.257.178142n13-0.92814160.8614468
person:34704.354.129218n20.22078210.04874475
person:34752.885.058265n6-2.1782654.74484
person:34802.455.058265n6-2.6082656.803048
person:34905.535.846737n7-0.31673730.1003225
person:34952.55.058265n6-2.5582656.544721
person:35005.135.058265n60.071734690.005145866
person:35055.425.058265n60.36173470.130852
person:35103.755.058265n6-1.3082651.711558
person:351555.058265n6-0.058265310.003394846
person:35208.574.129218n24.44078219.72055
person:35258.086.285788n111.7942123.219197
person:35309.627.178142n132.4418585.962672
정확한 원값 전체761373649/127690000
person:35351.234.129218n2-2.8992188.405464
person:35402.254.590259n10-2.3402595.47681
정확한 원값 전체736959609/134560000
person:35505.397.178142n13-1.7881423.19745
person:35552.54.590259n10-2.0902594.369181
정확한 원값 전체587917009/134560000
person:35603.666.285788n11-2.6257886.894761
정확한 원값 전체1667170561/241802500
person:35704.634.590259n100.039741380.001579377
person:35756.257.178142n13-0.92814160.8614468
person:358035.058265n6-2.0582654.236456
person:358534.129218n2-1.1292181.275133
정확한 원값 전체408565369/320410000
person:35902.635.846737n7-3.21673710.3474
person:36003.855.058265n6-1.2082651.459905
person:36054.75.058265n6-0.35826530.128354
person:361055.058265n6-0.058265310.003394846

손으로 확인하는 한 행

첫 시험 행 person:5의 관측−예측을 제곱한 값이 아래 손실입니다. 평균 손실을 구할 때는 이 한 행을 대표로 삼지 않고 전체 시험 손실을 모두 더한 뒤 604로 나눕니다.

첫 시험 행 재계산
IDy예측 / p손실
person:57.296.2857881.008442
정확한 원값 전체975375361/967210000

실습·읽기와 해석의 한계

실습에서는 최소 잎 수를 올려 잎이 어떻게 합쳐지는지 먼저 예측한 뒤 계산합니다. 알파를 손으로 고정한 시험과 안쪽 검증으로 고른 시험을 구분합니다. 바깥 시험을 여러 번 본 뒤 설정을 고치면 그 자료를 더는 처음 보는 시험이라고 부르지 않습니다.

공개 Python은 Fraction으로, 별도 base R은 유한 정밀도로 전체 자료·접힘·예측을 다시 계산합니다. Python의 정확한 계산이 자료의 측정 오차·선택 편향·미래 변화까지 없애 주지는 않습니다. 원자료 보존 파일을 이 작업에서 다시 읽었으며 새 HTTP 다운로드라고 주장하지 않습니다.

The person case preserves all 52 original fields for 3,613 records in a male NLS cohort and uses 3,017 complete 1976 wage/schooling/age observations. Target is raw cents/hour divided by 100, not trimmed or logged wage. Source row 1 (native id 2) has schooling 7 years, age 29 and wage 548 cents=$5.48/hour.

The eligible source-order modulo-five rule yields 2,413 training and 604 outer-test people. Inner validation sizes are 603,604,603,603. Default depth three and minimum leaf 50, with alphas 0,1/100,1/10,1, select 1/100 and a seven-leaf final tree. Outer MSE is about 4.902418 (USD/hour)².

Separating schooling groups does not estimate a causal schooling return. Experience, family, geography, jobs and missingness can remain relevant. Unit weights and systematic source-order holdouts do not certify representative U.S. population accuracy. Inspect original records, exclusions, memberships and every prediction to identify the population actually evaluated.

People · Schooling, age and raw 1976 wages

People with the same schooling can earn different wages. The tree groups people by schooling and age and predicts each leaf’s mean raw wage. The target is wage76 in cents/hour divided by 100: nominal 1976 USD/hour, not log wages, current purchasing power or a causal return to schooling.

The public Card NLS male cohort retains all 3,613 original rows and 52 native fields. The teaching fit uses the 3,017 rows complete on wage, schooling and age. The 596 incomplete records remain in the original CSV. Equal analysis weights are not a claim of survey-weighted population representativeness.

Among complete rows, source-row remainder zero modulo five selects the 604 outer tests; 2,413 rows train. Training-row remainders modulo four define four inner folds. This reproducible source-order partition does not guarantee random sampling or independence.

Read the original source and creator documentation

What each variable means

Data dictionary
VariableMeaning and unit
X1Schooling in 1976 · years
X2Age in 1976 · years
Ynominal USD/hour
weightOne for every row
Distinct denominators
FrameRows
Original records3613
Country-year/person/customer rows3613
Complete eligible rows3017
Retained incomplete rows596
Training2413
Outer test604
Inner folds4
First twelve source-order rows · preview
IDRoleX1X2X3Y
person:1train729Not applicable5.48
person:2train1227Not applicable4.81
person:3train1234Not applicable7.21
person:4train1127Not applicable2.5
person:5outer-test1234Not applicable7.29
person:6train1226Not applicable5
person:7train1833Not applicable5.65
person:8train1429Not applicable6.08
person:9train1228Not applicable4.25
person:10outer-test1229Not applicable5.15
person:11train928Not applicable2.25
person:12train1226Not applicable4

The preview is not the fitting sample. Results below use every declared training row and every fold.

Select the model before the outer test

Maximum depth is three and minimum eligible rows per leaf is 50. At every alpha, refit each fold’s training tree and pool validation loss sums over validation weight. Exact tied pooled losses choose the larger alpha. Do not average a large and small fold as if their masses were equal.

Pooled validation at every alpha
AlphaLoss sumWeightPooled lossSelected
014511.27
Full exact value725708718213436102255226569132477355947375818497655088880692922126697905449/50009998295257512644039242155310670857050625894082078124405375456000000
24136.013789
Full exact value725708718213436102255226569132477355947375818497655088880692922126697905449/120674125886456378010066691320764648778063160282420054514190170975328000000
0.0114499.72
Full exact value63054879169721828191300460467364143672773965665828962900271186027989674851/4348695503935435882090368883070493118004402251659311141252641344000000
24136.009002
Full exact value63054879169721828191300460467364143672773965665828962900271186027989674851/10493402250996206783484060114849099893744622633253917783842623563072000000
Yes
0.114694
Full exact value27234491485959459649681418267800772207840424882227506389133/1853442557902660725713481439819499056113928648128000000
24136.089517
Full exact value27234491485959459649681418267800772207840424882227506389133/4472356892219120331146630714284451222402909827932864000000
117131.76
Full exact value73467662596676602447/4288390001640000
24137.099776
Full exact value73467662596676602447/10347885073957320000
Every fold at the selected alpha
FoldTrain rowsTest rowsLeavesLoss sumMean loss
source-remainder-0181060373496.23
Full exact value7218181013865011086935141260069159357/2064561078895959653654161572496000
5.79806
Full exact value7218181013865011086935141260069159357/1244930330574263671153459428215088000
source-remainder-1180960473638.932
Full exact value11524806173095271215047011/3167084362504608000000
6.024723
Full exact value11524806173095271215047011/1912918954952783232000000
source-remainder-2181060373241.332
Full exact value18039966967318351288063813/5565602834409024000000
5.375343
Full exact value18039966967318351288063813/3356058509148641472000000
source-remainder-3181060374123.228
Full exact value44387302160098335249975666017/10765182837427259158440000
6.837857
Full exact value44387302160098335249975666017/6491405250968637272539320000

Refit the tree using all training rows

Exact pruning path of the full-training grown tree
Alpha breakpointLeavesTraining risk
085.830228
Full exact value212953443816600952134247/36525750725777677560000
0.008507952
Full exact value70446183889/8280040590000
75.838736
Full exact value19913558873646954858501/3410594355719459720000
0.04673509
Full exact value831359180521/17788756650000
65.885471
Full exact value1770530299317184844309/300830702424234600000
0.07796121
Full exact value411820825370161/5282380824600000
55.963432
Full exact value11781061058796750471/1975550510497630000
0.08984656
Full exact value236360296561/2630710512000
46.053279
Full exact value113725549947681227/18787430558160000
0.2013139
Full exact value37415132137681/185854713380000
36.254592
Full exact value5563343673494927/889481411280000
0.3992865
Full exact value287680888445/720487361664
26.653879
Full exact value233706119931687/35123290180000
0.4414242
Full exact value37411802775273481/84752499204340000
17.095303
Full exact value206564459321/29112845000

Normalize training risk by the original root weight and choose the smaller tree at equality. Path optimality holds among subtrees of this already-grown tree, not among all possible trees.

All nodes of the selected final tree
NodeDepthRowsRaw riskLeaf predictionFeatureThresholdLeftRight
n00241317120.97
Full exact value206564459321/12065000
5.743303X227.5n1n8
n1111995316.249
Full exact value31870912199/5995000
5.074762X111.5n2n5
n22179605.29274.129218————
n5210204522.836
Full exact value46132925219/10200000
5.240696X226.5n6n7
n637843087.7435.058265————
n732361322.3215.846737————
n81121410739.56
Full exact value26075653897/2428000
6.403583X115.5n9n12
n928545649.4535.825176X111.5n10n11
n103232849.09484.590259————
n1136224314.5886.285788————
n1223604126.637.775694X231.5n13n14
n1332262093.6147.178142————
n1431341816.2168.783507————

Check the held-out outer rows

Outer-test loss and units
MetricValue
Scored outer rows604
Outer loss sum2961.06
Full exact value118310353123573313501594092498053851/39955400646228276710439613472000
(nominal USD/hour)²4.902418
Full exact value118310353123573313501594092498053851/24133061990321879133105526537088000
MAE · nominal USD/hour1.709097
Full exact value2918141464090973433/1707417315254499520

The horizontal axis is record order. Connecting marks do not represent a time trajectory or a policy effect. The web plot retains all recorded outcomes and missing slots; the outer plot shows observed and predicted outcomes together.

All 604 outer-test observed values, predictions and losses
All outer-test rows in source order
IDObservedPrediction / churn probabilityLeafErrorLoss
person:57.296.285788n111.0042121.008442
Full exact value975375361/967210000
person:105.156.285788n11-1.1357881.290014
Full exact value1247714329/967210000
person:158.947.178142n131.7618583.104145
Full exact value396368281/127690000
person:205.754.129218n21.6207822.626935
person:257.266.285788n110.97421220.9490894
Full exact value229492201/241802500
person:3035.058265n6-2.0582654.236456
person:352.085.058265n6-2.9782658.870064
person:409.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:453.244.129218n2-0.88921790.7907084
Full exact value253350889/320410000
person:506.54.590259n101.9097413.647112
Full exact value490755409/134560000
person:556.217.178142n13-0.96814160.9372981
person:655.387.178142n13-1.7981423.233313
Full exact value412861761/127690000
person:705.925.058265n60.86173470.7425867
person:805.386.285788n11-0.90578780.8204515
person:8575.058265n61.9417353.770334
person:902.835.058265n6-2.2282654.965166
person:955.54.590259n100.90974140.8276294
Full exact value111365809/134560000
person:1006.255.058265n61.1917351.420232
person:1058.656.285788n112.3642125.589499
Full exact value5406219729/967210000
person:1106.255.058265n61.1917351.420232
person:1157.697.178142n130.51185840.261999
person:12011.546.285788n115.25421227.60675
Full exact value6675380209/241802500
person:1306.827.178142n13-0.35814160.1282654
person:13510.058.783507n141.2664931.604003
Full exact value288014841/179560000
person:1405.296.285788n11-0.99578780.9915933
Full exact value959078961/967210000
person:1456.256.285788n11-0.035787780.001280765
person:1509.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:15526.285788n11-4.28578818.36798
Full exact value1110355684/60450625
person:1607.937.178142n130.75185840.5652911
person:1656.946.285788n110.65421220.4279936
Full exact value103489929/241802500
person:170145.058265n68.94173579.95462
Full exact value7678841641/96040000
person:1803.855.058265n6-1.2082651.459905
person:1852.855.846737n7-2.9967378.980434
Full exact value5001742729/556960000
person:1957.955.846737n72.1032634.423714
Full exact value2463831769/556960000
person:2006.736.285788n110.44421220.1973245
person:2055.766.285788n11-0.52578780.2764528
person:2105.145.058265n60.081734690.00668056
person:2202.895.058265n6-2.1682654.701374
person:2309.955.846737n74.10326316.83676
Full exact value9377404569/556960000
person:2356.866.285788n110.57421220.3297197
person:2407.696.285788n111.4042121.971812
Full exact value1907156241/967210000
person:2505.056.285788n11-1.2357881.527171
Full exact value1477095489/967210000
person:25511.547.178142n134.36185819.02581
Full exact value2429405521/127690000
person:26025.058265n6-3.0582659.352987
person:2655.885.058265n60.82173470.6752479
person:2709.297.178142n132.1118584.459946
person:2753.895.058265n6-1.1682651.364844
person:2802.025.058265n6-3.0382659.231056
person:2854.815.058265n6-0.24826530.06163566
person:2904.764.590259n100.16974140.02881214
person:29574.590259n102.4097415.806854
Full exact value781370209/134560000
person:3007.65.058265n62.5417356.460415
person:30544.590259n10-0.59025860.3484052
person:3105.775.846737n7-0.076737290.005888611
person:3157.75.058265n62.6417356.978762
person:3256.156.285788n11-0.13578780.01843832
person:3307.55.058265n62.4417355.962068
person:3353.134.129218n2-0.99921790.9984364
person:3457.56.285788n111.2142121.474311
Full exact value356492161/241802500
person:3505.916.285788n11-0.37578780.1412165
Full exact value136585969/967210000
person:3554.885.058265n6-0.17826530.03177852
person:3659.868.783507n141.0764931.158836
person:3706.156.285788n11-0.13578780.01843832
person:3754.625.058265n6-0.43826530.1920765
person:3806.45.846737n70.55326270.3060996
Full exact value170485249/556960000
person:38510.15.058265n65.04173525.41909
Full exact value2441249281/96040000
person:39013.876.285788n117.58421257.52027
Full exact value55634185161/967210000
person:4004.818.783507n14-3.97350715.78876
person:4055.796.285788n11-0.49578780.2458055
Full exact value237745561/967210000
person:4109.626.285788n113.33421211.11697
Full exact value2688111409/241802500
person:4204.85.058265n6-0.25826530.06670097
person:4254.175.058265n6-0.88826530.7890153
person:4307.216.285788n110.92421220.8541682
Full exact value826160049/967210000
person:43510.587.178142n133.40185811.57264
Full exact value1477710481/127690000
person:4409.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:45510.17.178142n132.9218588.537257
Full exact value1090122289/127690000
person:46055.058265n6-0.058265310.003394846
person:47014.426.285788n118.13421266.16541
Full exact value15998961169/241802500
person:4755.385.058265n60.32173470.1035132
person:4805.615.058265n60.55173470.3044112
person:4854.375.846737n7-1.4767372.180753
Full exact value1214592201/556960000
person:4957.56.285788n111.2142121.474311
Full exact value356492161/241802500
person:5005.555.846737n7-0.29673730.08805302
person:5057.455.058265n62.3917355.720395
person:5108.657.178142n131.4718582.166367
person:5155.295.058265n60.23173470.05370097
person:5208.897.178142n131.7118582.930459
person:5257.755.058265n62.6917357.245436
person:5303.335.058265n6-1.7282652.986901
person:53511.548.783507n142.7564937.598251
Full exact value1364341969/179560000
person:5409.898.783507n141.1064931.224326
Full exact value219839929/179560000
person:5455.716.285788n11-0.57578780.3315316
Full exact value320660649/967210000
person:5603.885.058265n6-1.1782651.388309
person:56510.446.285788n114.15421217.25748
Full exact value1043225401/60450625
person:5705.775.058265n60.71173470.5065663
person:5756.257.178142n13-0.92814160.8614468
person:5805.245.058265n60.18173470.0330275
person:5854.266.285788n11-2.0257884.103816
Full exact value992313001/241802500
person:5903.255.846737n7-2.5967376.743045
Full exact value3755606089/556960000
person:5954.885.058265n6-0.17826530.03177852
person:6003.756.285788n11-2.5357886.43022
Full exact value6219372769/967210000
person:6056.386.285788n110.094212220.008875942
person:6106.297.178142n13-0.88814160.7887955
person:6206.395.058265n61.3317351.773517
person:625104.590259n105.40974129.2653
Full exact value3937939009/134560000
person:6301.595.058265n6-3.46826512.02886
Full exact value1155252121/96040000
person:6355.535.058265n60.47173470.2225336
person:64014.426.285788n118.13421266.16541
Full exact value15998961169/241802500
person:6458.896.285788n112.6042126.781921
Full exact value6559542081/967210000
person:6556.928.783507n14-1.8635073.47266
Full exact value623550841/179560000
person:6605.66.285788n11-0.68578780.4703049
person:6655.985.058265n60.92173470.8495948
person:6705.066.285788n11-1.2257881.502556
Full exact value363321721/241802500
person:6755.576.285788n11-0.71578780.5123521
Full exact value495552121/967210000
person:6805.845.058265n60.78173470.6111091
person:6856.96.285788n110.61421220.3772566
person:6903.565.058265n6-1.4982652.244799
person:6957.46.285788n111.1142121.241469
person:7002.395.058265n6-2.6682657.11964
person:7056.928.783507n14-1.8635073.47266
Full exact value623550841/179560000
person:7105.175.058265n60.11173470.01248464
person:7155.966.285788n11-0.32578780.1061377
person:7204.815.058265n6-0.24826530.06163566
person:7257.697.178142n130.51185840.261999
person:7303.776.285788n11-2.5157886.329188
Full exact value6121654081/967210000
person:7357.166.285788n110.87421220.764247
person:7406.255.058265n61.1917351.420232
person:7454.627.178142n13-2.5581426.544088
Full exact value835614649/127690000
person:7556.456.285788n110.16421220.02696565
person:7605.255.058265n60.19173470.03676219
person:7655.685.058265n60.62173470.386554
person:7805.816.285788n11-0.47578780.226374
Full exact value218951209/967210000
person:78556.285788n11-1.2857881.65325
person:79065.058265n60.94173470.8868642
person:8002.435.058265n6-2.6282656.907779
person:80546.285788n11-2.2857885.224826
person:81010.436.285788n114.14421217.17449
person:8155.755.846737n7-0.096737290.009358103
person:8206.625.058265n61.5617352.439015
person:8259.474.590259n104.87974123.81188
person:8302.44.129218n2-1.7292182.990194
Full exact value958088209/320410000
person:8357.274.129218n23.1407829.864512
person:8407.55.846737n71.6532632.733278
Full exact value1522326289/556960000
person:8456.416.285788n110.12421220.01542868
person:8503.085.058265n6-1.9782653.913534
person:8604.098.783507n14-4.69350722.02901
Full exact value3955529449/179560000
person:86510.825.846737n74.97326324.73334
Full exact value13775482161/556960000
person:8706.735.058265n61.6717352.794697
person:8754.817.178142n13-2.3681425.608095
person:8805.778.783507n14-3.0135079.081227
Full exact value1630625161/179560000
person:89510.556.285788n114.26421218.18351
Full exact value17587268689/967210000
person:9006.735.846737n70.88326270.780153
person:9104.945.058265n6-0.11826530.01398668
person:9156.015.058265n60.95173470.9057989
person:9206.437.178142n13-0.74814160.5597158
person:9256.677.178142n13-0.50814160.2582079
person:9303.115.846737n7-2.7367377.489731
Full exact value4171480569/556960000
person:9355.776.285788n11-0.51578780.266037
Full exact value257313681/967210000
person:94012.028.783507n143.23649310.47488
Full exact value1880870161/179560000
person:9458.056.285788n111.7642123.112445
Full exact value3010387689/967210000
person:9508.556.285788n112.2642125.126657
Full exact value4958553889/967210000
person:9555.615.846737n7-0.23673730.05604454
person:9606.735.058265n61.6717352.794697
person:96555.058265n6-0.058265310.003394846
person:9707.556.285788n111.2642121.598233
Full exact value1545826489/967210000
person:97565.058265n60.94173470.8868642
person:98065.058265n60.94173470.8868642
person:985104.129218n25.87078234.46608
Full exact value11043277569/320410000
person:9907.076.285788n110.78421220.6149888
Full exact value594823321/967210000
person:99513.228.783507n144.43649319.68247
Full exact value3534183601/179560000
person:100064.590259n101.4097411.987371
Full exact value267420609/134560000
person:100545.058265n6-1.0582651.119925
person:10105.455.058265n60.39173470.1534561
person:10155.496.285788n11-0.79578780.6332782
Full exact value612513001/967210000
person:102096.285788n112.7142127.366948
person:102555.846737n7-0.84673730.716964
Full exact value399320289/556960000
person:103012.648.783507n143.85649314.87253
Full exact value2670512329/179560000
person:10359.837.178142n132.6518587.032353
person:10404.445.058265n6-0.61826530.382252
person:104555.846737n7-0.84673730.716964
Full exact value399320289/556960000
person:10507.266.285788n110.97421220.9490894
Full exact value229492201/241802500
person:105510.948.783507n142.1564934.65046
Full exact value835036609/179560000
person:10606.565.058265n61.5017352.255207
person:10707.025.058265n61.9617353.848403
person:10856.495.058265n61.4317352.049864
person:10905.567.178142n13-1.6181422.618382
person:10957.815.058265n62.7517357.572044
person:11009.625.058265n64.56173520.80942
person:11059.386.285788n113.0942129.574149
person:11108.187.178142n131.0018581.00372
Full exact value128165041/127690000
person:11156.157.178142n13-1.0281421.057075
person:11201.925.058265n6-3.1382659.848709
person:11254.385.058265n6-0.67826530.4600438
person:11354.475.058265n6-0.58826530.3460561
person:11455.75.846737n7-0.14673730.02153183
person:11555.295.058265n60.23173470.05370097
person:11608.656.285788n112.3642125.589499
Full exact value5406219729/967210000
person:11657.977.178142n130.79185840.6270397
person:11703.935.058265n6-1.1282651.272983
person:11754.815.058265n6-0.24826530.06163566
person:11800.964.590259n10-3.63025913.17878
Full exact value1773336321/134560000
person:11852.265.058265n6-2.7982657.830289
person:11904.65.058265n6-0.45826530.2100071
person:11953.785.058265n6-1.2782651.633962
person:12004.915.058265n6-0.14826530.0219826
person:12155.067.178142n13-2.1181424.486524
person:12205.886.285788n11-0.40578780.1646637
person:12308.318.783507n14-0.47350750.2242093
person:12459.648.783507n140.85649250.7335795
Full exact value131721529/179560000
person:12506.096.285788n11-0.19578780.03833286
person:126055.846737n7-0.84673730.716964
Full exact value399320289/556960000
person:12653.36.285788n11-2.9857888.914929
Full exact value2155652041/241802500
person:12703.595.058265n6-1.4682652.155803
person:12756.536.285788n110.24421220.05963961
person:12806.227.178142n13-0.95814160.9180353
Full exact value117223929/127690000
person:12855.756.285788n11-0.53578780.2870685
Full exact value277655569/967210000
person:129035.058265n6-2.0582654.236456
person:13008.175.058265n63.1117359.682893
person:130555.058265n6-0.058265310.003394846
person:13105.255.058265n60.19173470.03676219
person:13156.045.846737n70.19326270.03735048
person:13207.146.285788n110.85421220.7296785
Full exact value176438089/241802500
person:13256.567.178142n13-0.61814160.382099
person:13356.735.058265n61.6717352.794697
person:13407.67.178142n130.42185840.1779645
person:13454.756.285788n11-1.5357882.358644
Full exact value2281304169/967210000
person:13602.255.058265n6-2.8082657.886354
person:13658.177.178142n130.99185840.9837831
person:13708.974.129218n24.84078223.43317
person:13759.298.783507n140.50649250.2565347
person:13802.665.058265n6-2.3982655.751676
person:13858.014.590259n103.41974111.69463
Full exact value1573629561/134560000
person:139067.178142n13-1.1781421.388018
Full exact value177235969/127690000
person:14006.585.058265n61.5217352.315676
person:14055.964.129218n21.8307823.351763
Full exact value1073938441/320410000
person:14107.215.058265n62.1517354.629962
person:14155.636.285788n11-0.65578780.4300576
person:14204.75.058265n6-0.35826530.128354
person:14253.894.129218n2-0.23921790.05722519
person:14306.54.590259n101.9097413.647112
Full exact value490755409/134560000
person:14407.597.178142n130.41185840.1696273
person:14459.155.058265n64.09173516.74229
Full exact value1607929801/96040000
person:14502.674.129218n2-1.4592182.129317
person:14557.217.178142n130.031858410.001014958
person:14604.236.285788n11-2.0557884.226263
person:14654.15.846737n7-1.7467373.051091
Full exact value1699335729/556960000
person:14704.55.058265n6-0.55826530.3116602
person:14758.176.285788n111.8842123.550256
Full exact value3433842801/967210000
person:14859.136.285788n112.8442128.089543
person:14903.965.846737n7-1.8867373.559778
Full exact value1982653729/556960000
person:14954.627.178142n13-2.5581426.544088
Full exact value835614649/127690000
person:15005.496.285788n11-0.79578780.6332782
Full exact value612513001/967210000
person:15053.854.129218n2-0.27921790.07796262
person:15106.167.178142n13-1.0181421.036612
person:15154.35.058265n6-0.75826530.5749663
person:1520115.846737n75.15326326.55612
Full exact value14790694689/556960000
person:15259.216.285788n112.9242128.551017
Full exact value8270629249/967210000
person:15304.115.846737n7-1.7367373.016256
Full exact value1679934169/556960000
person:15404.234.590259n10-0.36025860.1297863
person:154566.285788n11-0.28578780.08167466
person:15504.497.178142n13-2.6881427.226105
person:15605.715.058265n60.65173470.4247581
person:15657.218.783507n14-1.5735072.475926
person:15707.135.058265n62.0717354.292085
person:15752.66.285788n11-3.68578813.58503
person:15806.25.846737n70.35326270.1247945
person:15858.085.846737n72.2332634.987462
person:15906.935.058265n61.8717353.503391
person:160045.058265n6-1.0582651.119925
person:160577.178142n13-0.17814160.03173443
person:161010.556.285788n114.26421218.18351
Full exact value17587268689/967210000
person:16156.485.846737n70.63326270.4010217
person:16254.255.058265n6-0.80826530.6532928
person:1630115.058265n65.94173535.30421
Full exact value3390616441/96040000
person:163575.058265n61.9417353.770334
person:16403.354.129218n2-0.77921790.6071805
person:16456.255.058265n61.1917351.420232
person:16505.56.285788n11-0.78578780.6174624
Full exact value149303961/241802500
person:16607.135.058265n62.0717354.292085
person:16656.335.058265n61.2717351.617309
person:16708.327.178142n131.1418581.303841
Full exact value166487409/127690000
person:16757.226.285788n110.93421220.8727525
Full exact value211033729/241802500
person:16803.935.058265n6-1.1282651.272983
person:16905.24.590259n100.60974140.3717845
person:17004.756.285788n11-1.5357882.358644
Full exact value2281304169/967210000
person:17105.777.178142n13-1.4081421.982863
person:17154.55.846737n7-1.3467371.813701
Full exact value1010159089/556960000
person:17206.236.285788n11-0.055787780.003112277
person:17257.216.285788n110.92421220.8541682
Full exact value826160049/967210000
person:17353.636.285788n11-2.6557887.053209
person:17408.796.285788n112.5042126.271079
Full exact value6065450161/967210000
person:17453.255.058265n6-1.8082653.269823
person:17502.645.846737n7-3.20673710.28316
Full exact value5727311041/556960000
person:17559.86.285788n113.51421212.34969
person:17604.634.590259n100.039741380.001579377
person:17654.045.058265n6-1.0182651.036864
person:17709.136.285788n112.8442128.089543
person:17756.155.058265n61.0917351.191885
person:17802.384.129218n2-1.7492183.059763
Full exact value980378721/320410000
person:17853.655.058265n6-1.4082651.983211
person:17904.625.058265n6-0.43826530.1920765
person:18007.55.058265n62.4417355.962068
person:18104.625.058265n6-0.43826530.1920765
person:18155.65.846737n7-0.24673730.06087929
person:18204.116.285788n11-2.1757884.734052
Full exact value4578822889/967210000
person:18257.755.846737n71.9032633.622409
Full exact value2017536889/556960000
person:18308.755.058265n63.69173513.62891
Full exact value1308920041/96040000
person:18353.46.285788n11-2.8857888.327771
person:184015.028.783507n146.23649338.89384
Full exact value6983777761/179560000
person:18453.315.058265n6-1.7482653.056432
person:18557.595.058265n62.5317356.409681
person:18605.686.285788n11-0.60578780.3669788
person:18656.256.285788n11-0.035787780.001280765
person:18706.244.590259n101.6497412.721647
Full exact value366224769/134560000
person:18756.748.783507n14-2.0435074.175923
Full exact value749828689/179560000
person:18803.276.285788n11-3.0157889.094976
Full exact value8796751681/967210000
person:18853.854.590259n10-0.74025860.5479828
person:18907.456.285788n111.1642121.35539
Full exact value1310946849/967210000
person:18957.458.783507n14-1.3335071.778242
Full exact value319301161/179560000
person:19005.455.058265n60.39173470.1534561
person:19055.777.178142n13-1.4081421.982863
person:19108.655.846737n72.8032637.858282
Full exact value4376748649/556960000
person:191555.058265n6-0.058265310.003394846
person:19207.55.058265n62.4417355.962068
person:19256.856.285788n110.56421220.3183354
Full exact value307897209/967210000
person:19353.975.058265n6-1.0882651.184321
person:19409.626.285788n113.33421211.11697
Full exact value2688111409/241802500
person:19455.46.285788n11-0.88578780.78462
person:19503.65.058265n6-1.4582652.126538
person:19557.267.178142n130.081858410.006700799
person:19603.754.590259n10-0.84025860.7060345
person:19656.496.285788n110.20421220.04170263
person:19703.154.590259n10-1.4402592.074345
Full exact value279123849/134560000
person:19756.934.590259n102.3397415.47439
Full exact value736633881/134560000
person:198045.058265n6-1.0582651.119925
person:19859.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:19954.575.058265n6-0.48826530.238403
person:20003.634.129218n2-0.49921790.2492185
person:20054.276.285788n11-2.0157884.0634
Full exact value3930161481/967210000
person:20103.756.285788n11-2.5357886.43022
Full exact value6219372769/967210000
person:20153.554.590259n10-1.0402591.082138
Full exact value145612489/134560000
person:20204.437.178142n13-2.7481427.552282
person:20254.814.590259n100.21974140.04828627
person:20302.55.846737n7-3.34673711.20065
Full exact value6238314289/556960000
person:203513.747.178142n136.56185843.05799
Full exact value5498074201/127690000
person:20404.445.058265n6-0.61826530.382252
person:20453.15.058265n6-1.9582653.834803
person:20506.736.285788n110.44421220.1973245
person:20603.085.058265n6-1.9782653.913534
person:20657.698.783507n14-1.0935071.195759
Full exact value214710409/179560000
person:20707.367.178142n130.18185840.03307248
person:20757.216.285788n110.92421220.8541682
Full exact value826160049/967210000
person:20952.876.285788n11-3.41578811.66761
Full exact value11285025361/967210000
person:21005.486.285788n11-0.80578780.6492939
person:21053.756.285788n11-2.5357886.43022
Full exact value6219372769/967210000
person:211011.556.285788n115.26421227.71193
Full exact value26803256089/967210000
person:21154.166.285788n11-2.1257884.518974
person:21203.755.058265n6-1.3082651.711558
person:21254.54.590259n10-0.090258620.008146619
person:21301.985.058265n6-3.0782659.475717
person:21351.674.129218n2-2.4592186.047753
person:21403.985.058265n6-1.0782651.162656
person:214534.590259n10-1.5902592.528922
Full exact value340291809/134560000
person:215534.129218n2-1.1292181.275133
Full exact value408565369/320410000
person:21602.445.846737n7-3.40673711.60586
Full exact value6463999201/556960000
person:21704.956.285788n11-1.3357881.784329
Full exact value1725820849/967210000
person:218035.058265n6-2.0582654.236456
person:21852.64.129218n2-1.5292182.338507
Full exact value749281129/320410000
person:219054.590259n100.40974140.167888
person:21953.855.058265n6-1.2082651.459905
person:22002.675.058265n6-2.3882655.703811
person:22156.254.590259n101.6597412.754741
Full exact value370678009/134560000
person:222065.058265n60.94173470.8868642
person:22255.56.285788n11-0.78578780.6174624
Full exact value149303961/241802500
person:2230106.285788n113.71421213.79537
person:223511.427.178142n134.24185817.99336
Full exact value2297572489/127690000
person:22452.55.058265n6-2.5582656.544721
person:225034.129218n2-1.1292181.275133
Full exact value408565369/320410000
person:22555.586.285788n11-0.70578780.4981364
person:22602.44.129218n2-1.7292182.990194
Full exact value958088209/320410000
person:22654.135.058265n6-0.92826530.8616765
person:227510.976.285788n114.68421221.94184
Full exact value21222371041/967210000
person:22805.777.178142n13-1.4081421.982863
person:22851.966.285788n11-4.32578818.71244
Full exact value1131178689/60450625
person:22909.455.058265n64.39173519.28733
Full exact value1852355521/96040000
person:22954.26.285788n11-2.0857884.350511
person:23005.55.058265n60.44173470.1951295
person:23057.54.129218n23.37078211.36217
Full exact value3640553569/320410000
person:23104.756.285788n11-1.5357882.358644
Full exact value2281304169/967210000
person:23152.636.285788n11-3.65578813.36478
person:23203.464.590259n10-1.1302591.277485
Full exact value171898321/134560000
person:23253.194.590259n10-1.4002591.960724
Full exact value263835049/134560000
person:23302.34.129218n2-1.8292183.346038
Full exact value1072104049/320410000
person:23355.196.285788n11-1.0957881.200751
Full exact value1161378241/967210000
person:23403.165.058265n6-1.8982653.603411
person:23454.518.783507n14-4.27350718.26287
person:23508.556.285788n112.2642125.126657
Full exact value4958553889/967210000
person:23554.055.058265n6-1.0082651.016599
person:23604.525.058265n6-0.53826530.2897295
person:23703.755.058265n6-1.3082651.711558
person:23756.256.285788n11-0.035787780.001280765
person:238055.058265n6-0.058265310.003394846
person:23854.95.058265n6-0.15826530.02504791
person:239045.058265n6-1.0582651.119925
person:23953.255.846737n7-2.5967376.743045
Full exact value3755606089/556960000
person:24006.196.285788n11-0.095787780.009175299
person:24053.256.285788n11-3.0357889.216007
Full exact value8913814569/967210000
person:24106.865.058265n61.8017353.246248
person:24154.624.129218n20.49078210.2408671
person:242044.590259n10-0.59025860.3484052
person:24252.826.285788n11-3.46578812.01168
Full exact value2904455449/241802500
person:24309.596.285788n113.30421210.91782
Full exact value10559823121/967210000
person:24354.755.058265n6-0.30826530.0950275
person:24456.736.285788n110.44421220.1973245
person:24503.754.590259n10-0.84025860.7060345
person:245517.637.178142n1310.45186109.2413
Full exact value3487256809/31922500
person:24602.754.590259n10-1.8402593.386552
Full exact value455694409/134560000
person:24655.074.129218n20.94078210.885071
person:247010.687.178142n133.50185812.26301
Full exact value1565864041/127690000
person:24757.55.058265n62.4417355.962068
person:24854.625.846737n7-1.2267371.504884
Full exact value838160401/556960000
person:25008.946.285788n112.6542127.044843
Full exact value1703460529/241802500
person:25052.414.590259n10-2.1802594.753528
Full exact value639634681/134560000
person:25105.655.058265n60.59173470.3501499
person:25154.134.129218n20.00078212296.117162e-07
person:25257.785.846737n71.9332633.737505
person:25353.54.129218n2-0.62921790.3959151
Full exact value126855169/320410000
person:25408.667.178142n131.4818582.195904
person:25451.485.058265n6-3.57826512.80398
Full exact value1229694489/96040000
person:25506.928.783507n14-1.8635073.47266
Full exact value623550841/179560000
person:25558.657.178142n131.4718582.166367
person:25607.127.178142n13-0.058141590.003380445
person:25657.386.285788n111.0942121.1973
person:25708.696.285788n112.4042125.780236
Full exact value5590702441/967210000
person:25754.628.783507n14-4.16350717.33479
Full exact value3112635681/179560000
person:25807.76.285788n111.4142121.999996
Full exact value483604081/241802500
person:25857.135.058265n62.0717354.292085
person:25907.216.285788n110.92421220.8541682
Full exact value826160049/967210000
person:259545.058265n6-1.0582651.119925
person:26005.535.058265n60.47173470.2225336
person:260534.129218n2-1.1292181.275133
Full exact value408565369/320410000
person:26107.515.058265n62.4517356.011003
person:261510.588.783507n141.7964933.227385
Full exact value579509329/179560000
person:26255.386.285788n11-0.90578780.8204515
person:26306.54.590259n101.9097413.647112
Full exact value490755409/134560000
person:26402.865.058265n6-2.1982654.83237
person:26502.775.846737n7-3.0767379.466312
Full exact value5272357321/556960000
person:26556.736.285788n110.44421220.1973245
person:266014.436.285788n118.14421266.32819
Full exact value2566131649/38688400
person:26654.794.129218n20.66078210.436633
person:26706.256.285788n11-0.035787780.001280765
person:26806.155.058265n61.0917351.191885
person:26858.435.058265n63.37173511.36859
Full exact value1091839849/96040000
person:269010.147.178142n132.9618588.772605
Full exact value1120173961/127690000
person:27007.456.285788n111.1642121.35539
Full exact value1310946849/967210000
person:271057.178142n13-2.1781424.744301
Full exact value605799769/127690000
person:27159.626.285788n113.33421211.11697
Full exact value2688111409/241802500
person:27256.756.285788n110.46421220.215493
Full exact value208426969/967210000
person:273011.758.783507n142.9664938.800078
Full exact value1580142001/179560000
person:273510.296.285788n114.00421216.03372
Full exact value15507969961/967210000
person:27403.54.590259n10-1.0902591.188664
Full exact value159946609/134560000
person:27457.285.058265n62.2217354.936105
person:27509.838.783507n141.0464931.095147
Full exact value196644529/179560000
person:27553.135.058265n6-1.9282653.718207
person:276045.846737n7-1.8467373.410439
Full exact value1899477889/556960000
person:27702.555.058265n6-2.5082656.291395
person:27757.696.285788n111.4042121.971812
Full exact value1907156241/967210000
person:27859.066.285788n112.7742127.696253
Full exact value1860973321/241802500
person:27905.925.058265n60.86173470.7425867
person:28004.427.178142n13-2.7581427.607345
Full exact value971381889/127690000
person:28057.246.285788n110.95421220.910521
person:28105.776.285788n11-0.51578780.266037
Full exact value257313681/967210000
person:28255.776.285788n11-0.51578780.266037
Full exact value257313681/967210000
person:28306.255.058265n61.1917351.420232
person:28357.36.285788n111.0142121.028626
Full exact value248724441/241802500
person:28404.115.058265n6-0.94826530.8992071
person:28507.217.178142n130.031858410.001014958
person:28553.255.058265n6-1.8082653.269823
person:28608.526.285788n112.2342124.991704
person:286510.688.783507n141.8964933.596684
Full exact value645820569/179560000
person:28758.016.285788n111.7242122.972908
Full exact value2875426129/967210000
person:28807.98.783507n14-0.88350750.7805854
Full exact value140161921/179560000
person:29005.316.285788n11-0.97578780.9521618
Full exact value920940409/967210000
person:29054.866.285788n11-1.4257882.032871
Full exact value491553241/241802500
person:29106.255.058265n61.1917351.420232
person:292076.285788n110.71421220.5100991
person:29254.85.058265n6-0.25826530.06670097
person:29307.236.285788n110.94421220.8915367
person:293512.025.058265n66.96173548.46575
person:29404.816.285788n11-1.4757882.17795
Full exact value2106534609/967210000
person:29454.57.178142n13-2.6781427.172442
Full exact value915849169/127690000
person:29502.755.058265n6-2.3082655.328089
person:29553.55.058265n6-1.5582652.428191
person:29602.54.129218n2-1.6292182.654351
Full exact value850480569/320410000
person:29655.785.058265n60.72173470.520901
person:29704.826.285788n11-1.4657882.148534
Full exact value519520849/241802500
person:29751.454.129218n2-2.6792187.178208
person:29809.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:29852.35.058265n6-2.7582657.608027
person:29904.56.285788n11-1.7857883.189038
Full exact value771117361/241802500
person:29957.55.058265n62.4417355.962068
person:30003.884.590259n10-0.71025860.5044673
person:30102.355.846737n7-3.49673712.22717
Full exact value6810045529/556960000
person:301545.058265n6-1.0582651.119925
person:30203.85.058265n6-1.2582651.583232
person:30255.966.285788n11-0.32578780.1061377
person:30308.66.285788n112.3142125.355578
person:30403.24.129218n2-0.92921790.8634459
Full exact value276656689/320410000
person:30451.94.129218n2-2.2292184.969412
Full exact value1592249409/320410000
person:30505.385.058265n60.32173470.1035132
person:305510.265.846737n74.41326319.47689
Full exact value10847847409/556960000
person:30603.54.590259n10-1.0902591.188664
Full exact value159946609/134560000
person:30653.16.285788n11-3.18578810.14924
Full exact value2454112521/241802500
person:30754.796.285788n11-1.4957882.237381
Full exact value2164017361/967210000
person:30804.235.058265n6-0.82826530.6860234
person:30855.295.058265n60.23173470.05370097
person:30903.814.590259n10-0.78025860.6088035
person:30952.65.058265n6-2.4582656.043068
person:31002.54.129218n2-1.6292182.654351
Full exact value850480569/320410000
person:310535.058265n6-2.0582654.236456
person:31103.754.590259n10-0.84025860.7060345
person:31154.575.058265n6-0.48826530.238403
person:31206.55.058265n61.4417352.078599
person:312544.129218n2-0.12921790.01669726
person:31307.347.178142n130.16185840.02619814
person:31355.777.178142n13-1.4081421.982863
person:31403.646.285788n11-2.6457887.000193
person:31453.85.058265n6-1.2582651.583232
person:31502.576.285788n11-3.71578813.80708
Full exact value13354344721/967210000
person:31554.335.058265n6-0.72826530.5303704
person:31604.334.590259n10-0.26025860.06773455
person:31653.755.058265n6-1.3082651.711558
person:31708.486.285788n112.1942124.814567
person:31806.495.058265n61.4317352.049864
person:31855.925.846737n70.073262710.005367425
person:31909.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:31953.596.285788n11-2.6957887.267272
Full exact value7028977921/967210000
person:32054.626.285788n11-1.6657882.774849
Full exact value670965409/241802500
person:321034.590259n10-1.5902592.528922
Full exact value340291809/134560000
person:32153.54.590259n10-1.0902591.188664
Full exact value159946609/134560000
person:32202.754.590259n10-1.8402593.386552
Full exact value455694409/134560000
person:32251.635.058265n6-3.42826511.753
Full exact value1128758409/96040000
person:32305.654.129218n21.5207822.312778
person:32356.425.058265n61.3617351.854321
person:324045.058265n6-1.0582651.119925
person:32454.454.129218n20.32078210.1029012
person:32504.195.058265n6-0.86826530.7538846
person:32653.86.285788n11-2.4857886.179141
person:32707.695.058265n62.6317356.926027
person:32804.755.058265n6-0.30826530.0950275
person:32852.65.846737n7-3.24673710.5413
Full exact value5871084129/556960000
person:32908.037.178142n130.85185840.7256627
person:32954.174.129218n20.040782120.001663182
person:33002.655.058265n6-2.4082655.799742
person:33055.65.058265n60.54173470.2934765
person:33152.254.590259n10-2.3402595.47681
Full exact value736959609/134560000
person:33205.776.285788n11-0.51578780.266037
Full exact value257313681/967210000
person:33254.065.846737n7-1.7867373.19243
Full exact value1778055889/556960000
person:33305.776.285788n11-0.51578780.266037
Full exact value257313681/967210000
person:33357.275.058265n62.2117354.89177
person:33453.857.178142n13-3.32814211.07653
person:33552.55.058265n6-2.5582656.544721
person:33604.325.846737n7-1.5267372.330927
Full exact value1298232961/556960000
person:33653.315.846737n7-2.5367376.435036
Full exact value3584057689/556960000
person:33703.856.285788n11-2.4357885.933062
Full exact value5738517009/967210000
person:33808.015.846737n72.1632634.679706
Full exact value2606408809/556960000
person:33853.614.129218n2-0.51921790.2695872
person:33904.866.285788n11-1.4257882.032871
Full exact value491553241/241802500
person:33954.486.285788n11-1.8057883.26087
person:34052.64.590259n10-1.9902593.961129
Full exact value533009569/134560000
person:34102.55.846737n7-3.34673711.20065
Full exact value6238314289/556960000
person:34201.925.058265n6-3.1382659.848709
person:34253.535.058265n6-1.5282652.335595
person:34309.736.285788n113.44421211.8626
person:343544.129218n2-0.12921790.01669726
person:34454.385.058265n6-0.67826530.4600438
person:34502.455.058265n6-2.6082656.803048
person:34552.895.058265n6-2.1682654.701374
person:34606.257.178142n13-0.92814160.8614468
person:34704.354.129218n20.22078210.04874475
person:34752.885.058265n6-2.1782654.74484
person:34802.455.058265n6-2.6082656.803048
person:34905.535.846737n7-0.31673730.1003225
person:34952.55.058265n6-2.5582656.544721
person:35005.135.058265n60.071734690.005145866
person:35055.425.058265n60.36173470.130852
person:35103.755.058265n6-1.3082651.711558
person:351555.058265n6-0.058265310.003394846
person:35208.574.129218n24.44078219.72055
person:35258.086.285788n111.7942123.219197
person:35309.627.178142n132.4418585.962672
Full exact value761373649/127690000
person:35351.234.129218n2-2.8992188.405464
person:35402.254.590259n10-2.3402595.47681
Full exact value736959609/134560000
person:35505.397.178142n13-1.7881423.19745
person:35552.54.590259n10-2.0902594.369181
Full exact value587917009/134560000
person:35603.666.285788n11-2.6257886.894761
Full exact value1667170561/241802500
person:35704.634.590259n100.039741380.001579377
person:35756.257.178142n13-0.92814160.8614468
person:358035.058265n6-2.0582654.236456
person:358534.129218n2-1.1292181.275133
Full exact value408565369/320410000
person:35902.635.846737n7-3.21673710.3474
person:36003.855.058265n6-1.2082651.459905
person:36054.75.058265n6-0.35826530.128354
person:361055.058265n6-0.058265310.003394846

Verify one row by hand

For the first outer row person:5, square observed minus predicted to obtain the loss below. This one row is not a representative replacement for the sample. Sum every outer loss and divide by 604 to obtain mean loss.

Recompute the first outer row
IDyPrediction / pLoss
person:57.296.2857881.008442
Full exact value975375361/967210000

Practice, reading and interpretation

Predict what increasing minimum leaf size will do before calculating. Distinguish a manually fixed alpha from one selected by inner validation. If repeated outer-test inspection changes settings, those records are no longer an untouched test.

Public Python uses Fraction arithmetic; the separate base-R program recomputes the full samples, folds and predictions in finite precision. Exact Python arithmetic does not remove measurement error, selection bias or future change. Retained originals were freshly reread for this task; this is not a claim of a new HTTP download.

학부 심화 · 선택Advanced undergraduate · optional

기업 사례: 실제 이용 기록과 이탈Business case: actual use records and churn

기업 사례는 UCI Iranian Churn의3150고객·14원 필드를 보존합니다. 입력으로 통화 실패 횟수,가입 기간(월),요금의 서열 코드를 선택하고 원래 Churn0/1을 목표로 씁니다. 제공자 설명에서 입력은 첫9개월 집계,이탈 표시는12개월 끝 상태이며 사이3개월이 계획 간격입니다. 이 시간 정의와 지금 다른 통신사에서 예측 가능한 정보는 별도로 확인해야 합니다.

제공자 문서는 요금 코드를0~9로 설명하지만,보존 CSV에는 값10인 원행7개가 있습니다. 이 장은 그7행을9로 자르거나 금액10원으로 해석하지 않고 원 토큰과 메타데이터 차이를 함께 공개합니다. 계산에 쓴 수치 코드와 그 경제적 의미의 불확실성을 구분하는 실제 자료 점검 사례입니다.

모든3150행이 선택 특징·목표에 적격이며 훈련2520·외부 시험630입니다. 기본 깊이3·최소 잎30,alpha0,1/1000,1/100,1/10에서1/1000을 선택해 잎4개를 얻습니다. 외부 다중 Brier는 약0.320409이며 양성 좌표 하나의 관례로는 그 절반입니다. 원 순서 보류와 이 한 회사 기록의 성능을 새 시장의 이탈 감소 효과라고 확장하지 않습니다.

UCI · 원 설명·필드·라이선스

기업 · 공개 통신사 고객의 이탈 예측

이탈을 줄이는 개입의 효과가 아니라, 이미 기록된 고객 특성에서 마지막 이탈 표지를 얼마나 예측하는지 묻습니다. UCI 공개 자료의 원래 14필드·3,150행을 유지합니다. 제작자 설명에서 입력은 처음 9개월, 이탈은 12개월 말의 상태이며 사이에 3개월 계획 간격이 있습니다.

이 장은 통화 실패 수·가입 개월·요금 등급 코드만 입력으로 고릅니다. 요금은 화폐 액수가 아닙니다. 제작자 사전은 0~9라고 설명하지만 실제 원본에는 코드 10이 7행 있습니다. 원행을 그대로 보존하고 9로 잘라 바꾸거나 공식 설명이 10까지라고 고쳐 쓰지 않습니다.

원행 번호가 5의 배수인 630행은 바깥 시험, 나머지 2,520행은 훈련입니다. 훈련 행의 나머지 4분할로 알파를 고릅니다. 이 분할이 미래 출시 환경·다른 통신사·연락 개입의 효과를 검증한 것은 아닙니다.

검증 손실은 두 범주의 확률 오차 제곱을 모두 더한 Brier입니다. 이진 경우 양성 범주 하나의 Brier의 정확히 두 배입니다. 잎의 경험 비율은 이 모집단 밖에서 보정된 위험 확률이라는 증명이 아닙니다.

원자료·제작자 설명 읽기

무엇을 어떤 단위로 읽나

자료 사전
변수의미·단위
X1통화 실패 수 · 회
X2가입 기간 · 개월
X3요금 등급 원코드 · 서열 코드, 통화 단위 아님
Y이탈 0/1
weight각 행 1
서로 다른 분모
범위행 수
원 기록3150
달력/개인/고객 단위 행3150
완전·적격 행3150
보존한 불완전 행0
훈련2520
바깥 시험630
접힘 수4
원순서 앞 12행 · 축약 미리보기
ID역할X1X2X3Y
customer:1train83800
customer:2train03900
customer:3train103700
customer:4train103800
customer:5outer-test33800
customer:6train113810
customer:7train43800
customer:8train133720
customer:9train73800
customer:10outer-test73810
customer:11train63800
customer:12train93800

미리보기만으로 적합하지 않습니다. 아래 결과는 선언한 전체 훈련 행과 모든 접힘을 사용합니다.

모형 선택은 시험 자료 밖에서

깊이 상한은 3, 잎의 최소 적격 행 수는 30입니다. 모든 후보 알파에서 접힘별 나무를 다시 적합하고, 각 접힘의 검증 행에서 구한 손실 합을 그 검증 무게 합으로 나눈 통합 손실을 비교합니다. 같은 통합 손실이면 큰 알파를 택합니다. 검증 행이 많은 접힘을 작은 접힘과 같은 무게로 단순 평균하지 않습니다.

모든 알파의 통합 검증
α손실 합무게 합통합 손실선택
0524.3243
정확한 원값 전체6951080278249496601646226572356154398690121049685499/13257214463589012175014162534911381670191572252800
25200.2080652
정확한 원값 전체6951080278249496601646226572356154398690121049685499/33408180448244310681035689587976681808882762077056000
0.001523.977
정확한 원값 전체5182413260247994482186053641965288260850410321611/9890536585790182525656905285566435311008400000
25200.2079274
정확한 원값 전체5182413260247994482186053641965288260850410321611/24924152196191259964655401319627416983741168000000
예
0.01541.4222
정확한 원값 전체517684836808998945728816019324109693496253632419/956157374899142707268152202241398908323600000
25200.2148501
정확한 원값 전체517684836808998945728816019324109693496253632419/2409516584745839622315743549648325248975472000000
0.1676.216625200.2683399
선택 알파의 모든 접힘
접힘훈련 행시험 행잎 수손실 합평균 손실
source-remainder-018906305103.3294
정확한 원값 전체29653510996166522/286980370845025
0.1640149
정확한 원값 전체14826755498083261/90398816816182875
source-remainder-118906304160.4324
정확한 원값 전체10828051092646798/67492899569667
0.2546547
정확한 원값 전체5414025546323399/21260263364445105
source-remainder-218906304110.2329
정확한 원값 전체1120236629120840159/10162451379600000
0.1749729
정확한 원값 전체1120236629120840159/6402344369148000000
source-remainder-318906304149.9822
정확한 원값 전체562552831209067/3750797560608
0.238067
정확한 원값 전체562552831209067/2363002463183040

전체 훈련에서 다시 적합한 나무

전체 훈련 나무의 정확 가지치기 경로
α 경계잎 수훈련 위험
070.2031909
정확한 원값 전체521750689/2567785200
7.228362e-0560.2032632
정확한 원값 전체13537506691/66600865800
8.797178e-0550.2033512
0.000935007540.2042862
정확한 원값 전체383082604963/1875225047850
0.009957605
정확한 원값 전체26822041/2693623680
30.2142438
정확한 원값 전체604811299/2823004800
0.02176
정확한 원값 전체953759689/43830864000
20.2360038
0.02780445
정확한 원값 전체1360798321/48941739000
10.2638083

훈련 위험은 원래 뿌리 무게로 정규화합니다. 경계에서 작은 나무를 고릅니다. 이 경로의 최적성은 이미 자란 이 나무의 부분나무 안에서만 성립하며, 모든 가능한 나무 중 전역 최적이라는 뜻은 아닙니다.

선택한 최종 나무의 전체 노드
노드깊이행원 위험잎 예측입력문턱왼쪽오른쪽
n002520664.79680X30.5n1n8
n111475561.28270X117.5n2n5
n221408492.3580X227.5n3n4
n3325913.621620————
n431149453.64320————
n526714.089551————
n81104533.446890————

숨겨 둔 시험 행에서 확인하기

바깥 시험의 손실과 단위
지표값
시험 행 수630
시험 손실 합201.8578
정확한 원값 전체132800694375562918/657892342809075
전체 두 범주 Brier 합0.3204092
정확한 원값 전체66400347187781459/207236087984858625
양성 범주 하나 Brier0.1602046
정확한 원값 전체66400347187781459/414472175969717250
0/1 오분류율0.1603175

가로축은 자료 행의 순서입니다. 잇는 선은 시간 경로나 정책의 효과가 아닙니다. 모든 보존한 결과와 결측 칸을 웹 그래프에 남기며, 바깥 시험 그래프는 관측과 예측을 함께 표시합니다.

바깥 시험 630행의 관측·예측·손실 전체
모든 바깥 시험 행 · 원순서
ID관측예측 / 이탈확률잎오차손실
customer:500.2706701n4—0.1465247
customer:1000.01626794n8—0.0005292919
customer:1500.2706701n4—0.1465247
customer:2000.2706701n4—0.1465247
customer:2510.01626794n8—1.935458
customer:3000.2706701n4—0.1465247
customer:3500.01626794n8—0.0005292919
customer:4000.02702703n3—0.00146092
customer:4500.02702703n3—0.00146092
customer:5010.01626794n8—1.935458
customer:5500.01626794n8—0.0005292919
customer:6000.01626794n8—0.0005292919
customer:6500.01626794n8—0.0005292919
customer:7000.01626794n8—0.0005292919
customer:7500.01626794n8—0.0005292919
customer:8000.01626794n8—0.0005292919
customer:8500.01626794n8—0.0005292919
customer:9000.01626794n8—0.0005292919
customer:9500.01626794n8—0.0005292919
customer:10010.01626794n8—1.935458
customer:10500.2706701n4—0.1465247
customer:11000.2706701n4—0.1465247
customer:11500.2706701n4—0.1465247
customer:12000.2706701n4—0.1465247
customer:12510.2706701n4—1.063844
customer:13000.2706701n4—0.1465247
customer:13500.01626794n8—0.0005292919
customer:14000.02702703n3—0.00146092
customer:14500.02702703n3—0.00146092
customer:15010.02702703n3—1.893353
customer:15500.01626794n8—0.0005292919
customer:16000.01626794n8—0.0005292919
customer:16500.01626794n8—0.0005292919
customer:17000.01626794n8—0.0005292919
customer:17510.01626794n8—1.935458
customer:18000.01626794n8—0.0005292919
customer:18500.01626794n8—0.0005292919
customer:19000.01626794n8—0.0005292919
customer:19500.01626794n8—0.0005292919
customer:20010.01626794n8—1.935458
customer:20500.2706701n4—0.1465247
customer:21000.2706701n4—0.1465247
customer:21500.2706701n4—0.1465247
customer:22000.2706701n4—0.1465247
customer:22510.2706701n4—1.063844
customer:23000.2706701n4—0.1465247
customer:23500.01626794n8—0.0005292919
customer:24000.02702703n3—0.00146092
customer:24500.02702703n3—0.00146092
customer:25010.02702703n3—1.893353
customer:25500.01626794n8—0.0005292919
customer:26000.01626794n8—0.0005292919
customer:26500.01626794n8—0.0005292919
customer:27000.01626794n8—0.0005292919
customer:27500.01626794n8—0.0005292919
customer:28000.01626794n8—0.0005292919
customer:28500.01626794n8—0.0005292919
customer:29000.01626794n8—0.0005292919
customer:29500.01626794n8—0.0005292919
customer:30010.01626794n8—1.935458
customer:30500.2706701n4—0.1465247
customer:31000.2706701n4—0.1465247
customer:31500.2706701n4—0.1465247
customer:32000.2706701n4—0.1465247
customer:32510.2706701n4—1.063844
customer:33000.2706701n4—0.1465247
customer:33500.01626794n8—0.0005292919
customer:34000.02702703n3—0.00146092
customer:34500.02702703n3—0.00146092
customer:35010.02702703n3—1.893353
customer:35500.2706701n4—0.1465247
customer:36000.01626794n8—0.0005292919
customer:36500.2706701n4—0.1465247
customer:37000.2706701n4—0.1465247
customer:37500.01626794n8—0.0005292919
customer:38000.2706701n4—0.1465247
customer:38500.01626794n8—0.0005292919
customer:39000.2706701n4—0.1465247
customer:39500.02702703n3—0.00146092
customer:40010.01626794n8—1.935458
customer:40500.2706701n4—0.1465247
customer:41000.01626794n8—0.0005292919
customer:41500.2706701n4—0.1465247
customer:42000.2706701n4—0.1465247
customer:42510.01626794n8—1.935458
customer:43000.2706701n4—0.1465247
customer:43500.01626794n8—0.0005292919
customer:44000.02702703n3—0.00146092
customer:44500.02702703n3—0.00146092
customer:45010.01626794n8—1.935458
customer:45500.01626794n8—0.0005292919
customer:46000.01626794n8—0.0005292919
customer:46500.01626794n8—0.0005292919
customer:47000.01626794n8—0.0005292919
customer:47500.01626794n8—0.0005292919
customer:48000.01626794n8—0.0005292919
customer:48500.01626794n8—0.0005292919
customer:49000.01626794n8—0.0005292919
customer:49500.01626794n8—0.0005292919
customer:50010.01626794n8—1.935458
customer:50500.2706701n4—0.1465247
customer:51000.2706701n4—0.1465247
customer:51500.2706701n4—0.1465247
customer:52000.2706701n4—0.1465247
customer:52510.2706701n4—1.063844
customer:53000.2706701n4—0.1465247
customer:53500.01626794n8—0.0005292919
customer:54000.02702703n3—0.00146092
customer:54500.02702703n3—0.00146092
customer:55010.02702703n3—1.893353
customer:55500.01626794n8—0.0005292919
customer:56000.01626794n8—0.0005292919
customer:56500.01626794n8—0.0005292919
customer:57000.01626794n8—0.0005292919
customer:57500.01626794n8—0.0005292919
customer:58000.01626794n8—0.0005292919
customer:58500.01626794n8—0.0005292919
customer:59000.01626794n8—0.0005292919
customer:59500.01626794n8—0.0005292919
customer:60010.01626794n8—1.935458
customer:60500.2706701n4—0.1465247
customer:61000.2706701n4—0.1465247
customer:61500.2706701n4—0.1465247
customer:62000.2706701n4—0.1465247
customer:62510.2706701n4—1.063844
customer:63000.2706701n4—0.1465247
customer:63500.01626794n8—0.0005292919
customer:64000.02702703n3—0.00146092
customer:64500.02702703n3—0.00146092
customer:65010.02702703n3—1.893353
customer:65500.2706701n4—0.1465247
customer:66000.01626794n8—0.0005292919
customer:66500.2706701n4—0.1465247
customer:67000.2706701n4—0.1465247
customer:67510.01626794n8—1.935458
customer:68000.2706701n4—0.1465247
customer:68500.01626794n8—0.0005292919
customer:69000.02702703n3—0.00146092
customer:69500.02702703n3—0.00146092
customer:70010.01626794n8—1.935458
customer:70500.2706701n4—0.1465247
customer:71000.01626794n8—0.0005292919
customer:71500.2706701n4—0.1465247
customer:72000.2706701n4—0.1465247
customer:72510.01626794n8—1.935458
customer:73000.2706701n4—0.1465247
customer:73500.01626794n8—0.0005292919
customer:74000.02702703n3—0.00146092
customer:74500.02702703n3—0.00146092
customer:75010.01626794n8—1.935458
customer:75500.2706701n4—0.1465247
customer:76000.2706701n4—0.1465247
customer:76500.2706701n4—0.1465247
customer:77000.2706701n4—0.1465247
customer:77510.2706701n4—1.063844
customer:78000.2706701n4—0.1465247
customer:78500.01626794n8—0.0005292919
customer:79000.02702703n3—0.00146092
customer:79500.02702703n3—0.00146092
customer:80010.02702703n3—1.893353
customer:80500.01626794n8—0.0005292919
customer:81000.01626794n8—0.0005292919
customer:81500.01626794n8—0.0005292919
customer:82000.01626794n8—0.0005292919
customer:82500.01626794n8—0.0005292919
customer:83000.01626794n8—0.0005292919
customer:83500.01626794n8—0.0005292919
customer:84000.01626794n8—0.0005292919
customer:84500.01626794n8—0.0005292919
customer:85010.01626794n8—1.935458
customer:85500.01626794n8—0.0005292919
customer:86000.01626794n8—0.0005292919
customer:86500.01626794n8—0.0005292919
customer:87000.01626794n8—0.0005292919
customer:87500.01626794n8—0.0005292919
customer:88000.01626794n8—0.0005292919
customer:88500.01626794n8—0.0005292919
customer:89000.01626794n8—0.0005292919
customer:89500.01626794n8—0.0005292919
customer:90010.01626794n8—1.935458
customer:90500.2706701n4—0.1465247
customer:91000.2706701n4—0.1465247
customer:91500.2706701n4—0.1465247
customer:92000.2706701n4—0.1465247
customer:92510.2706701n4—1.063844
customer:93000.2706701n4—0.1465247
customer:93500.01626794n8—0.0005292919
customer:94000.02702703n3—0.00146092
customer:94500.02702703n3—0.00146092
customer:95010.02702703n3—1.893353
customer:95500.2706701n4—0.1465247
customer:96000.01626794n8—0.0005292919
customer:96500.2706701n4—0.1465247
customer:97000.2706701n4—0.1465247
customer:97510.01626794n8—1.935458
customer:98000.2706701n4—0.1465247
customer:98500.01626794n8—0.0005292919
customer:99000.02702703n3—0.00146092
customer:99500.02702703n3—0.00146092
customer:100010.01626794n8—1.935458
customer:100500.2706701n4—0.1465247
customer:101000.01626794n8—0.0005292919
customer:101500.2706701n4—0.1465247
customer:102000.2706701n4—0.1465247
customer:102510.01626794n8—1.935458
customer:103000.2706701n4—0.1465247
customer:103500.01626794n8—0.0005292919
customer:104000.02702703n3—0.00146092
customer:104500.02702703n3—0.00146092
customer:105010.01626794n8—1.935458
customer:105500.2706701n4—0.1465247
customer:106000.2706701n4—0.1465247
customer:106500.2706701n4—0.1465247
customer:107000.2706701n4—0.1465247
customer:107510.2706701n4—1.063844
customer:108000.2706701n4—0.1465247
customer:108500.01626794n8—0.0005292919
customer:109000.02702703n3—0.00146092
customer:109500.02702703n3—0.00146092
customer:110010.02702703n3—1.893353
customer:110500.2706701n4—0.1465247
customer:111000.01626794n8—0.0005292919
customer:111500.2706701n4—0.1465247
customer:112000.2706701n4—0.1465247
customer:112510.01626794n8—1.935458
customer:113000.2706701n4—0.1465247
customer:113500.01626794n8—0.0005292919
customer:114000.02702703n3—0.00146092
customer:114500.02702703n3—0.00146092
customer:115010.01626794n8—1.935458
customer:115500.2706701n4—0.1465247
customer:116000.2706701n4—0.1465247
customer:116500.2706701n4—0.1465247
customer:117000.2706701n4—0.1465247
customer:117510.2706701n4—1.063844
customer:118000.2706701n4—0.1465247
customer:118500.01626794n8—0.0005292919
customer:119000.02702703n3—0.00146092
customer:119500.02702703n3—0.00146092
customer:120010.02702703n3—1.893353
customer:120500.2706701n4—0.1465247
customer:121000.01626794n8—0.0005292919
customer:121500.2706701n4—0.1465247
customer:122000.2706701n4—0.1465247
customer:122510.01626794n8—1.935458
customer:123000.2706701n4—0.1465247
customer:123500.01626794n8—0.0005292919
customer:124000.2706701n4—0.1465247
customer:124500.02702703n3—0.00146092
customer:125010.01626794n8—1.935458
customer:125500.2706701n4—0.1465247
customer:126000.2706701n4—0.1465247
customer:126500.2706701n4—0.1465247
customer:127000.2706701n4—0.1465247
customer:127510.2706701n4—1.063844
customer:128000.2706701n4—0.1465247
customer:128500.01626794n8—0.0005292919
customer:129000.02702703n3—0.00146092
customer:129500.02702703n3—0.00146092
customer:130010.02702703n3—1.893353
customer:130500.2706701n4—0.1465247
customer:131000.01626794n8—0.0005292919
customer:131500.2706701n4—0.1465247
customer:132000.2706701n4—0.1465247
customer:132500.01626794n8—0.0005292919
customer:133000.2706701n4—0.1465247
customer:133500.01626794n8—0.0005292919
customer:134000.2706701n4—0.1465247
customer:134500.02702703n3—0.00146092
customer:135010.01626794n8—1.935458
customer:135500.2706701n4—0.1465247
customer:136000.2706701n4—0.1465247
customer:136500.2706701n4—0.1465247
customer:137000.2706701n4—0.1465247
customer:137510.2706701n4—1.063844
customer:138000.2706701n4—0.1465247
customer:138500.01626794n8—0.0005292919
customer:139000.02702703n3—0.00146092
customer:139500.02702703n3—0.00146092
customer:140010.02702703n3—1.893353
customer:140500.2706701n4—0.1465247
customer:141000.2706701n4—0.1465247
customer:141500.2706701n4—0.1465247
customer:142000.2706701n4—0.1465247
customer:142510.2706701n4—1.063844
customer:143000.2706701n4—0.1465247
customer:143500.01626794n8—0.0005292919
customer:144000.02702703n3—0.00146092
customer:144500.02702703n3—0.00146092
customer:145010.02702703n3—1.893353
customer:145500.2706701n4—0.1465247
customer:146000.2706701n4—0.1465247
customer:146500.2706701n4—0.1465247
customer:147000.2706701n4—0.1465247
customer:147510.2706701n4—1.063844
customer:148000.2706701n4—0.1465247
customer:148500.01626794n8—0.0005292919
customer:149000.02702703n3—0.00146092
customer:149500.02702703n3—0.00146092
customer:150010.02702703n3—1.893353
customer:150500.01626794n8—0.0005292919
customer:151000.01626794n8—0.0005292919
customer:151500.01626794n8—0.0005292919
customer:152000.01626794n8—0.0005292919
customer:152500.01626794n8—0.0005292919
customer:153000.01626794n8—0.0005292919
customer:153500.01626794n8—0.0005292919
customer:154000.01626794n8—0.0005292919
customer:154500.01626794n8—0.0005292919
customer:155010.01626794n8—1.935458
customer:155500.2706701n4—0.1465247
customer:156000.2706701n4—0.1465247
customer:156500.2706701n4—0.1465247
customer:157000.2706701n4—0.1465247
customer:157510.2706701n4—1.063844
customer:158000.2706701n4—0.1465247
customer:158500.2706701n4—0.1465247
customer:159000.02702703n3—0.00146092
customer:159500.02702703n3—0.00146092
customer:160010.02702703n3—1.893353
customer:160500.2706701n4—0.1465247
customer:161000.01626794n8—0.0005292919
customer:161500.2706701n4—0.1465247
customer:162000.2706701n4—0.1465247
customer:162510.01626794n8—1.935458
customer:163000.2706701n4—0.1465247
customer:163500.01626794n8—0.0005292919
customer:164000.02702703n3—0.00146092
customer:164500.02702703n3—0.00146092
customer:165010.01626794n8—1.935458
customer:165500.2706701n4—0.1465247
customer:166000.2706701n4—0.1465247
customer:166500.2706701n4—0.1465247
customer:167000.2706701n4—0.1465247
customer:167510.2706701n4—1.063844
customer:168000.2706701n4—0.1465247
customer:168500.01626794n8—0.0005292919
customer:169000.02702703n3—0.00146092
customer:169500.02702703n3—0.00146092
customer:170010.02702703n3—1.893353
customer:170500.2706701n4—0.1465247
customer:171000.2706701n4—0.1465247
customer:171500.2706701n4—0.1465247
customer:172000.2706701n4—0.1465247
customer:172510.2706701n4—1.063844
customer:173000.2706701n4—0.1465247
customer:173500.01626794n8—0.0005292919
customer:174000.02702703n3—0.00146092
customer:174500.02702703n3—0.00146092
customer:175010.02702703n3—1.893353
customer:175500.2706701n4—0.1465247
customer:176000.2706701n4—0.1465247
customer:176500.2706701n4—0.1465247
customer:177000.2706701n4—0.1465247
customer:177510.2706701n4—1.063844
customer:178000.2706701n4—0.1465247
customer:178500.01626794n8—0.0005292919
customer:179000.02702703n3—0.00146092
customer:179500.02702703n3—0.00146092
customer:180010.02702703n3—1.893353
customer:180500.2706701n4—0.1465247
customer:181000.2706701n4—0.1465247
customer:181500.2706701n4—0.1465247
customer:182000.2706701n4—0.1465247
customer:182510.2706701n4—1.063844
customer:183000.2706701n4—0.1465247
customer:183500.01626794n8—0.0005292919
customer:184000.02702703n3—0.00146092
customer:184500.02702703n3—0.00146092
customer:185010.02702703n3—1.893353
customer:185500.2706701n4—0.1465247
customer:186000.01626794n8—0.0005292919
customer:186500.2706701n4—0.1465247
customer:187000.2706701n4—0.1465247
customer:187510.01626794n8—1.935458
customer:188000.2706701n4—0.1465247
customer:188500.01626794n8—0.0005292919
customer:189000.2706701n4—0.1465247
customer:189500.02702703n3—0.00146092
customer:190010.01626794n8—1.935458
customer:190500.2706701n4—0.1465247
customer:191000.01626794n8—0.0005292919
customer:191500.2706701n4—0.1465247
customer:192000.2706701n4—0.1465247
customer:192500.01626794n8—0.0005292919
customer:193000.2706701n4—0.1465247
customer:193500.01626794n8—0.0005292919
customer:194000.02702703n3—0.00146092
customer:194500.02702703n3—0.00146092
customer:195010.01626794n8—1.935458
customer:195500.2706701n4—0.1465247
customer:196000.2706701n4—0.1465247
customer:196500.2706701n4—0.1465247
customer:197000.2706701n4—0.1465247
customer:197510.2706701n4—1.063844
customer:198000.2706701n4—0.1465247
customer:198500.01626794n8—0.0005292919
customer:199000.02702703n3—0.00146092
customer:199500.02702703n3—0.00146092
customer:200010.02702703n3—1.893353
customer:200500.2706701n4—0.1465247
customer:201000.2706701n4—0.1465247
customer:201500.2706701n4—0.1465247
customer:202000.2706701n4—0.1465247
customer:202510.2706701n4—1.063844
customer:203000.2706701n4—0.1465247
customer:203500.01626794n8—0.0005292919
customer:204000.02702703n3—0.00146092
customer:204500.02702703n3—0.00146092
customer:205010.02702703n3—1.893353
customer:205500.2706701n4—0.1465247
customer:206000.2706701n4—0.1465247
customer:206500.2706701n4—0.1465247
customer:207000.2706701n4—0.1465247
customer:207510.2706701n4—1.063844
customer:208000.2706701n4—0.1465247
customer:208500.01626794n8—0.0005292919
customer:209000.02702703n3—0.00146092
customer:209500.02702703n3—0.00146092
customer:210010.02702703n3—1.893353
customer:210500.01626794n8—0.0005292919
customer:211000.01626794n8—0.0005292919
customer:211500.01626794n8—0.0005292919
customer:212000.01626794n8—0.0005292919
customer:212500.01626794n8—0.0005292919
customer:213000.01626794n8—0.0005292919
customer:213500.01626794n8—0.0005292919
customer:214000.01626794n8—0.0005292919
customer:214500.01626794n8—0.0005292919
customer:215010.01626794n8—1.935458
customer:215500.01626794n8—0.0005292919
customer:216000.01626794n8—0.0005292919
customer:216500.01626794n8—0.0005292919
customer:217000.01626794n8—0.0005292919
customer:217500.01626794n8—0.0005292919
customer:218000.01626794n8—0.0005292919
customer:218500.01626794n8—0.0005292919
customer:219000.01626794n8—0.0005292919
customer:219500.01626794n8—0.0005292919
customer:220010.01626794n8—1.935458
customer:220500.01626794n8—0.0005292919
customer:221000.01626794n8—0.0005292919
customer:221500.01626794n8—0.0005292919
customer:222000.01626794n8—0.0005292919
customer:222500.01626794n8—0.0005292919
customer:223000.01626794n8—0.0005292919
customer:223500.01626794n8—0.0005292919
customer:224000.01626794n8—0.0005292919
customer:224500.01626794n8—0.0005292919
customer:225010.01626794n8—1.935458
customer:225500.01626794n8—0.0005292919
customer:226000.01626794n8—0.0005292919
customer:226500.01626794n8—0.0005292919
customer:227000.01626794n8—0.0005292919
customer:227500.01626794n8—0.0005292919
customer:228000.01626794n8—0.0005292919
customer:228500.01626794n8—0.0005292919
customer:229000.01626794n8—0.0005292919
customer:229500.01626794n8—0.0005292919
customer:230010.01626794n8—1.935458
customer:230500.01626794n8—0.0005292919
customer:231000.01626794n8—0.0005292919
customer:231500.01626794n8—0.0005292919
customer:232000.01626794n8—0.0005292919
customer:232500.01626794n8—0.0005292919
customer:233000.01626794n8—0.0005292919
customer:233500.01626794n8—0.0005292919
customer:234000.01626794n8—0.0005292919
customer:234500.01626794n8—0.0005292919
customer:235010.01626794n8—1.935458
customer:235500.01626794n8—0.0005292919
customer:236000.01626794n8—0.0005292919
customer:236500.01626794n8—0.0005292919
customer:237000.01626794n8—0.0005292919
customer:237500.01626794n8—0.0005292919
customer:238000.01626794n8—0.0005292919
customer:238500.01626794n8—0.0005292919
customer:239000.01626794n8—0.0005292919
customer:239500.01626794n8—0.0005292919
customer:240010.01626794n8—1.935458
customer:240500.01626794n8—0.0005292919
customer:241000.01626794n8—0.0005292919
customer:241500.01626794n8—0.0005292919
customer:242000.01626794n8—0.0005292919
customer:242510.01626794n8—1.935458
customer:243000.01626794n8—0.0005292919
customer:243500.01626794n8—0.0005292919
customer:244000.01626794n8—0.0005292919
customer:244500.01626794n8—0.0005292919
customer:245010.02702703n3—1.893353
customer:245500.01626794n8—0.0005292919
customer:246000.01626794n8—0.0005292919
customer:246500.01626794n8—0.0005292919
customer:247000.01626794n8—0.0005292919
customer:247500.01626794n8—0.0005292919
customer:248000.01626794n8—0.0005292919
customer:248500.01626794n8—0.0005292919
customer:249000.01626794n8—0.0005292919
customer:249500.01626794n8—0.0005292919
customer:250010.01626794n8—1.935458
customer:250500.01626794n8—0.0005292919
customer:251000.01626794n8—0.0005292919
customer:251500.01626794n8—0.0005292919
customer:252000.01626794n8—0.0005292919
customer:252510.01626794n8—1.935458
customer:253000.01626794n8—0.0005292919
customer:253500.01626794n8—0.0005292919
customer:254000.01626794n8—0.0005292919
customer:254500.01626794n8—0.0005292919
customer:255010.01626794n8—1.935458
customer:255500.01626794n8—0.0005292919
customer:256000.01626794n8—0.0005292919
customer:256500.01626794n8—0.0005292919
customer:257000.01626794n8—0.0005292919
customer:257500.01626794n8—0.0005292919
customer:258000.01626794n8—0.0005292919
customer:258500.01626794n8—0.0005292919
customer:259000.01626794n8—0.0005292919
customer:259500.01626794n8—0.0005292919
customer:260010.01626794n8—1.935458
customer:260500.2706701n4—0.1465247
customer:261000.2706701n4—0.1465247
customer:261500.2706701n4—0.1465247
customer:262000.2706701n4—0.1465247
customer:262510.2706701n4—1.063844
customer:263000.01626794n8—0.0005292919
customer:263500.01626794n8—0.0005292919
customer:264000.2706701n4—0.1465247
customer:264500.01626794n8—0.0005292919
customer:265010.01626794n8—1.935458
customer:265500.01626794n8—0.0005292919
customer:266000.01626794n8—0.0005292919
customer:266500.01626794n8—0.0005292919
customer:267000.01626794n8—0.0005292919
customer:267500.01626794n8—0.0005292919
customer:268000.01626794n8—0.0005292919
customer:268500.01626794n8—0.0005292919
customer:269000.01626794n8—0.0005292919
customer:269500.01626794n8—0.0005292919
customer:270010.01626794n8—1.935458
customer:270500.2706701n4—0.1465247
customer:271000.01626794n8—0.0005292919
customer:271500.2706701n4—0.1465247
customer:272000.2706701n4—0.1465247
customer:272510.01626794n8—1.935458
customer:273000.2706701n4—0.1465247
customer:273500.01626794n8—0.0005292919
customer:274000.02702703n3—0.00146092
customer:274500.02702703n3—0.00146092
customer:275010.01626794n8—1.935458
customer:275500.01626794n8—0.0005292919
customer:276000.01626794n8—0.0005292919
customer:276500.01626794n8—0.0005292919
customer:277000.01626794n8—0.0005292919
customer:277500.01626794n8—0.0005292919
customer:278000.01626794n8—0.0005292919
customer:278500.01626794n8—0.0005292919
customer:279000.01626794n8—0.0005292919
customer:279500.01626794n8—0.0005292919
customer:280010.01626794n8—1.935458
customer:280500.01626794n8—0.0005292919
customer:281000.01626794n8—0.0005292919
customer:281500.01626794n8—0.0005292919
customer:282000.01626794n8—0.0005292919
customer:282500.01626794n8—0.0005292919
customer:283000.01626794n8—0.0005292919
customer:283500.01626794n8—0.0005292919
customer:284000.01626794n8—0.0005292919
customer:284500.01626794n8—0.0005292919
customer:285010.01626794n8—1.935458
customer:285500.2706701n4—0.1465247
customer:286000.01626794n8—0.0005292919
customer:286500.2706701n4—0.1465247
customer:287000.2706701n4—0.1465247
customer:287510.01626794n8—1.935458
customer:288000.2706701n4—0.1465247
customer:288500.01626794n8—0.0005292919
customer:289000.02702703n3—0.00146092
customer:289500.02702703n3—0.00146092
customer:290010.01626794n8—1.935458
customer:290500.01626794n8—0.0005292919
customer:291000.01626794n8—0.0005292919
customer:291500.01626794n8—0.0005292919
customer:292000.01626794n8—0.0005292919
customer:292500.01626794n8—0.0005292919
customer:293000.01626794n8—0.0005292919
customer:293500.01626794n8—0.0005292919
customer:294000.01626794n8—0.0005292919
customer:294500.01626794n8—0.0005292919
customer:295010.01626794n8—1.935458
customer:295500.01626794n8—0.0005292919
customer:296000.01626794n8—0.0005292919
customer:296500.01626794n8—0.0005292919
customer:297000.01626794n8—0.0005292919
customer:297500.01626794n8—0.0005292919
customer:298000.01626794n8—0.0005292919
customer:298500.01626794n8—0.0005292919
customer:299000.01626794n8—0.0005292919
customer:299500.01626794n8—0.0005292919
customer:300010.01626794n8—1.935458
customer:300500.2706701n4—0.1465247
customer:301000.01626794n8—0.0005292919
customer:301500.2706701n4—0.1465247
customer:302000.2706701n4—0.1465247
customer:302510.01626794n8—1.935458
customer:303000.2706701n4—0.1465247
customer:303500.01626794n8—0.0005292919
customer:304000.02702703n3—0.00146092
customer:304500.02702703n3—0.00146092
customer:305010.01626794n8—1.935458
customer:305500.01626794n8—0.0005292919
customer:306000.01626794n8—0.0005292919
customer:306500.01626794n8—0.0005292919
customer:307000.01626794n8—0.0005292919
customer:307500.01626794n8—0.0005292919
customer:308000.01626794n8—0.0005292919
customer:308500.01626794n8—0.0005292919
customer:309000.01626794n8—0.0005292919
customer:309500.01626794n8—0.0005292919
customer:310010.01626794n8—1.935458
customer:310500.01626794n8—0.0005292919
customer:311000.01626794n8—0.0005292919
customer:311500.01626794n8—0.0005292919
customer:312000.01626794n8—0.0005292919
customer:312500.01626794n8—0.0005292919
customer:313000.01626794n8—0.0005292919
customer:313500.01626794n8—0.0005292919
customer:314000.01626794n8—0.0005292919
customer:314500.01626794n8—0.0005292919
customer:315010.01626794n8—1.935458

손으로 확인하는 한 행

첫 시험 행에서 p는 이탈 범주의 잎 비율입니다. 실제 표지가 y일 때 두 범주 Brier는 (p−y)²+((1−p)−(1−y))²=2(p−y)²입니다. 모든 시험 행에 같은 정의를 사용합니다.

첫 시험 행 재계산
IDy예측 / p손실
customer:500.27067010.1465247

실습·읽기와 해석의 한계

실습에서는 최소 잎 수를 올려 잎이 어떻게 합쳐지는지 먼저 예측한 뒤 계산합니다. 알파를 손으로 고정한 시험과 안쪽 검증으로 고른 시험을 구분합니다. 바깥 시험을 여러 번 본 뒤 설정을 고치면 그 자료를 더는 처음 보는 시험이라고 부르지 않습니다.

공개 Python은 Fraction으로, 별도 base R은 유한 정밀도로 전체 자료·접힘·예측을 다시 계산합니다. Python의 정확한 계산이 자료의 측정 오차·선택 편향·미래 변화까지 없애 주지는 않습니다. 원자료 보존 파일을 이 작업에서 다시 읽었으며 새 HTTP 다운로드라고 주장하지 않습니다.

The business case retains 3,150 customers and 14 original Iranian Churn fields. Features are call-failure count, subscription months and an ordinal charge code; target is native Churn 0/1. Creator documentation aggregates inputs over the first nine months and labels status at month 12, with a three-month planning gap. Deployment elsewhere requires its own information-timing check.

The creator describes charge codes 0–9, while the retained CSV has seven code 10 records. Preserve all seven tokens rather than clipping them to nine or interpreting 10 as a currency amount. Disclose the metadata discrepancy alongside the computation instead of silently repairing uncertain meaning.

All 3,150 records are eligible, with 2,520 training and 630 outer testing. Depth three/minimum leaf 30 and alphas 0,1/1000,1/100,1/10 select 1/1000 and four leaves. Outer multiclass Brier is about 0.320409; a positive-category-only binary convention gives half. One company’s systematic holdout does not identify a retention intervention effect in a new market.

UCI · Original description, variables and license

Company · Churn in a public telecom dataset

The question is prediction of the recorded final churn label, not the effect of a retention intervention. All 3,150 original records and fourteen native fields remain. Creator documentation describes first-nine-month attributes and churn at the end of month twelve, separated by a three-month planning gap.

Only call failures, subscription months and the charge-category code enter this chapter’s model. Charge is not a currency amount. Creator metadata describes codes 0–9, but seven original rows contain code 10. Preserve them without clipping to nine or rewriting the official description as if it said ten.

Source-row multiples of five select the 630 outer tests; 2,520 rows train. Four remainder groups within training choose alpha. This design does not validate future deployment, another operator or the effect of contacting a customer.

Validation uses Brier summed over both classes. In this binary case it is exactly twice the positive-class-only Brier. An empirical leaf proportion is not proof of calibrated risk outside these records.

Read the original source and creator documentation

What each variable means

Data dictionary
VariableMeaning and unit
X1Call failures · count
X2Subscription length · months
X3Native charge-category code · ordinal code, not currency
YChurn 0/1
weightOne for every row
Distinct denominators
FrameRows
Original records3150
Country-year/person/customer rows3150
Complete eligible rows3150
Retained incomplete rows0
Training2520
Outer test630
Inner folds4
First twelve source-order rows · preview
IDRoleX1X2X3Y
customer:1train83800
customer:2train03900
customer:3train103700
customer:4train103800
customer:5outer-test33800
customer:6train113810
customer:7train43800
customer:8train133720
customer:9train73800
customer:10outer-test73810
customer:11train63800
customer:12train93800

The preview is not the fitting sample. Results below use every declared training row and every fold.

Select the model before the outer test

Maximum depth is three and minimum eligible rows per leaf is 30. At every alpha, refit each fold’s training tree and pool validation loss sums over validation weight. Exact tied pooled losses choose the larger alpha. Do not average a large and small fold as if their masses were equal.

Pooled validation at every alpha
AlphaLoss sumWeightPooled lossSelected
0524.3243
Full exact value6951080278249496601646226572356154398690121049685499/13257214463589012175014162534911381670191572252800
25200.2080652
Full exact value6951080278249496601646226572356154398690121049685499/33408180448244310681035689587976681808882762077056000
0.001523.977
Full exact value5182413260247994482186053641965288260850410321611/9890536585790182525656905285566435311008400000
25200.2079274
Full exact value5182413260247994482186053641965288260850410321611/24924152196191259964655401319627416983741168000000
Yes
0.01541.4222
Full exact value517684836808998945728816019324109693496253632419/956157374899142707268152202241398908323600000
25200.2148501
Full exact value517684836808998945728816019324109693496253632419/2409516584745839622315743549648325248975472000000
0.1676.216625200.2683399
Every fold at the selected alpha
FoldTrain rowsTest rowsLeavesLoss sumMean loss
source-remainder-018906305103.3294
Full exact value29653510996166522/286980370845025
0.1640149
Full exact value14826755498083261/90398816816182875
source-remainder-118906304160.4324
Full exact value10828051092646798/67492899569667
0.2546547
Full exact value5414025546323399/21260263364445105
source-remainder-218906304110.2329
Full exact value1120236629120840159/10162451379600000
0.1749729
Full exact value1120236629120840159/6402344369148000000
source-remainder-318906304149.9822
Full exact value562552831209067/3750797560608
0.238067
Full exact value562552831209067/2363002463183040

Refit the tree using all training rows

Exact pruning path of the full-training grown tree
Alpha breakpointLeavesTraining risk
070.2031909
Full exact value521750689/2567785200
7.228362e-0560.2032632
Full exact value13537506691/66600865800
8.797178e-0550.2033512
0.000935007540.2042862
Full exact value383082604963/1875225047850
0.009957605
Full exact value26822041/2693623680
30.2142438
Full exact value604811299/2823004800
0.02176
Full exact value953759689/43830864000
20.2360038
0.02780445
Full exact value1360798321/48941739000
10.2638083

Normalize training risk by the original root weight and choose the smaller tree at equality. Path optimality holds among subtrees of this already-grown tree, not among all possible trees.

All nodes of the selected final tree
NodeDepthRowsRaw riskLeaf predictionFeatureThresholdLeftRight
n002520664.79680X30.5n1n8
n111475561.28270X117.5n2n5
n221408492.3580X227.5n3n4
n3325913.621620————
n431149453.64320————
n526714.089551————
n81104533.446890————

Check the held-out outer rows

Outer-test loss and units
MetricValue
Scored outer rows630
Outer loss sum201.8578
Full exact value132800694375562918/657892342809075
Brier summed over both classes0.3204092
Full exact value66400347187781459/207236087984858625
Positive-class-only Brier0.1602046
Full exact value66400347187781459/414472175969717250
Zero-one error rate0.1603175

The horizontal axis is record order. Connecting marks do not represent a time trajectory or a policy effect. The web plot retains all recorded outcomes and missing slots; the outer plot shows observed and predicted outcomes together.

All 630 outer-test observed values, predictions and losses
All outer-test rows in source order
IDObservedPrediction / churn probabilityLeafErrorLoss
customer:500.2706701n4—0.1465247
customer:1000.01626794n8—0.0005292919
customer:1500.2706701n4—0.1465247
customer:2000.2706701n4—0.1465247
customer:2510.01626794n8—1.935458
customer:3000.2706701n4—0.1465247
customer:3500.01626794n8—0.0005292919
customer:4000.02702703n3—0.00146092
customer:4500.02702703n3—0.00146092
customer:5010.01626794n8—1.935458
customer:5500.01626794n8—0.0005292919
customer:6000.01626794n8—0.0005292919
customer:6500.01626794n8—0.0005292919
customer:7000.01626794n8—0.0005292919
customer:7500.01626794n8—0.0005292919
customer:8000.01626794n8—0.0005292919
customer:8500.01626794n8—0.0005292919
customer:9000.01626794n8—0.0005292919
customer:9500.01626794n8—0.0005292919
customer:10010.01626794n8—1.935458
customer:10500.2706701n4—0.1465247
customer:11000.2706701n4—0.1465247
customer:11500.2706701n4—0.1465247
customer:12000.2706701n4—0.1465247
customer:12510.2706701n4—1.063844
customer:13000.2706701n4—0.1465247
customer:13500.01626794n8—0.0005292919
customer:14000.02702703n3—0.00146092
customer:14500.02702703n3—0.00146092
customer:15010.02702703n3—1.893353
customer:15500.01626794n8—0.0005292919
customer:16000.01626794n8—0.0005292919
customer:16500.01626794n8—0.0005292919
customer:17000.01626794n8—0.0005292919
customer:17510.01626794n8—1.935458
customer:18000.01626794n8—0.0005292919
customer:18500.01626794n8—0.0005292919
customer:19000.01626794n8—0.0005292919
customer:19500.01626794n8—0.0005292919
customer:20010.01626794n8—1.935458
customer:20500.2706701n4—0.1465247
customer:21000.2706701n4—0.1465247
customer:21500.2706701n4—0.1465247
customer:22000.2706701n4—0.1465247
customer:22510.2706701n4—1.063844
customer:23000.2706701n4—0.1465247
customer:23500.01626794n8—0.0005292919
customer:24000.02702703n3—0.00146092
customer:24500.02702703n3—0.00146092
customer:25010.02702703n3—1.893353
customer:25500.01626794n8—0.0005292919
customer:26000.01626794n8—0.0005292919
customer:26500.01626794n8—0.0005292919
customer:27000.01626794n8—0.0005292919
customer:27500.01626794n8—0.0005292919
customer:28000.01626794n8—0.0005292919
customer:28500.01626794n8—0.0005292919
customer:29000.01626794n8—0.0005292919
customer:29500.01626794n8—0.0005292919
customer:30010.01626794n8—1.935458
customer:30500.2706701n4—0.1465247
customer:31000.2706701n4—0.1465247
customer:31500.2706701n4—0.1465247
customer:32000.2706701n4—0.1465247
customer:32510.2706701n4—1.063844
customer:33000.2706701n4—0.1465247
customer:33500.01626794n8—0.0005292919
customer:34000.02702703n3—0.00146092
customer:34500.02702703n3—0.00146092
customer:35010.02702703n3—1.893353
customer:35500.2706701n4—0.1465247
customer:36000.01626794n8—0.0005292919
customer:36500.2706701n4—0.1465247
customer:37000.2706701n4—0.1465247
customer:37500.01626794n8—0.0005292919
customer:38000.2706701n4—0.1465247
customer:38500.01626794n8—0.0005292919
customer:39000.2706701n4—0.1465247
customer:39500.02702703n3—0.00146092
customer:40010.01626794n8—1.935458
customer:40500.2706701n4—0.1465247
customer:41000.01626794n8—0.0005292919
customer:41500.2706701n4—0.1465247
customer:42000.2706701n4—0.1465247
customer:42510.01626794n8—1.935458
customer:43000.2706701n4—0.1465247
customer:43500.01626794n8—0.0005292919
customer:44000.02702703n3—0.00146092
customer:44500.02702703n3—0.00146092
customer:45010.01626794n8—1.935458
customer:45500.01626794n8—0.0005292919
customer:46000.01626794n8—0.0005292919
customer:46500.01626794n8—0.0005292919
customer:47000.01626794n8—0.0005292919
customer:47500.01626794n8—0.0005292919
customer:48000.01626794n8—0.0005292919
customer:48500.01626794n8—0.0005292919
customer:49000.01626794n8—0.0005292919
customer:49500.01626794n8—0.0005292919
customer:50010.01626794n8—1.935458
customer:50500.2706701n4—0.1465247
customer:51000.2706701n4—0.1465247
customer:51500.2706701n4—0.1465247
customer:52000.2706701n4—0.1465247
customer:52510.2706701n4—1.063844
customer:53000.2706701n4—0.1465247
customer:53500.01626794n8—0.0005292919
customer:54000.02702703n3—0.00146092
customer:54500.02702703n3—0.00146092
customer:55010.02702703n3—1.893353
customer:55500.01626794n8—0.0005292919
customer:56000.01626794n8—0.0005292919
customer:56500.01626794n8—0.0005292919
customer:57000.01626794n8—0.0005292919
customer:57500.01626794n8—0.0005292919
customer:58000.01626794n8—0.0005292919
customer:58500.01626794n8—0.0005292919
customer:59000.01626794n8—0.0005292919
customer:59500.01626794n8—0.0005292919
customer:60010.01626794n8—1.935458
customer:60500.2706701n4—0.1465247
customer:61000.2706701n4—0.1465247
customer:61500.2706701n4—0.1465247
customer:62000.2706701n4—0.1465247
customer:62510.2706701n4—1.063844
customer:63000.2706701n4—0.1465247
customer:63500.01626794n8—0.0005292919
customer:64000.02702703n3—0.00146092
customer:64500.02702703n3—0.00146092
customer:65010.02702703n3—1.893353
customer:65500.2706701n4—0.1465247
customer:66000.01626794n8—0.0005292919
customer:66500.2706701n4—0.1465247
customer:67000.2706701n4—0.1465247
customer:67510.01626794n8—1.935458
customer:68000.2706701n4—0.1465247
customer:68500.01626794n8—0.0005292919
customer:69000.02702703n3—0.00146092
customer:69500.02702703n3—0.00146092
customer:70010.01626794n8—1.935458
customer:70500.2706701n4—0.1465247
customer:71000.01626794n8—0.0005292919
customer:71500.2706701n4—0.1465247
customer:72000.2706701n4—0.1465247
customer:72510.01626794n8—1.935458
customer:73000.2706701n4—0.1465247
customer:73500.01626794n8—0.0005292919
customer:74000.02702703n3—0.00146092
customer:74500.02702703n3—0.00146092
customer:75010.01626794n8—1.935458
customer:75500.2706701n4—0.1465247
customer:76000.2706701n4—0.1465247
customer:76500.2706701n4—0.1465247
customer:77000.2706701n4—0.1465247
customer:77510.2706701n4—1.063844
customer:78000.2706701n4—0.1465247
customer:78500.01626794n8—0.0005292919
customer:79000.02702703n3—0.00146092
customer:79500.02702703n3—0.00146092
customer:80010.02702703n3—1.893353
customer:80500.01626794n8—0.0005292919
customer:81000.01626794n8—0.0005292919
customer:81500.01626794n8—0.0005292919
customer:82000.01626794n8—0.0005292919
customer:82500.01626794n8—0.0005292919
customer:83000.01626794n8—0.0005292919
customer:83500.01626794n8—0.0005292919
customer:84000.01626794n8—0.0005292919
customer:84500.01626794n8—0.0005292919
customer:85010.01626794n8—1.935458
customer:85500.01626794n8—0.0005292919
customer:86000.01626794n8—0.0005292919
customer:86500.01626794n8—0.0005292919
customer:87000.01626794n8—0.0005292919
customer:87500.01626794n8—0.0005292919
customer:88000.01626794n8—0.0005292919
customer:88500.01626794n8—0.0005292919
customer:89000.01626794n8—0.0005292919
customer:89500.01626794n8—0.0005292919
customer:90010.01626794n8—1.935458
customer:90500.2706701n4—0.1465247
customer:91000.2706701n4—0.1465247
customer:91500.2706701n4—0.1465247
customer:92000.2706701n4—0.1465247
customer:92510.2706701n4—1.063844
customer:93000.2706701n4—0.1465247
customer:93500.01626794n8—0.0005292919
customer:94000.02702703n3—0.00146092
customer:94500.02702703n3—0.00146092
customer:95010.02702703n3—1.893353
customer:95500.2706701n4—0.1465247
customer:96000.01626794n8—0.0005292919
customer:96500.2706701n4—0.1465247
customer:97000.2706701n4—0.1465247
customer:97510.01626794n8—1.935458
customer:98000.2706701n4—0.1465247
customer:98500.01626794n8—0.0005292919
customer:99000.02702703n3—0.00146092
customer:99500.02702703n3—0.00146092
customer:100010.01626794n8—1.935458
customer:100500.2706701n4—0.1465247
customer:101000.01626794n8—0.0005292919
customer:101500.2706701n4—0.1465247
customer:102000.2706701n4—0.1465247
customer:102510.01626794n8—1.935458
customer:103000.2706701n4—0.1465247
customer:103500.01626794n8—0.0005292919
customer:104000.02702703n3—0.00146092
customer:104500.02702703n3—0.00146092
customer:105010.01626794n8—1.935458
customer:105500.2706701n4—0.1465247
customer:106000.2706701n4—0.1465247
customer:106500.2706701n4—0.1465247
customer:107000.2706701n4—0.1465247
customer:107510.2706701n4—1.063844
customer:108000.2706701n4—0.1465247
customer:108500.01626794n8—0.0005292919
customer:109000.02702703n3—0.00146092
customer:109500.02702703n3—0.00146092
customer:110010.02702703n3—1.893353
customer:110500.2706701n4—0.1465247
customer:111000.01626794n8—0.0005292919
customer:111500.2706701n4—0.1465247
customer:112000.2706701n4—0.1465247
customer:112510.01626794n8—1.935458
customer:113000.2706701n4—0.1465247
customer:113500.01626794n8—0.0005292919
customer:114000.02702703n3—0.00146092
customer:114500.02702703n3—0.00146092
customer:115010.01626794n8—1.935458
customer:115500.2706701n4—0.1465247
customer:116000.2706701n4—0.1465247
customer:116500.2706701n4—0.1465247
customer:117000.2706701n4—0.1465247
customer:117510.2706701n4—1.063844
customer:118000.2706701n4—0.1465247
customer:118500.01626794n8—0.0005292919
customer:119000.02702703n3—0.00146092
customer:119500.02702703n3—0.00146092
customer:120010.02702703n3—1.893353
customer:120500.2706701n4—0.1465247
customer:121000.01626794n8—0.0005292919
customer:121500.2706701n4—0.1465247
customer:122000.2706701n4—0.1465247
customer:122510.01626794n8—1.935458
customer:123000.2706701n4—0.1465247
customer:123500.01626794n8—0.0005292919
customer:124000.2706701n4—0.1465247
customer:124500.02702703n3—0.00146092
customer:125010.01626794n8—1.935458
customer:125500.2706701n4—0.1465247
customer:126000.2706701n4—0.1465247
customer:126500.2706701n4—0.1465247
customer:127000.2706701n4—0.1465247
customer:127510.2706701n4—1.063844
customer:128000.2706701n4—0.1465247
customer:128500.01626794n8—0.0005292919
customer:129000.02702703n3—0.00146092
customer:129500.02702703n3—0.00146092
customer:130010.02702703n3—1.893353
customer:130500.2706701n4—0.1465247
customer:131000.01626794n8—0.0005292919
customer:131500.2706701n4—0.1465247
customer:132000.2706701n4—0.1465247
customer:132500.01626794n8—0.0005292919
customer:133000.2706701n4—0.1465247
customer:133500.01626794n8—0.0005292919
customer:134000.2706701n4—0.1465247
customer:134500.02702703n3—0.00146092
customer:135010.01626794n8—1.935458
customer:135500.2706701n4—0.1465247
customer:136000.2706701n4—0.1465247
customer:136500.2706701n4—0.1465247
customer:137000.2706701n4—0.1465247
customer:137510.2706701n4—1.063844
customer:138000.2706701n4—0.1465247
customer:138500.01626794n8—0.0005292919
customer:139000.02702703n3—0.00146092
customer:139500.02702703n3—0.00146092
customer:140010.02702703n3—1.893353
customer:140500.2706701n4—0.1465247
customer:141000.2706701n4—0.1465247
customer:141500.2706701n4—0.1465247
customer:142000.2706701n4—0.1465247
customer:142510.2706701n4—1.063844
customer:143000.2706701n4—0.1465247
customer:143500.01626794n8—0.0005292919
customer:144000.02702703n3—0.00146092
customer:144500.02702703n3—0.00146092
customer:145010.02702703n3—1.893353
customer:145500.2706701n4—0.1465247
customer:146000.2706701n4—0.1465247
customer:146500.2706701n4—0.1465247
customer:147000.2706701n4—0.1465247
customer:147510.2706701n4—1.063844
customer:148000.2706701n4—0.1465247
customer:148500.01626794n8—0.0005292919
customer:149000.02702703n3—0.00146092
customer:149500.02702703n3—0.00146092
customer:150010.02702703n3—1.893353
customer:150500.01626794n8—0.0005292919
customer:151000.01626794n8—0.0005292919
customer:151500.01626794n8—0.0005292919
customer:152000.01626794n8—0.0005292919
customer:152500.01626794n8—0.0005292919
customer:153000.01626794n8—0.0005292919
customer:153500.01626794n8—0.0005292919
customer:154000.01626794n8—0.0005292919
customer:154500.01626794n8—0.0005292919
customer:155010.01626794n8—1.935458
customer:155500.2706701n4—0.1465247
customer:156000.2706701n4—0.1465247
customer:156500.2706701n4—0.1465247
customer:157000.2706701n4—0.1465247
customer:157510.2706701n4—1.063844
customer:158000.2706701n4—0.1465247
customer:158500.2706701n4—0.1465247
customer:159000.02702703n3—0.00146092
customer:159500.02702703n3—0.00146092
customer:160010.02702703n3—1.893353
customer:160500.2706701n4—0.1465247
customer:161000.01626794n8—0.0005292919
customer:161500.2706701n4—0.1465247
customer:162000.2706701n4—0.1465247
customer:162510.01626794n8—1.935458
customer:163000.2706701n4—0.1465247
customer:163500.01626794n8—0.0005292919
customer:164000.02702703n3—0.00146092
customer:164500.02702703n3—0.00146092
customer:165010.01626794n8—1.935458
customer:165500.2706701n4—0.1465247
customer:166000.2706701n4—0.1465247
customer:166500.2706701n4—0.1465247
customer:167000.2706701n4—0.1465247
customer:167510.2706701n4—1.063844
customer:168000.2706701n4—0.1465247
customer:168500.01626794n8—0.0005292919
customer:169000.02702703n3—0.00146092
customer:169500.02702703n3—0.00146092
customer:170010.02702703n3—1.893353
customer:170500.2706701n4—0.1465247
customer:171000.2706701n4—0.1465247
customer:171500.2706701n4—0.1465247
customer:172000.2706701n4—0.1465247
customer:172510.2706701n4—1.063844
customer:173000.2706701n4—0.1465247
customer:173500.01626794n8—0.0005292919
customer:174000.02702703n3—0.00146092
customer:174500.02702703n3—0.00146092
customer:175010.02702703n3—1.893353
customer:175500.2706701n4—0.1465247
customer:176000.2706701n4—0.1465247
customer:176500.2706701n4—0.1465247
customer:177000.2706701n4—0.1465247
customer:177510.2706701n4—1.063844
customer:178000.2706701n4—0.1465247
customer:178500.01626794n8—0.0005292919
customer:179000.02702703n3—0.00146092
customer:179500.02702703n3—0.00146092
customer:180010.02702703n3—1.893353
customer:180500.2706701n4—0.1465247
customer:181000.2706701n4—0.1465247
customer:181500.2706701n4—0.1465247
customer:182000.2706701n4—0.1465247
customer:182510.2706701n4—1.063844
customer:183000.2706701n4—0.1465247
customer:183500.01626794n8—0.0005292919
customer:184000.02702703n3—0.00146092
customer:184500.02702703n3—0.00146092
customer:185010.02702703n3—1.893353
customer:185500.2706701n4—0.1465247
customer:186000.01626794n8—0.0005292919
customer:186500.2706701n4—0.1465247
customer:187000.2706701n4—0.1465247
customer:187510.01626794n8—1.935458
customer:188000.2706701n4—0.1465247
customer:188500.01626794n8—0.0005292919
customer:189000.2706701n4—0.1465247
customer:189500.02702703n3—0.00146092
customer:190010.01626794n8—1.935458
customer:190500.2706701n4—0.1465247
customer:191000.01626794n8—0.0005292919
customer:191500.2706701n4—0.1465247
customer:192000.2706701n4—0.1465247
customer:192500.01626794n8—0.0005292919
customer:193000.2706701n4—0.1465247
customer:193500.01626794n8—0.0005292919
customer:194000.02702703n3—0.00146092
customer:194500.02702703n3—0.00146092
customer:195010.01626794n8—1.935458
customer:195500.2706701n4—0.1465247
customer:196000.2706701n4—0.1465247
customer:196500.2706701n4—0.1465247
customer:197000.2706701n4—0.1465247
customer:197510.2706701n4—1.063844
customer:198000.2706701n4—0.1465247
customer:198500.01626794n8—0.0005292919
customer:199000.02702703n3—0.00146092
customer:199500.02702703n3—0.00146092
customer:200010.02702703n3—1.893353
customer:200500.2706701n4—0.1465247
customer:201000.2706701n4—0.1465247
customer:201500.2706701n4—0.1465247
customer:202000.2706701n4—0.1465247
customer:202510.2706701n4—1.063844
customer:203000.2706701n4—0.1465247
customer:203500.01626794n8—0.0005292919
customer:204000.02702703n3—0.00146092
customer:204500.02702703n3—0.00146092
customer:205010.02702703n3—1.893353
customer:205500.2706701n4—0.1465247
customer:206000.2706701n4—0.1465247
customer:206500.2706701n4—0.1465247
customer:207000.2706701n4—0.1465247
customer:207510.2706701n4—1.063844
customer:208000.2706701n4—0.1465247
customer:208500.01626794n8—0.0005292919
customer:209000.02702703n3—0.00146092
customer:209500.02702703n3—0.00146092
customer:210010.02702703n3—1.893353
customer:210500.01626794n8—0.0005292919
customer:211000.01626794n8—0.0005292919
customer:211500.01626794n8—0.0005292919
customer:212000.01626794n8—0.0005292919
customer:212500.01626794n8—0.0005292919
customer:213000.01626794n8—0.0005292919
customer:213500.01626794n8—0.0005292919
customer:214000.01626794n8—0.0005292919
customer:214500.01626794n8—0.0005292919
customer:215010.01626794n8—1.935458
customer:215500.01626794n8—0.0005292919
customer:216000.01626794n8—0.0005292919
customer:216500.01626794n8—0.0005292919
customer:217000.01626794n8—0.0005292919
customer:217500.01626794n8—0.0005292919
customer:218000.01626794n8—0.0005292919
customer:218500.01626794n8—0.0005292919
customer:219000.01626794n8—0.0005292919
customer:219500.01626794n8—0.0005292919
customer:220010.01626794n8—1.935458
customer:220500.01626794n8—0.0005292919
customer:221000.01626794n8—0.0005292919
customer:221500.01626794n8—0.0005292919
customer:222000.01626794n8—0.0005292919
customer:222500.01626794n8—0.0005292919
customer:223000.01626794n8—0.0005292919
customer:223500.01626794n8—0.0005292919
customer:224000.01626794n8—0.0005292919
customer:224500.01626794n8—0.0005292919
customer:225010.01626794n8—1.935458
customer:225500.01626794n8—0.0005292919
customer:226000.01626794n8—0.0005292919
customer:226500.01626794n8—0.0005292919
customer:227000.01626794n8—0.0005292919
customer:227500.01626794n8—0.0005292919
customer:228000.01626794n8—0.0005292919
customer:228500.01626794n8—0.0005292919
customer:229000.01626794n8—0.0005292919
customer:229500.01626794n8—0.0005292919
customer:230010.01626794n8—1.935458
customer:230500.01626794n8—0.0005292919
customer:231000.01626794n8—0.0005292919
customer:231500.01626794n8—0.0005292919
customer:232000.01626794n8—0.0005292919
customer:232500.01626794n8—0.0005292919
customer:233000.01626794n8—0.0005292919
customer:233500.01626794n8—0.0005292919
customer:234000.01626794n8—0.0005292919
customer:234500.01626794n8—0.0005292919
customer:235010.01626794n8—1.935458
customer:235500.01626794n8—0.0005292919
customer:236000.01626794n8—0.0005292919
customer:236500.01626794n8—0.0005292919
customer:237000.01626794n8—0.0005292919
customer:237500.01626794n8—0.0005292919
customer:238000.01626794n8—0.0005292919
customer:238500.01626794n8—0.0005292919
customer:239000.01626794n8—0.0005292919
customer:239500.01626794n8—0.0005292919
customer:240010.01626794n8—1.935458
customer:240500.01626794n8—0.0005292919
customer:241000.01626794n8—0.0005292919
customer:241500.01626794n8—0.0005292919
customer:242000.01626794n8—0.0005292919
customer:242510.01626794n8—1.935458
customer:243000.01626794n8—0.0005292919
customer:243500.01626794n8—0.0005292919
customer:244000.01626794n8—0.0005292919
customer:244500.01626794n8—0.0005292919
customer:245010.02702703n3—1.893353
customer:245500.01626794n8—0.0005292919
customer:246000.01626794n8—0.0005292919
customer:246500.01626794n8—0.0005292919
customer:247000.01626794n8—0.0005292919
customer:247500.01626794n8—0.0005292919
customer:248000.01626794n8—0.0005292919
customer:248500.01626794n8—0.0005292919
customer:249000.01626794n8—0.0005292919
customer:249500.01626794n8—0.0005292919
customer:250010.01626794n8—1.935458
customer:250500.01626794n8—0.0005292919
customer:251000.01626794n8—0.0005292919
customer:251500.01626794n8—0.0005292919
customer:252000.01626794n8—0.0005292919
customer:252510.01626794n8—1.935458
customer:253000.01626794n8—0.0005292919
customer:253500.01626794n8—0.0005292919
customer:254000.01626794n8—0.0005292919
customer:254500.01626794n8—0.0005292919
customer:255010.01626794n8—1.935458
customer:255500.01626794n8—0.0005292919
customer:256000.01626794n8—0.0005292919
customer:256500.01626794n8—0.0005292919
customer:257000.01626794n8—0.0005292919
customer:257500.01626794n8—0.0005292919
customer:258000.01626794n8—0.0005292919
customer:258500.01626794n8—0.0005292919
customer:259000.01626794n8—0.0005292919
customer:259500.01626794n8—0.0005292919
customer:260010.01626794n8—1.935458
customer:260500.2706701n4—0.1465247
customer:261000.2706701n4—0.1465247
customer:261500.2706701n4—0.1465247
customer:262000.2706701n4—0.1465247
customer:262510.2706701n4—1.063844
customer:263000.01626794n8—0.0005292919
customer:263500.01626794n8—0.0005292919
customer:264000.2706701n4—0.1465247
customer:264500.01626794n8—0.0005292919
customer:265010.01626794n8—1.935458
customer:265500.01626794n8—0.0005292919
customer:266000.01626794n8—0.0005292919
customer:266500.01626794n8—0.0005292919
customer:267000.01626794n8—0.0005292919
customer:267500.01626794n8—0.0005292919
customer:268000.01626794n8—0.0005292919
customer:268500.01626794n8—0.0005292919
customer:269000.01626794n8—0.0005292919
customer:269500.01626794n8—0.0005292919
customer:270010.01626794n8—1.935458
customer:270500.2706701n4—0.1465247
customer:271000.01626794n8—0.0005292919
customer:271500.2706701n4—0.1465247
customer:272000.2706701n4—0.1465247
customer:272510.01626794n8—1.935458
customer:273000.2706701n4—0.1465247
customer:273500.01626794n8—0.0005292919
customer:274000.02702703n3—0.00146092
customer:274500.02702703n3—0.00146092
customer:275010.01626794n8—1.935458
customer:275500.01626794n8—0.0005292919
customer:276000.01626794n8—0.0005292919
customer:276500.01626794n8—0.0005292919
customer:277000.01626794n8—0.0005292919
customer:277500.01626794n8—0.0005292919
customer:278000.01626794n8—0.0005292919
customer:278500.01626794n8—0.0005292919
customer:279000.01626794n8—0.0005292919
customer:279500.01626794n8—0.0005292919
customer:280010.01626794n8—1.935458
customer:280500.01626794n8—0.0005292919
customer:281000.01626794n8—0.0005292919
customer:281500.01626794n8—0.0005292919
customer:282000.01626794n8—0.0005292919
customer:282500.01626794n8—0.0005292919
customer:283000.01626794n8—0.0005292919
customer:283500.01626794n8—0.0005292919
customer:284000.01626794n8—0.0005292919
customer:284500.01626794n8—0.0005292919
customer:285010.01626794n8—1.935458
customer:285500.2706701n4—0.1465247
customer:286000.01626794n8—0.0005292919
customer:286500.2706701n4—0.1465247
customer:287000.2706701n4—0.1465247
customer:287510.01626794n8—1.935458
customer:288000.2706701n4—0.1465247
customer:288500.01626794n8—0.0005292919
customer:289000.02702703n3—0.00146092
customer:289500.02702703n3—0.00146092
customer:290010.01626794n8—1.935458
customer:290500.01626794n8—0.0005292919
customer:291000.01626794n8—0.0005292919
customer:291500.01626794n8—0.0005292919
customer:292000.01626794n8—0.0005292919
customer:292500.01626794n8—0.0005292919
customer:293000.01626794n8—0.0005292919
customer:293500.01626794n8—0.0005292919
customer:294000.01626794n8—0.0005292919
customer:294500.01626794n8—0.0005292919
customer:295010.01626794n8—1.935458
customer:295500.01626794n8—0.0005292919
customer:296000.01626794n8—0.0005292919
customer:296500.01626794n8—0.0005292919
customer:297000.01626794n8—0.0005292919
customer:297500.01626794n8—0.0005292919
customer:298000.01626794n8—0.0005292919
customer:298500.01626794n8—0.0005292919
customer:299000.01626794n8—0.0005292919
customer:299500.01626794n8—0.0005292919
customer:300010.01626794n8—1.935458
customer:300500.2706701n4—0.1465247
customer:301000.01626794n8—0.0005292919
customer:301500.2706701n4—0.1465247
customer:302000.2706701n4—0.1465247
customer:302510.01626794n8—1.935458
customer:303000.2706701n4—0.1465247
customer:303500.01626794n8—0.0005292919
customer:304000.02702703n3—0.00146092
customer:304500.02702703n3—0.00146092
customer:305010.01626794n8—1.935458
customer:305500.01626794n8—0.0005292919
customer:306000.01626794n8—0.0005292919
customer:306500.01626794n8—0.0005292919
customer:307000.01626794n8—0.0005292919
customer:307500.01626794n8—0.0005292919
customer:308000.01626794n8—0.0005292919
customer:308500.01626794n8—0.0005292919
customer:309000.01626794n8—0.0005292919
customer:309500.01626794n8—0.0005292919
customer:310010.01626794n8—1.935458
customer:310500.01626794n8—0.0005292919
customer:311000.01626794n8—0.0005292919
customer:311500.01626794n8—0.0005292919
customer:312000.01626794n8—0.0005292919
customer:312500.01626794n8—0.0005292919
customer:313000.01626794n8—0.0005292919
customer:313500.01626794n8—0.0005292919
customer:314000.01626794n8—0.0005292919
customer:314500.01626794n8—0.0005292919
customer:315010.01626794n8—1.935458

Verify one row by hand

For the first outer row, p is the leaf proportion for churn. With actual y, two-class Brier is (p−y)²+((1−p)−(1−y))²=2(p−y)². Apply the same definition to every outer row.

Recompute the first outer row
IDyPrediction / pLoss
customer:500.27067010.1465247

Practice, reading and interpretation

Predict what increasing minimum leaf size will do before calculating. Distinguish a manually fixed alpha from one selected by inner validation. If repeated outer-test inspection changes settings, those records are no longer an untouched test.

Public Python uses Fraction arithmetic; the separate base-R program recomputes the full samples, folds and predictions in finite precision. Exact Python arithmetic does not remove measurement error, selection bias or future change. Retained originals were freshly reread for this task; this is not a claim of a new HTTP download.

학부 심화 · 선택Advanced undergraduate · optional

원자료·분할 계보·재현 계약Original data, partition lineage and reproduction

숫자가 진짜 자료에서 왔는지 확인하려면 예측값만으로 부족합니다. 네 공개 CSV 중 세 파일은 국가 네 지표의 원행,NLS52원 필드,UCI14원 필드와 명시한 추가 계보를 보존하고,한 파일은 국가80행의 특징·목표·연도 역할을 파생합니다. 원 필드와 파생 sourceRow·분할 역할을 섞어 원자료를 더 많이 읽었다고 세지 않습니다.

보존 원본의 국가320×10=3200,NLS3613×52=187876,UCI3150×14=44100개 원 필드 값을 대조해 합235176개입니다. 이것은 해당 선택 범위의 확인이며 여기서 새 HTTP 수집을 했다는 뜻은 아닙니다. 원 빈티지·압축 원본 해시·코드북·제공자 정의와 코드10 불일치도 함께 기록합니다.

재현은 원행 선택→특징과 목표 단위→훈련·외부 ID→접힘별 나무와 가지치기→alpha 선택→전체 외부 예측·손실의 연결입니다. 중간 노드·경로·잎 확률·제외 이유와 정확 수치가 내려받는 결과에 남아야 원문 코드를 읽지 않아도 표의 분모를 검산할 수 있습니다. 원 토큰을 소수로 다시 저장해 비교의 동률을 잃지 않습니다.

Predictions alone cannot establish authentic data lineage. Three public CSVs preserve original country-indicator, NLS 52-field and UCI 14-field records with labeled additional lineage; a fourth derives 80 country feature/target/chronology rows. Do not count derived source positions or role columns as newly read native fields.

The retained selections contain 3,200 country,187,876 NLS and 44,100 churn native fields, totaling 235,176. This audit concerns that source scope, not a new HTTP collection. Preserve vintage, original archive hashes, codebooks and the creator/raw code 10 discrepancy.

Reproduction links selection, units, training/outer IDs, fold fitting/pruning, alpha choice and every outer prediction/loss. Retain nodes, routes, leaf probabilities and exclusion reasons so readers can reconstruct denominators. Do not round original tokens before comparisons and silently lose exact ties.

학부 심화 · 선택Advanced undergraduate · optional

Breiman과 CART의 협업을 읽기Breiman and the collaboration behind CART

Leo Breiman의 Berkeley 공식 추모 글은 그가 실제 문제와 자료를 연결하는 통계 작업을 중시했고,CART가 다른 세 연구자와의 공동 작업이었다고 설명합니다. Classification and Regression Trees는 Breiman·Friedman·Olshen·Stone의 공저로 알려진 출발 참고문헌입니다. 이 장은 책의 전 과정을 읽거나 그대로 복제했다는 주장이 아니라 공개한 일부 원리와 실제 계산을 차근차근 유도합니다.

학자의 이름을 외우는 대신 역할을 나누어 질문해 봅시다. 수학자는 손실 최소화·부분나무 비교 범위·동률 증명을,경제학자는 단위·관측 모집단·인과 해석을,경영 담당자는 실제 기록 시점·실패 비용을,학생은 첫 문턱을 손으로 재현할 수 있는지를 확인합니다. 서로 다른 관점이 같은 표에서 다른 빠진 조건을 발견할 수 있습니다.

한 학자의 권위도 코드10의 원 토큰이나 검증 누출을 대신 해결하지 않습니다. 인물 소개의 교육적 목적은 “어떤 문제를 어떤 자료와 원리로 풀었는가?”를 묻는 데 있습니다. 다음 장의 배깅·랜덤 포리스트도 이 장의 불안정성 문제와 연결해 읽되 모든 나무 기법을 한 사람의 단일 알고리즘으로 묶지 않습니다.

Berkeley · Leo Breiman 공식 추모 소개

Berkeley’s official Breiman memorial emphasizes practical statistical work and describes CART as collaboration with three other scholars. The Breiman–Friedman–Olshen–Stone book is a foundational reference. We derive selected principles and declared calculations here without claiming to reproduce or have read its entire treatment.

Assign different review questions: mathematical loss/optimality/ties, economic units/populations/causality, managerial timing/cost, and a student’s ability to reproduce the first split. Different perspectives can expose different missing premises in the same table.

Authority cannot resolve a raw code 10 discrepancy or repair validation leakage. A useful biography asks which problems, data and reasoning motivated the work. Connect later bagging and forests to instability without treating every tree method as one person’s single algorithm.

Berkeley · Official Leo Breiman memorial

학부 심화 · 선택Advanced undergraduate · optional

본문 영상·읽기·검증 질문Embedded videos, readings and check questions

이 장 안의 자료 모음에는 MIT OpenLearningLibrary6.036(2019)의 공식 “Building a tree - greedy algorithm”과 “Regression trees - problem statement” 영상을 넣습니다. 영어 강의를 사이트 안의 재생 버튼으로 보고,지금은 손실과 첫 질문이 어떻게 연결되는지에 집중하세요. 확인하지 않은 강사의 이름이나 정확한 분·초를 만들어 안내하지 않습니다.

보기 전에는 네 회귀 행의 세 후보 문턱과 이득을 적습니다. 보면서 탐욕이라는 말이 전체 최적 탐색과 어디서 다른지 표시하고,본 뒤에는 XOR의 첫 이득0이 왜 이 구현을 멈추게 하는지 설명합니다. 회귀 영상에서는 잎의 평균과 제곱손실 최소화가 어떤 관계인지 앞의 항등식으로 다시 유도해 봅니다.

함께 읽는 공식 scikit-learn 수학 설명에서는 분할 기준과 비용-복잡도 가지치기를 비교합니다. 이 장의 정확 유리수·엄격한 최소 이득·동률·결측 여부 후보는 별도 계약이므로 라이브러리와 모든 결과가 동일하다고 주장하지 않습니다. 영상이 제공자 정책으로 재생되지 않더라도 같은 설명·완전 풀이·공개 코드는 본문에 남습니다.

이 장 안에서 공식 강의 재생·읽기 질문 보기

This chapter’s resources embed official MIT OpenLearningLibrary 6.036(2019) videos “Building a tree - greedy algorithm” and “Regression trees - problem statement.” Use the in-page play buttons for the English lectures, focusing first on loss and the first question. No unverified lecturer identity or precise timestamps are invented.

Before watching, calculate the three candidate thresholds and gains for four regression records. Afterwards explain greedy versus global search and why zero first gain stops our XOR example. Re-derive the leaf mean’s squared-loss identity rather than treating the video as proof by authority.

Compare split criteria and cost-complexity mathematics in official scikit-learn documentation. Our exact arithmetic, strict gain threshold, ties and missing-only candidates have their own contract, not an implementation-identity claim. If provider playback is restricted, the chapter still supplies explanations, complete solutions and public code.

Play official lectures and open guided questions in this chapter

학부 심화 · 선택Advanced undergraduate · optional

세 사례를 끝까지 재현하기Reproduce all three complete cases

실습 F는 실제 국가·개인·기업을 선택해 전체 선언 훈련·접힘·외부 시험을 계산합니다. 먼저 기본 깊이·최소 잎·alpha 후보와 분모를 확인하고,한 번에 한 설정만 바꾸세요. 외부 손실을 본 뒤 좋은 설정만 반복 선택하면 더 이상 독립 최종 시험이 아니라는 점도 결과 옆에 기록합니다.

각 접힘에서 선택된 부분나무와 모든 검증 예측을 펼쳐 어떤 행이 어떤 잎에 갔는지 추적합니다. 선택 alpha를 최종 훈련에 재적합한 뒤 외부 목표를 채점합니다. 실제 분류의 기본 다중 Brier와 원 이미지·웹 그래프·내려받는 표의 관례가 같은지 확인하세요. 소수는 읽기 위한 표시이고 긴 정확값은 필요한 때 펼칩니다.

공개 Python은 Fraction 정확 산술,R은 별도로 구현한 수치 재현으로 원 공개 CSV를 읽습니다. 수치나 동률이 다르면 먼저 ID·단위·분모·후보·경계와 부동소수 비교를 맞추며,근삿값 일치를 정확 원문 바이트 일치라고 부르지 않습니다. 고정 실행 그림은 그 코드의 명시 조건 출력이며 현재 웹 입력을 Python·R 서버로 즉시 실행한 것은 아닙니다.

Lab F runs the declared complete training/fold/outer protocol for an actual source. Inspect default depth, leaf constraints, alpha candidates and denominators, then change one setting at a time. Repeatedly choosing favorable settings from outer loss consumes that exam for model selection.

Expand fold subtrees and every validation route, then trace the final refit and outer scoring. Check that classification tables, web graphics and original figures use the same multiclass-Brier convention. Compact decimals aid reading; full exact values remain disclosed.

Public Python uses exact Fractions and R supplies a separate numerical reproduction from the public CSVs. Investigate differences through IDs, units, denominators, candidates, boundaries and floating-point comparisons. Approximate agreement is not byte identity. Archived figures are outputs for their stated offline settings, not immediate Python/R server execution of current web inputs.

학부 심화 · 선택Advanced undergraduate · optional

숲·배깅과 다음 장으로A bridge to bagging, forests and the next chapter

하나의 나무는 질문과 잎을 읽기 쉽지만 표본 변화에 불안정할 수 있습니다. 다음 장은 여러 훈련 재표본에서 자란 나무를 평균하는 배깅,특징 선택의 무작위성을 더하는 랜덤 포리스트,다음 모형이 이전 오차에 순차적으로 집중하는 부스팅의 목적을 비교합니다. 세 방법을 모두 “나무를 많이 쓰면 좋아진다”로 요약하지 않습니다.

평균을 내면 어떤 변동이 줄어들 수 있는지,나무끼리 상관이 높으면 효과가 왜 제한되는지,복잡도와 정보 누출은 어떻게 남는지를 묻습니다. 단일 나무에서 공개한 훈련·검증·외부 시험의 경계는 모형 수가 많아져도 유지되어야 합니다. 지금의 데이터 역할을 바꾸지 않은 채 새 방법을 비교하는 것이 다음 학습의 출발점입니다.

마지막 과제는 실제 사례 하나의 첫 분할부터 최종 외부 손실까지 설명하는 것입니다. 수학적 정의,작은 예제,원 자료 단위,모든 ID와 한계가 연결되면 이미 하나의 검토 가능한 분석입니다. 이 장은 단일 나무와 가지치기를 계산했으며 아직 숲·부스팅·인과나무를 구현했다고 소개하지 않습니다.

A single tree offers readable questions and leaves but can be unstable. Next compare bagging across resampled training sets, random forests with additional feature randomness, and boosting that sequentially focuses on earlier errors. Their purposes differ; “more trees is always better” is not the lesson.

Ask which variation averaging can reduce, how correlation limits gains, and which complexity and leakage issues remain. Training/validation/outer boundaries survive the addition of many models. Compare new methods without silently changing the data roles.

The capstone traces one actual source from its first split to final outer loss, linking definitions, hand examples, units, IDs and limits. This chapter implements single trees and pruning, not forests, boosting or causal trees.

영상·학자·함께 읽기Videos, thinkers and guided reading

본문의 질문을 넓히는 선택 학습입니다. 영상을 보기 전 질문을 먼저 읽고, 자신의 답을 쓴 뒤 해설과 비교하세요. 자료의 언어·선수 지식은 각 항목에 표시했습니다.Optional extensions to the chapter. Read the question first, write your answer, then compare with the explanation. Language and prerequisites are indicated below.

MIT · 탐욕적으로 나무 만들기MIT · Building a tree with a greedy algorithm

MIT Open Learning Library, Introduction to Machine Learning 6.036

한 단계의 불순도 감소와 전체 나무 탐색을 구분하며 봅니다.Distinguish one-step impurity reduction from searching all trees.

교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.

보고 읽은 뒤 답하기Respond after watching/reading 첫 분할 이득이 0이면 어떤 상호작용을 놓칠까요?Which interactions can a zero-gain first split miss?

생각을 점검하는 해설Check your reasoning

XOR는 첫 이득이 0이어도 깊이 2 규칙으로 완전 분류할 수 있습니다.XOR can be perfectly classified at depth two even though every first gain is zero.

MIT · 회귀나무의 문제 설정MIT · Regression trees, the problem statement

MIT Open Learning Library, Introduction to Machine Learning 6.036

잎 평균과 제곱 오차가 왜 함께 나오는지 확인합니다.Connect leaf means to squared-error minimization.

교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.

보고 읽은 뒤 답하기Respond after watching/reading 왜 중앙값이 아니라 평균인가요?Why the mean rather than the median?

생각을 점검하는 해설Check your reasoning

이 장의 목적은 제곱 손실입니다. 절대 손실이면 중앙값의 역할이 달라집니다.This chapter minimizes squared loss. Under absolute loss the median plays a different role.

Leo Breiman과 CART 공동 연구Leo Breiman and the CART collaboration

UC Berkeley Statistics official memorial

실제 자료 문제와 수학·계산이 함께 발전한 연구를 읽습니다.Read how practical data problems, mathematics and computation developed together.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading CART는 Breiman 혼자 만든 연구인가요?Was CART the work of Breiman alone?

생각을 점검하는 해설Check your reasoning

아닙니다. Breiman·Friedman·Olshen·Stone의 공동 연구로 읽어야 합니다.No. Read it as the collaboration of Breiman, Friedman, Olshen and Stone.

결정나무의 기준·가지치기 문서Tree criteria and pruning documentation

scikit-learn official documentation

이 장의 정확 동률·결측 규칙과 라이브러리 규칙을 따로 비교합니다.Compare this chapter’s exact tie and missing rules with library rules.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 같은 CART 이름이면 결과가 바이트까지 같나요?Does the CART name imply byte-identical results?

생각을 점검하는 해설Check your reasoning

아닙니다. 후보·동률·정밀도·결측 처리와 정규화를 확인합니다.No. Check candidates, ties, precision, missing treatment and normalization.

기간 기대수명의 정의Definition of period life expectancy

World Bank WDI metadata glossary

기간 생명표와 실제 출생 집단의 추적을 구분합니다.Distinguish a period life table from following an actual birth cohort.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 2020년 값은 2020년 출생자를 평생 추적한 결과인가요?Does the 2020 value follow the 2020 birth cohort for life?

생각을 점검하는 해설Check your reasoning

아닙니다. 해당 기간의 사망 패턴을 유지한 가상 생명표 지표입니다.No. It is a hypothetical life-table measure holding that period’s mortality pattern fixed.

UCI 이탈 자료의 원 사전The original UCI churn dictionary

UCI Machine Learning Repository

9개월·12개월·요금 코드 범위를 원행과 대조합니다.Compare the nine-/twelve-month chronology and charge-code range against original rows.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 사전에 0~9인데 원행이 10이면 지워도 될까요?May we delete code ten because metadata says zero to nine?

생각을 점검하는 해설Check your reasoning

먼저 차이를 기록하고 원토큰을 보존합니다. 여기서는 7행을 그대로 둡니다.Record the discrepancy and preserve native tokens first. Here all seven rows remain.

연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof

먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.

1. 경로와 미지의 목표A route without a target

가정 규칙은 X≤5/2이면 3, 아니면 9를 예측한다. 새 X=2,5/2,3의 예측과 문턱에서의 방향을 구하라. 새 Y는 제공되지 않는다.

An assumed rule predicts 3 for X≤5/2 and 9 otherwise. Find predictions for new X=2,5/2,3. No new Y is supplied.

풀이와 확인할 이유Solution and explanation

2와5/2는 ≤ 조건을 만족하므로 각각 3,3이고 3은 오른쪽의 9이다. 경로는 X와 선언한 부등호만으로 결정된다.

이 답은 새 관측의 실제 Y가 3 또는9라고 관측했다는 뜻이 아니다. 잎의 훈련 평균을 적용한 예측이며, 정확한 문턱과의 같음은 왼쪽이라는 약속도 결과의 일부이다.

The predictions are 3,3,9. Equality at 5/2 follows the declared left branch. Only X and the inequality determine routing.

These predictions do not observe the new targets. They apply fitted leaf representatives; the equality convention is part of the reproducible rule.

2. 한 잎의 평균과 손실One leaf’s mean and loss

단위 무게의 Y=[2,4,8,10]에 하나의 수를 예측한다. 평균, SSE, MSE와 각각의 단위를 구하라. Y 단위는 USD/시간이다.

Predict one number for unit-weight Y=[2,4,8,10], measured in USD/hour. Give the mean, SSE, MSE and units.

풀이와 확인할 이유Solution and explanation

합은24, 행 수는4이므로 평균은6 USD/시간이다. 편차 −4,−2,2,4의 제곱 합은16+4+4+16=40이다. MSE는40/4=10이다.

SSE와MSE의 결과 단위는 제곱 시급이다. SSE에는 원 무게의 합산이 들어가고 MSE는 전체 무게로 정규화한다. 10을10달러의 평균 오차라고 읽으면 제곱 단위를 잃는다.

The total is 24 over four rows, giving 6 USD/hour. Squared deviations sum to 16+4+4+16=40; MSE is 40/4=10.

Both loss quantities use squared wage units; SSE sums contributions and MSE normalizes by total mass. Reading MSE 10 as an average ten-dollar error would discard the square.

3. 평균이 최소라는 항등식The mean-minimization identity

앞의 네 Y에서 a=5를 예측할 때 SSE를 구하고 SSE(a)=SSE(평균)+n(a−평균)²로 검산하라.

For the preceding four outcomes predict a=5. Calculate SSE and verify the mean-minimization identity.

풀이와 확인할 이유Solution and explanation

직접 계산은9+1+9+25=44이다. 평균6의SSE40에4(5−6)²=4를 더해도44이다. 평균에서 벗어나 생긴 추가 손실이 음수가 될 수 없다는 구조를 확인한다.

더 일반적으로 중심 편차의 합이0이라 전개한 교차항이 사라진다. 따라서 양의 전체 무게와 제곱손실이라는 전제 아래 평균이 최소이며, 다른 손실에도 무조건 같은 대표값이 최적인 것은 아니다.

Direct computation gives 9+1+9+25=44. Adding 4(5−6)² to the mean’s SSE 40 also gives 44. Moving away from the mean adds nonnegative loss.

The centered deviations sum to zero, removing the expansion’s cross term. Positive total mass and squared loss are the premises; other losses need not share this optimal representative.

4. 같은 평균의 다른 잎Different leaves with the same mean

가정 잎 A의 Y=[1,3], B의 Y=[2,2]는 단위 무게이다. 두 평균과 SSE를 비교하라.

Assumed unit-weight leaves A=[1,3] and B=[2,2] have which means and SSEs?

풀이와 확인할 이유Solution and explanation

평균은 둘 다2이다. A의SSE는(1−2)²+(3−2)²=2이고 B는0이다. 평균 하나가 같아도 잎 안에서 관측이 흩어진 정도는 다르다.

이 비교는 서로 다른 실제 집단의 인과 차이를 추정한 것이 아니라 가정한 목표값의 손실 계산이다. 회귀 불순도를 확인할 때 평균뿐 아니라 유효 무게·SSE와 목표 단위도 함께 기록한다.

Both means are 2. Leaf A has SSE 1+1=2; B has zero. Equal predictions do not imply equal within-leaf variation.

This is loss arithmetic for assumed outcomes, not a causal comparison of real groups. Record eligible mass, SSE and target units alongside the representative.

5. 다수 범주와 확률Majority category and probabilities

단위 무게 A,A,B이고 선언 범주 순서는 [A,B]이다. 경험 확률·다수 범주·Gini와 원 위험 WG를 구하라.

With unit-weight A,A,B and declared vocabulary [A,B], find probabilities, majority, Gini and raw risk WG.

풀이와 확인할 이유Solution and explanation

비율은(2/3,1/3), 다수 범주는A이다. Gini는1−4/9−1/9=4/9, 전체 무게3을 곱한 위험은4/3이다. 범주 한 개를 고른 답과 두 좌표의 확률 벡터를 구분한다.

확률1/3은 이 훈련 잎의 경험 비율이다. 앞으로 실제B가 반드시 세 번 중 한 번 나온다거나 새로운 모집단에서 보정되었다는 주장은 별도의 자료와 검증을 요구한다.

Shares are (2/3,1/3), majority A, Gini 1−4/9−1/9=4/9, and mass-weighted risk 3×4/9=4/3. The class decision differs from the two-coordinate probability vector.

The one-third share describes this training leaf. It does not guarantee exactly one B in every three future cases or calibration in a new population.

6. 세 범주의 균형Three balanced categories

A,B,C가 한 번씩 있다. Gini와 entropy를 쓰고 범주 순서 [B,A,C]에서 다수결 동률의 출력을 구하라.

A,B,C appear once each. Give Gini and entropy, and the majority tie result under vocabulary [B,A,C].

풀이와 확인할 이유Solution and explanation

각 확률은1/3이다. Gini는1−3/9=2/3, 엔트로피는−3(1/3)log₂(1/3)=log₂3≈1.584963 bit이다. 다수결 동률은 선언 순서의 첫 범주B를 고른다.

B를 골랐다고 B확률이 더 큰 것은 아니다. 세 확률은 모두 같다. Gini의2/3과 엔트로피의bit값도 다른 기준이므로 크기만 직접 비교해 기준의 성능을 판단하지 않는다.

Every share is 1/3. Gini is 2/3 and entropy log₂3≈1.584963 bits. The majority tie follows the first declared category, B.

Choosing B does not make its probability larger; all three remain equal. Nor can Gini and entropy be ranked as methods by directly comparing numbers with different definitions and units.

7. 가중 평균의 제곱오차Weighted mean and squared loss

Y=2,w=1과 Y=8,w=3인 가정 잎의 평균·SSE·MSE를 구하라.

Find the mean, SSE and MSE for assumed rows (Y,w)=(2,1),(8,3).

풀이와 확인할 이유Solution and explanation

전체 무게4, 가중 목표합26이므로 평균13/2이다. SSE는1(2−13/2)²+3(8−13/2)²=81/4+27/4=27이다. MSE는27/4이다.

무게를 모두2배 하면 평균과MSE는 같고 SSE는54로2배가 된다. 이 장이 나무 위험을 원 훈련 무게로 나누는 이유와 연결된다. 무게의 목적이 표본추출인지 중요도인지도 따로 밝혀야 한다.

Mass is 4 and weighted response sum 26, giving mean 13/2. SSE is 81/4+27/4=27, and MSE 27/4.

Doubling all weights leaves the mean and MSE unchanged but doubles SSE to 54. This motivates root-mass normalization later; the purpose of those weights still needs a separate explanation.

8. 빈 유효 잎은 완벽한 예측인가Is an empty eligible leaf perfect?

두 행이 (Y=null,w=1),(Y=6,w=0)이다. 감독학습에 쓸 유효 무게, 평균, 빈 합 위험0의 해석을 설명하라.

Rows are (Y=null,w=1),(Y=6,w=0). Explain eligible mass, the mean and a zero empty-sum risk.

풀이와 확인할 이유Solution and explanation

첫 행은 목표 결측, 둘째는 무게0이어서 유효 목표 무게는0이다. 분모가0인 평균은 미정의이며 임의로0을 예측했다고 표시하지 않는다. 원행과 제외 이유는 그대로 남긴다.

빈 가법 합을0이라고 기록하는 것은 관측 예측 오차가 모두0이었다는 증거가 아니다. 이 잎으로 간 검증 관측은 점 예측을 채점할 수 없으며, 모든 검증이 이 상태이면 모형 선택도 불가로 보고한다.

Neither row contributes eligible target mass: one target is missing and the other has zero weight. The mean is undefined, not an invented zero prediction; preserve both exclusion reasons.

Zero for an empty additive sum is not evidence of perfect observed predictions. Such a leaf cannot supply a scored point prediction, and wholly unscoreable validation cannot choose a winning model.

9. 0log0과 서로 다른 불순도Zero log zero and distinct impurities

분포(3/4,1/4)와(1,0)의 Gini·entropy를 쓰고 0log₂0 항의 의미를 설명하라.

Give Gini and entropy for (3/4,1/4) and (1,0), explaining the zero-log-zero term.

풀이와 확인할 이유Solution and explanation

첫 분포의Gini는3/8, 엔트로피는−(3/4)log₂(3/4)−(1/4)log₂(1/4)≈0.811278 bit이다. 둘째는 둘 다0이다. 0log0의 기여0은 연속 확장으로 정의한 것이지 log0을0으로 놓은 계산이 아니다.

첫 엔트로피의 소수는 근사이다. 정확 확률과 로그식을 남기면 어떤 계산을 했는지 추적할 수 있다. 이 장의 학습된 문턱은Gini로 선택하므로 엔트로피 표시가 그 선택 기준을 바꾸지 않는다.

The first distribution has Gini 3/8 and entropy about 0.811278 bits; the second has both zero. The zero contribution uses a continuous extension, not the false assignment log 0=0.

The decimal entropy is approximate. Preserve exact probabilities and the logarithmic expression for reproducibility. Displaying entropy does not change this chapter’s Gini-based split criterion.

10. 시급의 단위 변환Changing wage units

같은 임금을 달러/시간에서 센트/시간으로 바꾼다. 평균·SSE·MSE의 배율과 비교의 조건을 설명하라.

Express the same wages in cents/hour instead of dollars/hour. How do mean, SSE and MSE scale?

풀이와 확인할 이유Solution and explanation

목표값을100배 하므로 평균도100배, 편차 제곱은10000배라 SSE와MSE는10000배이다. 관측과 무게가 같을 때의 계산이며 새 임금 자료를 관측한 것이 아니다.

같은 분할의 상대적 적합 순위는 양의 공통 손실 배수에서 유지되지만, 숫자 alpha와 최소 이득을 그대로 쓰면 정규화 위험 단위가 달라져 같은 복잡도를 고르지 않을 수 있다. 뒤의 가지치기에서는 위험과 alpha 단위도 함께 맞춘다.

Multiplying targets by 100 multiplies the mean by 100 and squared losses by 10,000, with the same observations and weights. This is a unit conversion, not new wage evidence.

A common positive loss multiplier preserves rankings among fixed partitions. Keeping numeric alpha or minimum-gain penalties unchanged can nevertheless select a different complexity because their units must scale too; later pruning makes that dependence explicit.

11. 모든 중간 문턱All midpoint thresholds

단일 특징 X=[1,2,3,4], 결측 없음에서 이 장의 문턱 후보와 X=5/2의 방향을 쓰라.

For one feature X=[1,2,3,4] with no missing values, list candidate thresholds and the route at X=5/2.

풀이와 확인할 이유Solution and explanation

서로 다른 인접 쌍의 중간은3/2,5/2,7/2이다. 선택 문턱이5/2이면 같은 값은≤ 약속에 따라 왼쪽으로 간다.

훈련 간격 안의 임의 문턱은 같은 관측을 나눌 수 있지만, 예를 들어 새 X=2.4에는2.1과2.5가 다른 답을 낸다. 그래서 중간값 대표와 부등호를 함께 공개한다.

The candidates are 3/2,5/2,7/2. At threshold 5/2, equality routes left under ≤.

Different cutpoints inside a training gap can split observed records identically yet route a new X=2.4 differently. This is why representative cutpoints and inequality conventions are part of the contract.

12. 세 후보의 위험 비교Compare all three risks

단위 무게 X=[1,2,3,4],Y=[2,4,8,10],minLeaf=1,최소 잎 무게0이다. 모든 문턱의 자식 SSE와 뿌리 정규화 이득을 구하라.

Use unit-weight X=[1,2,3,4], Y=[2,4,8,10], minLeaf=1 and minimum mass zero. Compute child SSE and normalized gain for every threshold.

풀이와 확인할 이유Solution and explanation

부모 평균6,SSE40이다. 양 끝 문턱에서는 한 행 잎의SSE0과 세 행 잎의SSE56/3을 더해56/3이다. 예를 들어[4,8,10] 평균22/3의 편차 제곱 합은(100+4+64)/9=56/3이다.

가운데는[2,4] 평균3,[8,10] 평균9라 자식SSE합4이다. 이득은각각(40−56/3)/4=16/3, (40−4)/4=9,16/3이다. 모든 후보가 적격이므로 가운데5/2를 선택한다.

Parent SSE is 40 at mean 6. Each endpoint split has a zero-loss singleton and a three-row SSE 56/3; for [4,8,10], squared deviations about 22/3 sum to (100+4+64)/9.

The middle groups have means 3 and 9 and combined SSE 4. Dividing reductions by root mass four gives gains 16/3,9,16/3. All candidates are eligible, so threshold 5/2 wins.

13. 분류의 같은 분할The classification counterpart

단위 무게 X=[1,2,3,4],Y=[0,0,1,1],범주[0,1]이다. 문턱5/2의 부모·자식 원 Gini 위험과 정규화 이득을 구하라.

For unit-weight X=[1,2,3,4], Y=[0,0,1,1] and vocabulary [0,1], compute raw risks and normalized gain at 5/2.

풀이와 확인할 이유Solution and explanation

부모 확률은1/2,1/2이므로Gini1/2,원 위험4×1/2=2이다. 두 자식은각각0만,1만 있어Gini0,원 위험합0이다.

정규화 이득은(2−0)/4=1/2이다. 회귀 예제와 같은 X 분할이지만 목표 손실과 단위는 달라 회귀 이득9보다 작다고 예측 성능이 더 나쁘다는 해석은 하지 않는다.

Parent Gini is 1/2 and raw risk 4×1/2=2. Both children are pure, with combined raw risk zero.

Normalized gain is 2/4=1/2. Although X is partitioned exactly as in the regression example, losses have different definitions and units; comparing 1/2 with regression gain 9 does not rank predictive performance.

14. 자식 크기를 무시한 평균Ignoring child sizes

이전 분류 예제를 문턱3/2로 나눈다. 자식Gini,올바른 정규화 자식 위험과 단순 두 Gini 평균을 비교하라.

Split the preceding classification example at 3/2. Compare child Ginis, correctly normalized child risk and their unweighted average.

풀이와 확인할 이유Solution and explanation

왼쪽[0]은Gini0,오른쪽[0,1,1]은1−1/9−4/9=4/9이다. 올바른 자식 위험은(1×0+3×4/9)/4=1/3이다.

단순 두Gini평균2/9는1행과3행을 같은 크기처럼 취급한다. 부모1/2에서 올바른 이득은1/6이다. 다른 크기 잎을 비교할 때 행 무게가 식에 어디 들어가는지 확인한다.

Left Gini is zero; right Gini for [0,1,1] is 4/9. Correct normalized child risk is (1×0+3×4/9)/4=1/3.

The unweighted average 2/9 treats a one-row and three-row child equally. Correct gain from parent 1/2 is 1/6. Child masses must appear explicitly.

15. 부적격과 나쁜 점수Ineligible versus a bad score

네 유효 행에서 minLeaf=3이면 어떤 이진 분할이 가능한가? 두 유효 행의 뿌리에서 minLeaf=3이면 뿌리 예측도 금지되는가?

Can four eligible rows split when minLeaf=3? Does minLeaf=3 forbid an unsplit root with only two eligible rows?

풀이와 확인할 이유Solution and explanation

어떤 두 자식도 각각3행을 가지려면 최소6행이 필요하므로 네 행에서는 적격 분할이 없다. 이득이작아 탈락한 것과 다른 이유이다.

두 행의 뿌리는 더 나누지 않는 잎으로 남을 수 있다. 이 조건은 새로 만드는 자식의 최소 크기이지 원래 뿌리의 평균 계산을 무조건 금지하는 조건이 아니다. 유효 무게가 양수인지도 별도 확인한다.

Two children of at least three rows require six rows, so no four-row partition is eligible. This differs from losing a comparison on gain.

A two-row root may remain a stump. The condition constrains prospective children rather than forbidding the original root’s representative; positive eligible mass is still required.

16. 중복 특징의 동률Identical-feature ties

두 특징 열이 모두 [1,2,3,4]이고 Y=[2,4,8,10]이다. 두 특징의 최적 이득이 같을 때 고르는 특징과 인과 해석을 쓰라.

Two feature columns both equal [1,2,3,4] with Y=[2,4,8,10]. Which tied best feature is chosen, and what causal claim follows?

풀이와 확인할 이유Solution and explanation

특징 번호 0이 먼저 비교되므로 특징 0의 문턱 5/2를 고른다. 두 열은 같은 분할과 이득 9를 만들어 동률이며, 이 선택은 정해진 순서의 결과이다.

특징 0이 더 중요한 현실 원인이라는 결론은 따르지 않는다. 열 순서를 바꾸면 선택 이름도 바뀔 수 있고, 상관 특징의 중요도가 다른 열로 이동할 수 있다. 같은 정확값의 동률인지도 화면 반올림과 구분한다.

Feature zero is inspected first, so its threshold 5/2 is retained. Both columns generate identical partitions and gain 9; the name follows the declared order.

No greater causal importance follows. Reordering duplicate columns can change the selected name, and correlated features can substitute for one another. Distinguish exact ties from rounded displays.

17. 동일 X를 쪼갤 수 있나Can identical X values be separated?

X=[1,1,2], Y=[0,1,1], 단위 무게와 범주 [0,1]에서 값 문턱 후보와 왼쪽 범주 확률을 구하라.

For unit-weight X=[1,1,2], Y=[0,1,1] and vocabulary [0,1], give value thresholds and left-child probabilities.

풀이와 확인할 이유Solution and explanation

서로 다른 값 1과 2 사이 중간 3/2만 후보이다. 같은 X=1인 두 행을 함께 왼쪽으로 보내므로 왼쪽 비율은 (1/2,1/2)이고 완전히 순수하지 않다.

원행 순서를 이용해 첫 번째 1만 따로 보내는 것은 이 수치 문턱 규칙이 아니다. 같은 특징 관측에서 다른 목표가 나오는 현상도 자료의 일부이며, 더 깊이 나눈다고 그 특징 하나로 반드시 구별할 수 있는 것은 아니다.

Only midpoint 3/2 exists between distinct values 1 and 2. Both X=1 rows go left, yielding probabilities (1/2,1/2), not a pure leaf.

Using source order to separate those identical feature values would be a different rule. Different targets at the same X are part of the data; additional depth in that feature alone cannot necessarily distinguish them.

18. 결측을 보내는 방향Routing missing values

X=[1,null,3], Y=[0,1,1], 단위 무게, 범주 [0,1], minLeaf=1이다. 문턱 2의 결측 왼쪽·오른쪽 및 결측 여부 분할의 자식 원 위험을 구하라.

With X=[1,null,3], Y=[0,1,1], unit weights, vocabulary [0,1] and minLeaf=1, compare threshold-2 missing-left/right and missing-only raw risks.

풀이와 확인할 이유Solution and explanation

결측 왼쪽은 [0,1]과 [1]로 자식 위험 2×1/2+0=1이다. 결측 오른쪽은 [0]과 [1,1]로 원 위험 0이다. 결측 여부는 [1]과 [0,1]로 원 위험 1이다.

부모 Gini는 4/9, 원 위험 4/3이므로 결측 오른쪽 정규화 이득은 (4/3)/3=4/9이다. 훈련에서 계산한 목표 손실을 비교한 결정이며, 결측을 항상 오른쪽으로 보내야 한다는 일반 법칙은 아니다.

Missing-left gives [0,1] and [1], raw child risk one. Missing-right gives pure groups and zero. Missing-only gives [1] and [0,1], again one.

Parent Gini is 4/9 and raw risk 4/3, so missing-right normalized gain is 4/9. This training loss comparison is not a general law that all missing values should route right.

19. 행 수와 무게의 별도 제한Separate count and mass constraints

한 자식에 두 유효 행, 각 무게 1/100이 있다. minLeaf=2, minLeafWeight=1을 충족하는가? 무게 100인 한 행이면?

A child has two eligible rows weighted 1/100 each. Does it satisfy minLeaf=2 and minLeafWeight=1? What about one row weighted 100?

풀이와 확인할 이유Solution and explanation

두 행은 행 수 조건 2를 충족하지만 총무게 1/50이 1보다 작아 무게 조건에서 탈락한다. 무게 100인 한 행은 무게 조건을 충족하지만 행 수 1이라 탈락한다.

두 제한은 동시에 검사한다. 결측 목표나 무게 0인 원행을 추가해서 유효 행 수를 올려서는 안 된다. 원자료 행 수, 유효 관측 수, 가중 전체 질량을 서로 다른 칸으로 보여 주는 이유이다.

Two rows pass the count minimum but their mass 1/50 fails the mass minimum. One row weighted 100 passes mass but fails count.

Both conditions apply. Missing-target or zero-weight records cannot inflate eligible count; retain original record count, eligible observation count and total mass as separate quantities.

20. 목표의 공통 이동A common target shift

X와 무게는 그대로 두고 네 목표 [2,4,8,10] 모두에 100을 더한다. 잎 평균, SSE, 모든 분할 이득과 예측은 어떻게 바뀌는가?

Keep X and weights fixed and add 100 to every target [2,4,8,10]. What happens to means, SSE, split gains and predictions?

풀이와 확인할 이유Solution and explanation

각 잎의 평균은 100만큼 커진다. 관측과 평균이 같이 100 이동해 편차는 같으므로 SSE와 모든 정규화 이득은 변하지 않는다. 따라서 동일 조건의 결정적 분할 규칙도 같다.

새 예측은 원 예측보다 100 크다. 이것은 목표 단위의 100배 변환과 달리 덧셈 이동이므로 손실이 10000배 되는 문제가 아니다. 정확 산술에서는 이 항등식이 유지되지만 큰 수의 부동소수 상쇄는 별도의 구현 검토 대상이다.

Every leaf mean increases by 100. Outcomes and means shift together, preserving centered residuals, SSE and every normalized gain. The deterministic split choice therefore remains the same under identical constraints.

Predictions increase by 100. This additive shift differs from multiplying units by 100, which would scale squared losses by 10,000. Floating-point cancellation is a separate implementation concern.

21. 두 조건의 잎 영역A two-condition region

가정 나무는 교육연수≤12에서 왼쪽으로 간 뒤, 나이≤25이면 예측5, 아니면8이다. 교육연수10·나이30의 경로와 예측을 쓰라.

An assumed tree goes left for schooling≤12, then predicts 5 for age≤25 and 8 otherwise. Route schooling 10, age 30.

풀이와 확인할 이유Solution and explanation

교육연수10은 첫 조건을 만족해 왼쪽, 나이30은 둘째 조건을 만족하지 않아 그 오른쪽으로 간다. 예측은8이다. 이 잎의 영역은 교육연수≤12이면서 나이>25인 교집합이다.

영역은 두 특징 축과 나란한 조건으로 표현된다. 같은 영역의 실제 임금이 모두8이라고 관측한 것이 아니라 정한 잎의 대표값을 적용한 예측이다. 쓰지 않은 다른 특징도 여전히 남아 있다.

Schooling 10 goes left, then age 30 goes right at the second question, producing 8. The region is the intersection schooling≤12 and age>25.

This is an axis-aligned rule, not an observation that everyone there earns exactly 8. Other unused characteristics and residual variation remain.

22. 고정 단위 변환의 문턱Thresholds under fixed unit conversion

원 GDP 특징의 문턱이15000이다. X′=X/10000으로 변환할 때 문턱과 원 X=14000,16000의 방향을 쓰라.

A GDP feature threshold is 15000. Under X′=X/10000, give the threshold and routes of original X=14000,16000.

풀이와 확인할 이유Solution and explanation

새 문턱은3/2=1.5이다. 14000은1.4라 왼쪽,16000은1.6이라 오른쪽이며 원 단위에서의 방향과 같다. 양의 선형 변환은 중간값과 부등호를 함께 보존한다.

목표와 무게, 적격 조건이 그대로라는 전제의 결과이다. 목표 단위까지 바꾸거나 반올림해 다른 수를 입력한 경우까지 자동으로 같은 나무라고 결론내리지 않는다.

The transformed threshold is 1.5. Values 14000 and 16000 become 1.4 and 1.6 and retain their original sides. Positive affine conversions preserve midpoint placement and inequalities.

This holds with the same targets, weights and eligibility settings. Changing target units or supplying rounded rather than exact feature values requires separate consideration.

23. 단조 변환의 반례A monotone-transformation counterexample

훈련 X=1,9이고 목표는2,10이다. 원 중간값 문턱과 제곱근 특징의 중간값 문턱을 비교하고 새 X=4.5의 예측을 구하라.

Training X=1,9 have targets 2,10. Compare raw midpoint and square-root-feature midpoint, then predict a new X=4.5.

풀이와 확인할 이유Solution and explanation

원 문턱5에서는4.5가 왼쪽이므로2를 예측한다. 제곱근 특징1,3의 문턱은2이며 원 경계로는4이다. 4.5>4이므로 변환 나무는 오른쪽의10을 예측한다.

훈련 두 행의 분할과 잎 대표값은 같지만 새 관측의 답은 다르다. 엄격한 증가 변환은 훈련 순서를 보존하되 빈 구간의 산술 중간값까지 일반적으로 보존하지 않음을 보여 준다.

The raw threshold 5 sends 4.5 left and predicts 2. Square-root values 1 and 3 have threshold 2, equivalent to raw boundary 4; since 4.5>4, that tree predicts 10.

Training partitions and leaf values agree while the new-query prediction differs. Strictly increasing transformations preserve order, but not generally arithmetic midpoints in empty gaps.

24. 깊이와 최대 잎 수Depth and maximum leaves

뿌리 깊이0인 이진 나무에서 최대 깊이0,2,5의 최대 잎 수와 꽉 찬 깊이5의 전체 노드 수를 구하라.

With root depth zero, give maximum leaves at depths 0,2,5 and total nodes in a full depth-five binary tree.

풀이와 확인할 이유Solution and explanation

각 깊이마다 최대 두 자식이 생겨 잎은1,4,32개이다. 꽉 찬 나무의 전체 노드는1+2+4+8+16+32=63개이다. 잎32개와 깊이32는 다른 뜻이다.

이는 최대치이며 순수 목표, 최소 잎 제한, 양의 이득 정지 때문에 실제 나무는 작을 수 있다. 깊이를 허용한 만큼 반드시 자라야 한다는 약속은 아니다.

Maximum leaves are 1,4,32. A full depth-five tree has 1+2+4+8+16+32=63 nodes. Leaf count and depth are different measures.

These are upper bounds; purity, leaf constraints and positive-gain stopping may produce fewer nodes. An allowed depth does not require growth to reach it.

25. 최소 이득에서의 같음Equality at the gain threshold

네 회귀 행의 최적 정규화 이득은9이다. maxDepth=1,minLeaf=1에서 minGain=9와8의 동작을 비교하라.

The four-record regression example has best normalized gain 9. With maxDepth=1 and minLeaf=1, compare minGain 9 and 8.

풀이와 확인할 이유Solution and explanation

이 장은 이득이0보다 크고 minGain보다 엄격하게 커야 한다. 따라서9는 minGain9와 같아 분할하지 않고, minGain8에서는9>8이라 뿌리를 나눈다.

행 수·무게 등 다른 조건도 충족한다고 가정한 비교이다. 화면에서9처럼 반올림된 값이 아니라 정확한 위험 감소와 정확한 입력 기준을 비교한다.

A gain must be positive and strictly greater than minGain. Gain 9 fails at minGain 9 by equality and succeeds at 8.

This assumes other eligibility conditions hold. The comparison uses exact gain and threshold values, not a display rounded to 9.

26. 고정 나무 확장의 훈련 위험Training risk under a fixed-tree extension

부모 잎의 제곱손실 최적 예측을 두 자식으로 확장해 각각 평균을 다시 적합한다. 훈련 SSE가 커질 수 없는 이유와 적용 범위를 설명하라.

Split a squared-loss leaf and refit each child mean. Explain why training SSE cannot increase and what this claim does not establish.

풀이와 확인할 이유Solution and explanation

각 자식에서 부모 예측을 그대로 쓰면 원 SSE를 재현할 수 있다. 자식 평균은 그 상수 후보보다 손실이 크지 않으므로 두 최소 손실의 합도 원 SSE보다 크지 않다.

이 논리는 고정 자료에서 한 나무를 확장하는 훈련 목적함수에 관한 것이다. 새 관측의 목표값을 알 수 없으므로 외부 시험 손실까지 단조롭게 줄어든다는 정리는 아니다. 양의 이득이 없으면 이 장의 알고리즘은 확장하지 않는다.

Both children could retain the parent prediction and reproduce the original SSE. Each child mean minimizes over at least that constant candidate, so their optimal losses sum to no more.

This concerns a fixed-data training objective under extension. It does not imply monotone outer-test improvement. Our algorithm additionally refuses extensions without positive gain.

27. XOR의 첫 질문The first XOR question

네 XOR 행과 단위 무게·범주[0,1]에서 뿌리 Gini와 각 첫 질문의 이득을 계산하라. maxDepth=2,minGain=0이면 이 장은 어디서 멈추는가?

For the four unit-weight XOR records and vocabulary[0,1], compute root Gini and first-split gains. What happens at maxDepth 2,minGain 0?

풀이와 확인할 이유Solution and explanation

뿌리는0과1이 두 개씩 있어 Gini1/2이다. 어느 특징으로 나눠도 두 자식에0과1이 하나씩 있어 정규화 자식 위험도1/2이다. 이득은0이다.

minGain0이라는 말이 이득0을 허용한다는 뜻은 아니다. 엄격한 양의 이득 조건에 따라 뿌리 잎에서 멈춘다. 깊이2 나무로 XOR를 표현할 수 있다는 사실과 이 탐색이 그 나무를 찾는지는 구별한다.

Root Gini is 1/2. Either first feature leaves two balanced children with normalized combined risk 1/2, so gain is zero.

minGain 0 does not permit a zero-gain split: the separate strict positive-gain rule stops at the root. A depth-two tree can represent XOR without this search necessarily discovering it.

28. 작은 X 변화와 큰 예측 변화A small feature move and a prediction jump

고정 규칙은 X≤5/2에서3, 아니면9이다. X=5/2−1/1000000과5/2+1/1000000의 예측 차이를 구하라.

A fixed rule predicts 3 for X≤5/2 and 9 otherwise. Compare predictions at 5/2−1/1000000 and 5/2+1/1000000.

풀이와 확인할 이유Solution and explanation

입력 차이는2/1000000이지만 예측은3과9라 차이는6이다. 문턱 근처에서 규칙이 불연속이어서 생긴 결과이며 정확한 입력 비교에서 반올림 오류가 없어도 나타난다.

이 예만으로 전체 모집단의 위험이 크다고 계산한 것은 아니다. 문턱 근처에 실제 관측이 얼마나 있는지와 목표 분포도 중요하다. 개별 경로의 민감성과 평균 예측 성능은 다른 평가이다.

Inputs differ by 2/1000000, while predictions 3 and 9 differ by 6. The rule is discontinuous at the threshold even with exact comparisons.

This alone does not quantify population risk. The prevalence of observations near the boundary and their target law also matter. Route sensitivity and average predictive performance are distinct assessments.

29. 훈련 범위 밖의 나무A tree outside its training range

훈련 X=[1,2,3,4]에서 깊이1의 규칙이 문턱5/2와 예측3,9를 가진다. 새 X=−100,100은 무엇을 받으며 어떤 외삽 주장은 할 수 없는가?

A depth-one tree trained on X=[1,2,3,4] has threshold 5/2 and predictions 3,9. Predict new X=−100,100 and discuss extrapolation.

풀이와 확인할 이유Solution and explanation

−100은 왼쪽의3,100은 오른쪽의9이다. 기존 질문을 계속 적용하므로 훈련 범위 밖에서도 각 끝 잎의 상수 예측을 내며 직선 기울기를 연장하지 않는다.

실제 새 목표가 그 상수에 가깝다는 보장은 없다. 원 범위와 다른 집단·경제 환경이면 자료 지지 범위 밖이라는 한계를 함께 밝혀야 한다. 계산 가능한 값과 신뢰할 수 있는 예측은 같지 않다.

The predictions are 3 and 9, obtained by applying existing questions. The tree uses endpoint leaf constants rather than extending a fitted linear slope.

Nothing guarantees new targets are near those constants. A different feature range, population or economic environment is an extrapolation limitation despite the rule returning a number.

30. 가지치기의 비교 범위The comparison domain of pruning

XOR에서 탐욕 성장 결과가 뿌리 하나라고 하자. 정규화 위험은1/2이다. alpha=1/10에서 이 뿌리와 가능한 순수 네 잎 나무의 R+alpha×잎 수를 비교하고 가지치기의 한계를 설명하라.

Greedy XOR growth returns a stump of risk 1/2. At alpha 1/10 compare its cost-complexity objective with a possible pure four-leaf tree. What can pruning do?

풀이와 확인할 이유Solution and explanation

뿌리는1/2+1/10=3/5, 순수 네 잎은0+4/10=2/5이므로 가능한 전체 나무 중에는 더 좋은 규칙이 있다. 그러나 자란 뿌리의 부분나무는 뿌리 자신뿐이다.

가지치기가 그 범위에서 뿌리를 반환하는 것은 부분나무 최적성에 어긋나지 않는다. 처음부터 없었던 두 단계 질문을 추가하는 탐색은 수행하지 않으며, 모든 가능한 나무의 전역 최적성이라고 결론내릴 수 없다.

The stump costs 1/2+1/10=3/5; the pure four-leaf tree costs 2/5. A better tree exists globally, but the grown stump has only itself as a rooted subtree.

Returning it therefore does not violate fixed-grown-tree subtree optimality. Pruning cannot add the missing two-level questions and makes no global claim over all possible trees.

31. 세 나무의 목적값Objectives for three subtrees

위험·잎 수가 각각 (0,4),(1,2),(10,1)인 고정 부분나무를 alpha=1/4,1,10에서 비교하라.

Compare fixed subtrees with (risk,leaves)=(0,4),(1,2),(10,1) at alpha 1/4,1,10.

풀이와 확인할 이유Solution and explanation

alpha1/4에서는1,3/2,41/4라 네 잎,alpha1에서는4,3,11이라 두 잎,alpha10에서는40,21,20이라 한 잎이 최소이다. 각각 위험에 alpha×잎 수를 더한다.

작은 alpha는 훈련 적합을 상대적으로 더 중요하게,큰 alpha는 질문을 줄이는 것을 더 중요하게 본다. 이는 같은 큰 나무의 부분나무 비교이며 검증 손실 자체를 최소화한 계산은 아니다.

Costs are(1,3/2,41/4), then(4,3,11), then(40,21,20). The winners have four, two and one leaves respectively.

Alpha prices complexity against training fit within the fixed subtree set. These calculations do not themselves optimize validation performance.

32. 아래 가지의 유효 alphaEffective alpha of a bottom branch

원 뿌리 무게4,아래 노드 원 SSE2,그 아래 두 순수 잎 위험0이다. 이 가지의 유효 alpha를 구하라.

Root mass is 4; a bottom node has raw SSE 2 and two pure descendant leaves. Find its effective alpha.

풀이와 확인할 이유Solution and explanation

노드의 정규화 위험은2/4=1/2이고 아래 잎 위험은0이다. 잎 수 감소가2−1=1이므로 유효 alpha는1/2이다.

노드 자기 무게2로 나누어1이라고 계산하면 전체 목적함수와 다른 정규화가 된다. 모든 가지에서 같은 뿌리 무게를 써야 위험 증가와 잎 감소를 한 기준으로 비교할 수 있다.

Collapsed node risk is 2/4=1/2, descendant risk zero, and one leaf is removed. Effective alpha is therefore 1/2.

Dividing by the node’s own mass 2 would incorrectly produce 1. All branch comparisons must retain original-root normalization.

33. 가지치기 뒤 다시 계산Recalculate after pruning

처음 뿌리 위험10·네 순수 잎 위험0이다. 두 아래 가지를 줄여 잎2개·위험1이 되었다. 뿌리의 이전·이후 유효 alpha를 구하라.

Root risk is 10 and the original four leaves have zero risk. After bottom pruning, two leaves have combined risk 1. Find old/new root effective alphas.

풀이와 확인할 이유Solution and explanation

처음은(10−0)/(4−1)=10/3이다. 이후는(10−1)/(2−1)=9이다. 남은 잎 수와 가지 위험이 바뀌어 같은 뿌리에서도 유효 alpha가 달라진다.

초기 alpha 목록을 한 번 정렬한 뒤 그대로 사용하는 절차가 아니라 각 단계의 현재 나무에서 다시 계산해야 한다. 원 수치와 전체 목적값의 교차 검산도 함께 한다.

Initially it is 10/3; afterwards it is 9. Both descendant risk and removed-leaf count changed.

Weakest-link pruning must recalculate on the current tree rather than sorting initial alphas once. Check the resulting transition against full objective values.

34. 동시 동률과 세 잎Simultaneous ties and three leaves

네 잎 위험0,한 아래 가지만 줄인 세 잎 위험1/2,둘 다 줄인 두 잎 위험1이다. alpha=1/2에서 목적값과 이 장의 선택을 구하라.

Four leaves have risk 0, three leaves risk 1/2, and two leaves risk 1. Compare at alpha 1/2 and state the canonical choice.

풀이와 확인할 이유Solution and explanation

목적값은0+4/2=2,1/2+3/2=2,1+2/2=2로 모두 같다. 이 장은 같은 약한 고리를 동시에 줄이고 문턱에서 작은 나무를 골라 두 잎을 선택한다.

세 잎도 그 문턱의 최적 구조일 수 있지만 전체 경로에 반드시 별도 단계로 있어야 하는 것은 아니다. 선택한 대표 경로와 모든 동률 최적 구조의 목록을 구분한다.

All three objectives equal 2. Simultaneous weakest-link collapse and the smaller-tree equality convention select two leaves.

A three-leaf structure can also be optimal at that breakpoint without appearing as a separate canonical path step. Distinguish a representative selection path from every tied optimum.

35. 고정 큰 나무의 부분나무 수Count subtrees of a fixed grown tree

뿌리와 두 내부 자식,그 아래 네 잎인 꽉 찬 깊이2 나무의 뿌리 부분나무가 몇 개인지 세라.

Count rooted subtrees of a full fixed depth-two tree with two internal children and four leaves.

풀이와 확인할 이유Solution and explanation

뿌리를 잎으로 바꾸는 경우1개가 있다. 뿌리를 유지하면 각 자식을 잎으로 바꾸거나 원 두 잎을 유지하는2가지 선택이 독립적으로 있어2×2=4개이다. 합5개이다.

잎 수는1,2,3,3,4이며 세 잎 두 구조는 어느 아래 가지를 남겼는지가 다르다. 고정 큰 나무 밖의 새 특징·문턱까지 세는 전체 나무 탐색과는 다른 집합이다.

There is one collapsed-root tree. Retaining the root leaves two choices for each child: collapse or retain its pair, giving 2×2=4. Total:five.

Leaf counts are 1,2,3,3,4; the two three-leaf trees retain different branches. This is not a count of all feature/threshold trees outside the fixed grown structure.

36. alpha의 목표 단위Target units of alpha

회귀 손실을 달러/시간의 제곱에서 센트/시간의 제곱으로 바꾼다. 원 alpha=1/2와 동등한 가지치기 비용은?

Convert regression loss from squared dollars/hour to squared cents/hour. What alpha is equivalent to 1/2?

풀이와 확인할 이유Solution and explanation

목표100배에서 손실은10000배이므로 alpha도10000배해5000으로 맞춘다. 같은 후보 부분나무의 전체 목적값이10000배가 되어 선택이 유지된다.

목표와 무게·분할의 다른 조건이 같다는 전제이다. 단지 검증 손실의 보고 열만 바꾼 경우와 훈련 위험의 단위까지 바꾸는 경우는 다르므로 어떤 정의를 변경했는지 기록한다.

Squared loss scales by 10,000, so alpha 1/2 becomes 5000. Every fixed-subtree objective receives the same positive multiplier, preserving its minimizer.

This concerns changing training-risk units, not merely relabeling a validation-report column. State exactly which criterion changed and retain other conditions.

37. 무게 배율과 최소 질량Weight scaling and minimum mass

모든 무게를3배 한다. 같은 훈련 분할에서 정규화 위험과 alpha는 어떻게 되는가? minLeafWeight가1이었다면 동등한 적격성을 위해 얼마로 바꾸는가?

Triple all weights. For the same partitions, what happens to normalized risk and alpha? How should minLeafWeight 1 change to preserve eligibility?

풀이와 확인할 이유Solution and explanation

원 위험과 뿌리 무게가 모두3배여서 정규화 위험은 그대로이고 같은 alpha를 쓸 수 있다. 평균과 범주 확률도 변하지 않는다.

최소 잎 무게는3으로 바꾸어야 질량에 대한 같은 조건이다.1을 그대로 두면 이전에 탈락하던 작은 질량 자식이 허용될 수 있어 같은 큰 나무라는 전제가 깨진다.

Raw risk and root mass both triple, leaving normalized risk and the corresponding alpha unchanged. Means and probabilities also remain unchanged.

Scale the mass minimum to 3. Keeping it at 1 may admit previously forbidden children, changing the grown tree and invalidating the same-partitions premise.

38. 다중 Brier의 두 배The factor of two in Brier

범주[0,1],예측(3/4,1/4),실제1이다. 다중 Brier와 양성 범주 하나의 Brier,다수결0/1 오차를 구하라.

Vocabulary is[0,1], prediction(3/4,1/4), actual 1. Compute multiclass Brier, positive-only Brier and majority 0/1 error.

풀이와 확인할 이유Solution and explanation

실제 벡터는(0,1)이라 다중 Brier는(3/4)²+(−3/4)²=9/8이다. 양성 좌표만 쓰면9/16으로 절반이며,다수결은0을 골라0/1 오차는1이다.

세 수는 각각 다른 손실 정의이다.9/8이1보다 크다고 오류인 것은 아니다. 다중 Brier는 최대2까지 가능하고 어느 관례인지 표에 명시해야 한다.

The one-hot target is(0,1), so multiclass Brier is 9/8. Positive-coordinate-only Brier is 9/16; majority chooses 0 and incurs 0/1 loss 1.

These are different definitions. A multiclass Brier above 1 is valid because its maximum is 2. State the reporting convention explicitly.

39. 훈련 Gini와 평균 BrierTraining Gini equals average Brier

원 잎은0,0,0,1이고 그 경험 비율(3/4,1/4)을 각 행에 예측한다. 평균 다중 Brier가 Gini와 같은지 계산하라.

Predict empirical shares(3/4,1/4) for each training row 0,0,0,1. Check mean multiclass Brier against Gini.

풀이와 확인할 이유Solution and explanation

실제0인 각 행은1/8,실제1은9/8 손실이다. 평균은(3×1/8+9/8)/4=3/8이다. Gini도1−9/16−1/16=3/8로 같다.

이 등식은 같은 잎의 경험 비율과 훈련 범주 구성으로 계산한 것이다. 새 모집단의 비율이 달라져도 똑같은 손실이 보장되거나 경험 확률이 보정되었다는 뜻은 아니다.

Each zero incurs 1/8 and the one incurs 9/8, averaging 3/8. Gini is also 1−9/16−1/16=3/8.

The equality uses this leaf’s own empirical probabilities and training composition. It does not guarantee the same future loss or calibration under a different population.

40. 다수결 오류가 같은 확률 예측Different probabilities, equal classification error

범주 순서[0,1],실제1일 때 qA=(1,0),qB=(1/2,1/2)를 비교하라. 동률 다수결은0이다.

With vocabulary[0,1] and actual 1, compare qA=(1,0), qB=(1/2,1/2). Majority ties choose 0.

풀이와 확인할 이유Solution and explanation

두 다수결은 모두0을 골라0/1 오차1이다. 다중 Brier는A가1²+(−1)²=2,B가(1/2)²+(−1/2)²=1/2라 다르다. 확신하며 틀린 예측에 확률 손실이 더 큰 벌점을 준다.

한 관측의 결과만으로 어느 확률이 전체적으로 보정되었는지 결론내릴 수는 없다. 다수결 정확도와 확률 손실을 다른 열로 읽고 같은 관측 프레임에서 비교해야 한다.

Both majority decisions are 0 and incur classification loss 1. Their multiclass Briers are 2 and 1/2: confident error receives a larger probability penalty.

A single outcome does not establish which forecast is calibrated overall. Compare classification accuracy and probability loss separately on matching observation frames.

41. 한 번 적합한 나무로 CV인가Can one prefit tree supply CV?

전체 목표로 나무를 한 번 맞춘 뒤 각 검증 접힘 행만 출력에서 가렸다. 무엇이 누출되며 어떻게 고쳐야 하는가?

A tree was fitted once to all targets, then validation rows were hidden from each displayed fold. Identify leakage and the correction.

풀이와 확인할 이유Solution and explanation

문턱·특징 선택과 잎 목표 통계가 이미 검증 목표를 읽었다. 출력 행을 숨겨도 그 결정에 들어간 정보는 사라지지 않는다.

각 접힘의 훈련 ID만으로 큰 나무·확률·가지치기 경로를 새 적합하고,검증 특징으로 예측한 뒤 목표를 채점에만 사용한다. 최종 재적합과 외부 시험도 별도로 남긴다.

Threshold selection and leaf target statistics already consulted validation labels; hiding output rows cannot remove their influence.

Refit growth, probabilities and pruning within each training fold, predict validation features, then score targets. Final refitting and the outer exam remain separate.

42. 합친 MSE와 접힘 평균Pooled MSE versus mean fold MSE

단위 무게의 접힘 A는 검증1개·MSE1,접힘 B는9개·MSE9이다. 합친 MSE와 접힘 MSE 단순 평균을 구하라.

Unit-weight fold A has one validation record and MSE 1; B has nine records and MSE 9. Compare pooled MSE and the simple fold average.

풀이와 확인할 이유Solution and explanation

전체 제곱오차 합은1×1+9×9=82,관측 수는10이므로 합친 MSE는41/5=8.2이다. 접힘 평균은(1+9)/2=5이다.

두 값은 분모와 무게가 다르다. 이 장은 채점 가능한 예측의 전체 무게로 합친 주 손실을 사용하므로8.2를 선택 기준에 넣는다. 접힘별 점수도 숨기지 않고 다른 열로 남긴다.

Pooled squared loss is 82 over ten records, giving 8.2. Averaging the two fold means instead gives 5.

The weighting schemes answer different questions. Our primary score pools scoreable prediction mass; fold-specific scores remain separately available.

43. 같은 검증 ID가 두 번 등장하면Repeated validation IDs across folds

서로 다른 두 접힘에서 같은 ID를 각각 한 번 평가했다. 이 장의 합친 분모와 독립 관측 수를 어떻게 해석하는가?

The same ID is tested once in each of two different folds. How should pooled denominator and independent observation count be interpreted?

풀이와 확인할 이유Solution and explanation

명시한 두 예측 사건은 각 접힘의 적합에서 나온 결과이므로 손실과 무게가 두 번 기여한다. 고유 검증 ID 수는1이며 독립 사람이2명이 된 것은 아니다.

한 접힘 내부에서 같은 ID를 중복 나열하거나 훈련·검증에 함께 쓰는 경우와 구분한다. 독립성이나 추론의 표본 수는 반복 구조를 고려해 별도로 판단해야 한다.

Both explicitly declared prediction events contribute loss and weight, but the unique validation-ID count is one, not two independent people.

This differs from duplicate IDs within a fold or train/test overlap, which are rejected. Dependence and inferential sample size need separate treatment.

44. alpha 동률 뒤의 최종 적합Alpha ties and final refitting

후보 alpha0,1,2의 정확 합친 검증 손실이 모두4이다. 무엇을 선택하고 어떤 자료로 최종 나무를 만드는가?

Alphas 0,1,2 all have exact pooled loss 4. Which is selected, and on which data is the final tree fitted?

풀이와 확인할 이유Solution and explanation

동률에서는 더 큰 alpha2를 선택한다. 같은 나무에서 더 큰 alpha가 가지를 다시 늘리는 것은 아니지만 이 값에서 잎 수가 반드시 엄격히 줄어야 하는 것은 아니다.

이후 선언한 최종 훈련 ID 전체로 큰 나무와 경로를 새로 맞추고 alpha2를 적용한다. 외부 시험은 넣지 않으며 어느 접힘의 나무 하나를 그대로 최종 모형으로 복사하지 않는다.

Select the larger tied alpha 2. Larger alpha does not regrow a fixed tree, though its leaf count need not strictly decrease at every candidate.

Refit a fresh grown tree/path on declared final training IDs and apply 2. Exclude the outer test; do not copy one fold’s model as the final estimator.

45. 모두 미정의인 검증Wholly undefined validation

모든 검증 목표가 null이거나 무게0이라 어떤 alpha에도 채점 가능한 양의 무게가 없다. 선택 결과는?

All validation targets are missing or zero-weight, leaving no scoreable positive mass for any alpha. What is selected?

풀이와 확인할 이유Solution and explanation

주 검증 손실은 미정의이고 선택 alpha와 최종 선택 모형도 미정의이다. 분모0을 손실0으로 바꾸거나 첫 후보를 자동 우승자로 쓰지 않는다.

채점 불가 이유와 원 ID·무게를 보존해 자료 문제를 설명한다. 이것은 미래 오차가0이라는 증거가 아니며,유효한 검증 계획이나 추가 관측이 필요하다.

Primary losses, selected alpha and selected final model remain undefined. Do not replace a zero denominator by zero loss or pick the first candidate as a winner.

Preserve IDs, weights and unscoreability reasons. The result supplies no evidence of perfect prediction; a valid evaluation frame requires additional information or observations.

46. 두 접힘 손계산Two-fold validation by hand

실습 E의 여섯 행과 두 접힘에서 alpha0,1,10의 첫 접힘 예측은 각각7,6,4이며 검증 실제는9,11이다. 둘째는 대칭이다. 합친 MSE와 선택을 구하라.

In Lab E, first-fold predictions for alphas 0,1,10 are 7,6,4 with actuals 9,11; the second fold is symmetric. Compute pooled MSEs and selection.

풀이와 확인할 이유Solution and explanation

첫 제곱오차 합은20,34,74이다. 대칭인 둘째를 더해40,68,148을 검증4개로 나누면10,17,37이다. 따라서 alpha0을 선택한다.

이는 명시한 두 접힘의 작은 비교이며 단순한 선형 원함수를 나무가 항상 잘 외삽한다는 결론은 아니다. 두 검증 구간이 훈련 X 범위 밖에 있음을 함께 설명한다.

First-fold SSEs are 20,34,74. Doubling and dividing by four validation events gives 10,17,37, selecting alpha 0.

This result belongs to the declared small protocol, not a guarantee that trees extrapolate a linear rule. Both fold tests deliberately lie outside their training feature ranges.

47. 최종 적합과 검증의 다른 오차Final fit versus validation error

실습 E에서 선택 alpha0,최대 깊이2로 여섯 행 전체를 재적합하면 잎 예측1,4,7,10이다. 훈련 MSE를 구하고 검증10과 비교하라.

After selecting alpha 0, refit all six Lab E rows at depth two, obtaining leaf values 1,4,7,10. Compute training MSE and compare with validation 10.

풀이와 확인할 이유Solution and explanation

X=1은1,X=2,3은4,X=4는7,X=5,6은10을 받는다. 오차 제곱은0,1,1,0,1,1이므로 SSE4,MSE4/6=2/3이다.

검증10은 각 접힘에서 제외했던 관측을 별도 적합 나무로 평가한 값이다. 최종 훈련2/3은 더 많은 행을 보고 적합한 오차이므로 두 값이 같아야 한다는 요구는 없다.

Predictions yield squared errors 0,1,1,0,1,1. SSE is 4 and training MSE 2/3.

Validation 10 used fold-excluded observations and different fitted trees; final training 2/3 used all declared training rows. The two quantities need not coincide.

48. 관측 비율0은 확률0인가Does empirical zero prove zero probability?

실제 Bernoulli 이탈 확률이1/10인 두 독립 가정 관측에서 이탈을 한 번도 보지 못할 확률을 구하라. 경험 비율0의 한계를 설명하라.

Two assumed independent churn observations have true probability 1/10 each. Find the chance of no churn and interpret empirical zero.

풀이와 확인할 이유Solution and explanation

비이탈 확률9/10을 두 번 곱해81/100이다. 실제 확률이 양수여도 작은 표본에서 이탈0개는 충분히 가능하다.

따라서 잎 경험 비율0이 미래 사건의 불가능성을 입증하지 않는다. 이 계산의 독립·고정 확률은 가정이며 실제 고객 자료에 자동 적용된 조건도 아니다.

The probability is(9/10)²=81/100. Zero observed events are compatible with a positive true event probability.

Empirical zero therefore does not establish impossibility. Independence and constant probability here are assumed teaching conditions, not automatically verified properties of real customers.

49. 중복 열의 중요도Importance with duplicate columns

완전히 같은 두 특징 중 특징0만 질문에 쓰여 전체 뿌리 정규화 위험을10 줄였다. 두 중요도와 열0을 원인이라 할 수 없는 이유를 쓰라.

Two identical features exist, but only feature 0 is used, reducing normalized risk by 10. State their importances and the causal limit.

풀이와 확인할 이유Solution and explanation

감소 중요도는 특징0이10,특징1이0이며 총감소10에 대한 비율은1과0이다. 같은 정보라도 동률에서 먼저 고른 이름이 감소를 가져간다.

열 순서를 바꾸면 이름이 바뀔 수 있다.0인 열에 정보가 없다는 결론이나10인 열이 현실의 인과 기여10이라는 결론은 따르지 않는다. 선택한 나무의 훈련 적합 계보이다.

Impurity decreases are 10 and 0, or shares 1 and 0. Duplicate information receives different attribution because the tie rule chose one name.

Reordering columns can swap attribution. Neither absence of information nor a causal contribution of 10 follows from this fitted-tree training measure.

50. 고정 깊이가 보장하지 않는 것What fixed depth cannot guarantee

한 특징의33개 연속 구간에서 목표가0,1로 번갈아 바뀌는 함수를 생각하라. 최대32잎인 고정 모형을 표본 증가만으로 모든 함수에 보편 일치한다고 할 수 있는가?

Consider a one-feature target alternating 0,1 across 33 successive nonempty intervals. Does a fixed at-most 32-leaf class become universally consistent merely by adding observations?

풀이와 확인할 이유Solution and explanation

각 구간을 그대로 상수로 표현하려면33개의 연속 잎 영역이 필요하지만32잎 제한은 그 표현을 모두 허용하지 않는다. 표본이 늘어도 이 고정 표현 집합 자체가 자동으로 커지지는 않는다.

모집단의 구간별 양의 확률,손실·적률과 적응 선택 조건을 더 명시해야 하며,일반적인 일치성에는 근사 능력과 표본 변동의 균형이 필요하다. 깊이 제한과 CV 선택만으로 모든 함수에 대한 정리를 주장하지 않는다.

Exact interval-by-interval representation needs 33 constant regions, beyond the 32-leaf class. More observations do not automatically enlarge that fixed representation set.

A formal claim also needs interval probabilities, loss/moment assumptions and adaptive-selection conditions. Approximation and sampling error must be balanced; fixed depth plus CV alone is not a universal-consistency theorem.

51. 실제 국가 행과 지표 행Country positions versus indicator rows

16개국·5년·4지표를 보존했다. 국가-연도 자리와 지표 원행 수를 구하고 AUS:2020 기대수명83.2년의 대상을 설명하라.

Retain 16 countries, five years and four indicators. Count country-year positions and indicator rows, and interpret AUS:2020 life expectancy 83.2 years.

풀이와 확인할 이유Solution and explanation

국가-연도는16×5=80자리,지표 원행은80×4=320행이다.320개 나라나320명의 수명을 관측한 것이 아니다.

83.2년은 그 시점 사망 양상을 유지한다는 조건의 출생 시 기간 기대수명 지표이다. 한 개인의 실제 수명 또는 앞으로 의료 변화까지 예언한 값으로 해석하지 않는다.

There are 80 country-year positions and 320 indicator rows, not 320 countries or individual lifespans.

The 83.2-year value is period life expectancy under prevailing mortality patterns, not an observed individual lifespan or a forecast incorporating future medical change.

52. 국가의 시간 경계Country time boundaries

2020~2024 각16행이다. 마지막 해를 시험으로 두고 앞의 세 rolling 검증을 만든다. 최종 훈련·외부·내부 검증 사건 수와 해석을 쓰라.

Each year 2020–2024 has 16 records. Hold out the last year and use the three stated rolling folds. Give final training, outer and inner validation-event counts.

풀이와 확인할 이유Solution and explanation

최종 훈련64,외부16행이다. 검증 연도2021,2022,2023에 각16행이 있어 내부 검증48사건이다. 그 훈련 크기는16,32,48로 늘어난다.

같은 나라가 반복되므로48개의 독립된 나라가 된 것은 아니다. 같은 해 거시 특징은 사후 제공되었고 보존 빈티지이므로 실제 당시 정보만 쓴 운영 예측의 증거로 확대하지 않는다.

Final training has 64 rows, outer testing 16 and inner validation 48 events, with fold training sizes 16,32,48.

Repeated years do not create 48 independent countries. Retrospective same-year covariates and a retained revised vintage do not certify operational real-time forecasts.

53. 실제 임금의 선택 분모Actual wage eligibility denominators

원3613명 중3017명이 선택 목표·특징에 완전하고2413명이훈련,604명이외부다. 제외 수와 각 분모의 역할을 쓰라.

Of 3,613 original people,3,017 are complete, with 2,413 training and 604 outer testing. Give exclusions and explain denominator roles.

풀이와 확인할 이유Solution and explanation

제외는3613−3017=596명이다. 원 기록 수와 적격 수,적합 수와 외부 채점 수를 구분한다. 원596행을 버려 원자료에 없었던 것처럼 숨기지 않는다.

이 선택은 현재 변수의 완전성 규칙에 따른 것이며 결측의 원인이 모두 같다는 결론은 아니다. 적격자의 성능을 원 코호트 전체나 현재 미국 전체의 대표 성능이라고 자동 일반화하지 않는다.

There are 596 excluded records. Preserve original, eligible, training and scoring denominators separately rather than hiding excluded source rows.

Completeness selection does not identify one universal missingness cause. Performance for eligible records does not automatically represent the original cohort or today’s population.

54. 실제 원자료1행과 분할 규칙Source row 1 and the split rule

원자료1행(원 id 2)은 시급548센트,교육7년,나이29이다. 목표 단위를 바꾸고 원 번호가1,5,6인 적격 행의 역할을 쓰라.

Source row 1 (native id 2) has wage 548 cents, schooling 7, age 29. Convert the target and assign eligible source rows 1,5,6 under the declared splits.

풀이와 확인할 이유Solution and explanation

목표는548/100=137/25=5.48 USD/시간이다. 번호1과6은5의 배수가 아니어서 훈련,번호5는 외부 시험이다. 훈련 접힘은4 나머지라1은접힘1,6은접힘2의 검증 ID가 된다.

이 규칙은 원 순서를 이용한 체계적 분할이지 무작위 배정이 아니다. 원 번호가5라도 적격 조건을 먼저 충족해야 이 예의 외부 채점 대상으로 들어간다.

The target is 548/100=137/25=$5.48/hour. Eligible rows 1 and 6 train;5 is outer test. Their modulo-four validation folds are 1 and 2.

This is systematic source-order allocation, not random assignment. Eligibility remains a prerequisite before a source row enters the declared scoring frame.

55. 시급 예측과 교육 수익률Wage prediction versus schooling returns

원자료1행(원 id 2)의5.48 USD/시간을 교육7년으로 나눈 값이 교육의 인과수익률인가? 실제 외부 MSE4.902418의 단위와 함께 설명하라.

Does dividing source row 1’s $5.48/hour (native id 2) by seven schooling years identify a causal return? Also state the units of outer MSE 4.902418.

풀이와 확인할 이유Solution and explanation

시급/교육연수라는 산술 비율은 추가 교육이 없었을 반사실 임금과의 차이를 만들지 않는다. 경험·지역·직업·교육 선택 등 다른 조건을 분리한 인과 설계가 필요하다.

MSE의 단위는 (USD/시간)²이다.4.902418을 임금의 평균 달러 오차나 수익률 퍼센트라고 바꾸지 않는다. 원시급·단위·해당 남성 코호트·체계적 외부604명 범위에서 읽는다.

That arithmetic ratio supplies no counterfactual wage without additional schooling. A causal design must address education selection and other factors.

MSE uses(USD/hour)², not mean dollar error or a return percentage. Retain raw-wage units, the male-cohort scope and the 604-person systematic outer frame.

56. 실제 코드10의 불일치The actual code 10 discrepancy

제공자 설명은 요금서열0~9인데 원3150행 중7행은10이다.9로 바꿔야 하는가? 어떤 자료와 해석을 남겨야 하는가?

Creator charge metadata says 0–9 but seven of 3,150 original records have 10. Should they be silently changed to 9?

풀이와 확인할 이유Solution and explanation

자동 수정하지 않는다. 원 토큰10과 그 원행 ID,제공자 설명의 범위를 함께 보존하고 모델에서 사용한 규칙을 공개한다.10을 통화금액으로 해석하는 것도 근거가 없다.

오류 여부를 더 조사하거나 민감도 분석을 새로 한다면 별도 분석으로 명시한다. 이 장의 기본 결과는 일곱 원행을 그대로 둔 재현이며,작은 메타 불일치를 숨기고 깨끗한 자료인 척하지 않는다.

Do not silently repair them. Preserve tokens, original IDs and the creator’s stated range, disclosing the modeling rule. Treating 10 as currency is also unsupported.

Further source investigation or sensitivity exclusions would be separately stated analyses. The default reproduction retains all seven records and exposes rather than conceals the discrepancy.

57. 기업의 입력 시각과 목표Business input and target timing

원 설명은 첫9개월 입력과12개월 말 이탈 상태이다. 계획 간격과 미래 목표를 입력으로 쓰면 안 되는 이유를 설명하라.

The source defines first-nine-month inputs and churn status at month 12. Explain the planning gap and why future targets must not become features.

풀이와 확인할 이유Solution and explanation

명시한 계획 간격은3개월이다. 마지막12개월의 결과를 이미 알았던 것처럼 특징에 넣으면 그 시점 예측에 사용할 수 없는 정보를 읽어 성적을 부풀릴 수 있다.

제공자의 이 시간 정의도 다른 회사나 새 배포 시각의 자료 공개를 대신 증명하지 않는다. 실제 어떤 열이 언제 확정되는지 확인하고,원 이탈0/1과 특징 집계의 기간을 나누어 기록한다.

The stated gap is three months. Supplying month 12 outcomes as if available earlier leaks unavailable future information and can inflate performance.

The creator’s chronology does not authenticate another company’s release process. Verify when each field becomes available and retain separate input-aggregation and outcome dates.

58. 실제 Brier 관례 바꾸기Changing the actual Brier convention

외부630고객의 다중 Brier 평균은 약0.320409190472이다. 두 범주에서 양성 하나의 Brier로 바꾸면 얼마이며 어떤 것은 변하지 않는가?

Mean multiclass Brier over 630 outer customers is about 0.320409190472. What is the positive-category-only binary score, and what stays unchanged?

풀이와 확인할 이유Solution and explanation

같은 관측·무게·확률에서 절반인 약0.160204595236이다. 예측과 관측 분모630은 그대로이고 보고한 손실 정의만 달라진다.

이 변환이 다수결 오류율을 계산한 것은 아니다. 같은 후보들의 검증 손실을 모두 절반 보고하면 순서는 같지만,훈련 Gini 위험이나 alpha 단위까지 바꾸는 별도 절차와 혼동하지 않는다.

It is half, approximately 0.160204595236, with the same 630 observations and probabilities. Only the reporting convention changes.

This is not classification error rate. Halving every candidate’s reported validation loss preserves ranking, but is distinct from redefining training-risk and alpha units.

59. 세 자료의 검증 분모Validation denominators across sources

국가 검증은16행씩3회,개인은603,604,603,603명,기업은630명씩4회다. 각 합친 사건 수와 서로 합쳐 정확도를 낼 수 없는 이유를 쓰라.

Country tests 16 rows in three folds; person fold sizes are 603,604,603,603; business tests 630 in four folds. Give pooled event counts and explain why scores cannot simply be combined.

풀이와 확인할 이유Solution and explanation

검증 사건은48,2413,2520이다. 국가의 반복 연도와 사람·고객의 행 단위가 다르고,수명·시급의 제곱손실과 범주 Brier도 단위가 다르다.

각 자료의 선언한 프레임 안에서 합친 주 손실을 계산한다. 이 세 숫자를 더해4981개의 동질적 독립 관측이라 부르거나 손실을 한 평균으로 섞으면 추정대상과 단위를 잃는다.

Pooled events are 48,2,413,2,520. Country-years, people and customers differ, as do squared-longevity, squared-wage and probability losses.

Pool within each declared source frame. Adding them into 4,981 homogeneous independent observations or averaging their incompatible losses would erase units and targets.

60. 끝까지 재현하는 메모A complete reproduction memo

실제 세 사례 중 하나를 골라 최초 원 토큰부터 외부 손실까지 재현할 메모의 필수 항목을 쓰라.

Choose one actual source and list the evidence required to reproduce it from original tokens to outer loss.

풀이와 확인할 이유Solution and explanation

원 출처·사본 빈티지·해시·변수와 단위·결측과 코드 불일치·적격 ID·훈련/외부 역할·모든 접힘·성장 설정·alpha 후보와 동률 규칙을 쓴다. 최종 재적합의 원행·노드·잎 확률·모든 외부 예측과 채점 분모를 연결한다.

Python 정확값과 R 수치 재현,원 SVG와 웹 그래프의 조건·단위도 비교한다. 고정 실행 기록과 현재 웹 입력을 구별하고,공개 코드 일치가 인과 효과·대표 모집단 성능을 자동 증명하지 않는다는 한계까지 적는다.

Record source, vintage, hashes, variables/units, missingness/code discrepancies, eligible IDs, training/outer roles, folds, growth settings, alpha grid and tie rules. Link final refit memberships, nodes, probabilities, every outer prediction and scoring denominators.

Compare exact Python values, numerical R output and figure units/settings. Distinguish fixed execution records from current browser inputs, and preserve the limits of causal and representative-population claims.

자료와 출처Data and sources

실습에 추가한 실제 입력과 출처Additional observed lab inputs and provenance

실제 자료 사례Actual-data cases · 원자료·단위·결측·변환·출처Inputs, units, missingness, transformations and sources

자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.

자료사전·출처·이용 조건Data dictionary, sources and terms