ML-22 · MACHINE LEARNING

와인·고객 이탈의 재현 가능한 비교Reproducible wine-quality and churn comparisons

원자료의 단위부터 같은 시험 행의 손실 비교와 완전한 재현까지From native units to same-test loss comparisons and complete reproduction

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

학부Undergraduate

모형 비교는 질문·단위·손실을 정하는 일A comparison begins with a question, a unit and a loss

두 학생이 서로 다른 시험에서 80점과 90점을 받았습니다. 두 시험의 난이도와 배점을 모르면 누가 더 잘 배웠는지 바로 결론 내리기 어렵습니다. 예측 모형도 같습니다. 와인 점수의 제곱 오차 0.6과 고객 이탈의 제곱 오차 0.12를 나란히 적었다고 이탈 모형이 다섯 배 우수해지는 것은 아닙니다. 무엇을 예측하고 어떤 잘못을 얼마나 크게 세었는지부터 정해야 합니다.

이 장에서는 포르투갈 와인 표본의 전문가 품질 점수, 미국 NLS 남성의 1976년 로그 시급, 이란 통신 고객의 이탈 여부를 실제 원자료로 비교합니다. 국가·개인·기업이라는 사례 맥락을 제공하지만, 와인의 관측 단위는 국가가 아니라 와인 기록 한 행입니다. 한 고객의 이탈 예측과 기업 전체의 이익도 다른 대상입니다. 원자료에 없는 가격·할인 효과·이익을 관측한 것처럼 채우지 않습니다.

예측값을 f(X), 관측 결과를 Y, 잘못을 세는 규칙을 손실 ℓ이라고 쓰겠습니다. 모형의 경험 위험은 평가 대상으로 정한 행의 손실을 평균낸 값입니다. 분석 비중 w는 기본적으로 모두 1입니다. 다른 비중을 입력하면 누구의 오차를 더 크게 반영할지 바꾸는 것이므로 분모도 비중의 합으로 바꿉니다.

R^(f;I)=∑i∈Iwiℓ(Yi,f(Xi))∑i∈Iwi,wi≥0,∑i∈Iwi>0\widehat R(f;I)=\frac{\sum_{i\in I}w_i\ell(Y_i,f(X_i))}{\sum_{i\in I}w_i},\qquad w_i\geq0,\quad \sum_{i\in I}w_i>0

I는 아무 행이나 섞은 집합이 아닙니다. 훈련·검증·시험 중 어느 역할인지, 결과와 예측이 모두 있는지, 비중이 양수인지 정한 평가 집합입니다. 빈 집합이나 비중 합 0에서는 평균을 0이라고 적지 않고 미정의로 둡니다. 틀린 예측이 없었다는 말과 평가할 관측이 없었다는 말은 다르기 때문입니다.

읽는 순서는 질문 → 원자료와 시간 → 분할 → 훈련 → 검증 선택 → 고정한 시험 평가입니다. 후반의 실제 사례에서는 상수 기준선, 세 릿지 회귀, 한 번만 나누는 나무를 같은 절차에 넣습니다. “어느 알고리즘이 늘 최고인가”보다 “이 자료와 이 절차에서 무엇을 비교했는가”를 정확히 말하는 연습입니다.

Imagine two students scoring eighty and ninety on different exams. Without the difficulty and marking rules, the scores alone do not establish who learned more. Prediction models present the same problem: wine-quality squared error 0.6 and churn squared error 0.12 use different targets and scales. Their ratio is not a universal measure of model quality.

We use actual Portuguese wine records, native 1976 log hourly wages for men in the US NLS, and Iranian telecom churn. These provide national-industry, individual and company contexts, but a wine observation is a wine record, not a country. Customer churn and company profit are also distinct outcomes. Unobserved prices, discount effects and profits will not be invented.

Write the prediction as f(X), the observed outcome as Y, and the error-counting rule as loss ℓ. Empirical risk averages that loss over the declared evaluation rows. The factual baseline uses unit analysis weights. Alternative weights change whose errors matter more, so the denominator is total weight.

R^(f;I)=∑i∈Iwiℓ(Yi,f(Xi))∑i∈Iwi,wi≥0,∑i∈Iwi>0\widehat R(f;I)=\frac{\sum_{i\in I}w_i\ell(Y_i,f(X_i))}{\sum_{i\in I}w_i},\qquad w_i\geq0,\quad \sum_{i\in I}w_i>0

The index set I specifies a role, available labels and predictions, and positive weights. An empty set or zero total weight yields an undefined mean, not a perfect score of zero. No observed error differs from no observation available for evaluation.

Follow question, source and timing, split, training, validation selection, then a frozen test evaluation. The factual comparison uses a constant baseline, three ridge models and a one-split tree. Learn to state what a comparison establishes under this procedure rather than declaring one algorithm universally best.

학부Undergraduate

원자료의 한 행과 분석의 한 행Native records and analysis rows

스프레드시트의 행 번호는 사람이 정한 주소입니다. 행 번호가 다르다고 서로 독립인 사람이 되는 것은 아닙니다. 같은 와인의 화학 측정이 반복되거나 같은 고객처럼 보이는 기록이 여러 번 들어 있으면, 행 단위로 섞은 시험에서 훈련과 매우 비슷한 정보를 다시 만날 수 있습니다. 먼저 원래의 관측 단위와 확인 가능한 식별자를 적습니다.

와인 파일은 적포도주 1,599행과 백포도주 4,898행, 합계 6,497행입니다. 각 원행은 화학 변수 11개와 품질 1개를 담습니다. 두 종류를 함께 비교하기 위해 적포도주 지시자 1개를 명시적으로 더해 모형의 설명변수는 12개가 됩니다. 원래 파일에 지시자 열이 있었다거나 원행에 13개의 원변수가 있었다고 말하지 않습니다. 출처 설명은 UCI Wine Quality에서 확인할 수 있습니다.

원자료의 단위와 이 장의 예측 대상
사례 맥락원행 수원변수 수예측 대상
포르투갈 와인 산업6,49712순서형 품질 점수
미국 NLS 개인3,61352native lwage76
이란 통신 고객3,15014Churn 0/1

NLS는 원 개인 식별자와 원행 번호를 함께 보존합니다. 와인과 이탈 파일에는 인증된 병·고객 식별자가 없으므로 행 번호를 실제 물리적 대상을 확인한 ID로 부르지 않습니다. 대신 결과 라벨을 제외한 원 설명변수가 완전히 같은 행을 보수적으로 묶어 같은 분할에 둡니다. 이 묶음은 정보가 같은 기록을 막는 계산 규칙이지 물리적 동일성을 입증하는 기록은 아닙니다.

원자료는 수정하지 않은 열 이름·토큰과 함께 내려받을 수 있어야 합니다. 분석용 파일에는 모형 역할, 제외 사유, 분할 묶음과 변환값을 따로 적습니다. 파일의 SHA-256 해시는 같은 바이트인지 확인하는 장치입니다. 해시가 같아도 표본이 사회 전체를 대표한다거나 그 측정이 정확하다는 결론은 나오지 않습니다. 파일 동일성과 내용 타당성을 따로 검토하세요.

A spreadsheet row number is an address chosen by a file author. Different addresses need not be independent people or objects. Repeated chemistry records or nearly identical customer records can put very similar information in both training and test sets. First document the observation unit and the identifiers the source actually supplies.

The wine files contain 1,599 red and 4,898 white records, totaling 6,497. Each has eleven chemical inputs and one quality target. Combining the types adds one explicitly declared red-wine indicator, giving twelve model inputs. The indicator is derived rather than a thirteenth original variable. Consult the UCI Wine Quality documentation.

Native units and prediction targets
ContextNative rowsNative variablesTarget
Portuguese wine industry6,49712Ordered quality score
US NLS individuals3,61352Native lwage76
Iranian telecom customers3,15014Churn 0/1

For NLS, preserve the original individual identifier and source row. The wine and churn files do not authenticate bottle or customer identities. Instead, a conservative computational group keeps rows with identical native predictors together, excluding the outcome label from the fingerprint. Equal information does not prove physical identity.

Retain original column names and tokens in the factual downloads. Keep analysis roles, exclusion reasons, group assignments and transformations in separate ledgers. SHA-256 checks file-byte identity; it does not prove representative sampling or valid measurement. Audit those claims separately.

학부Undergraduate

전문가의 와인 점수를 어떻게 읽을까Reading an expert wine-quality score

와인을 마셔 본 전문가가 5점, 6점, 7점을 주었다고 해 봅시다. 점수의 순서는 7이 6보다 좋다는 평가를 뜻하지만, 5에서 6으로 올라가는 즐거움과 6에서 7로 올라가는 즐거움이 꼭 같다는 뜻은 아닙니다. 이런 척도를 순서형이라고 합니다. 점수를 숫자로 적었다는 이유만으로 동일한 간격의 경제적 가치를 가정하지 마세요.

원 와인 설명 파일은 품질을 최소 세 전문가 평가의 중앙값이라고 설명합니다. 중앙값은 평가를 정렬했을 때 가운데 값입니다. 가상의 평가 4, 5, 9라면 중앙값은 5이고 평균은 6입니다. 이 예는 중앙값 계산용 가상 숫자이며 실제 세 전문가의 원평가를 이 자료에서 본 것은 아닙니다. 공개 행에는 최종 품질 점수가 있고 개별 전문가의 모든 응답은 없습니다.

이 장은 그 최종 숫자를 그대로 회귀의 결과로 두고 제곱 손실을 계산합니다. 따라서 5점을 7점으로 예측한 오차는 2, 제곱 손실은 4입니다. 이 규칙에서는 한 칸의 간격을 같은 숫자 차이로 취급합니다. 재현 가능한 비교 규칙이지만 실제 선호의 동일 간격이나 시장 가격을 검증한 것은 아닙니다. 범주를 순서대로 다루는 모형이나 허용 오차 내 분류는 다른 목표가 될 수 있으며, 어느 손실을 쓸지는 시험 결과를 보기 전에 정합니다.

ℓsq(y,y^)=(y−y^)2,ℓabs(y,y^)=∣y−y^∣\ell_{\mathrm{sq}}(y,\widehat y)=(y-\widehat y)^2,\qquad \ell_{\mathrm{abs}}(y,\widehat y)=|y-\widehat y|

품질이 정수여도 선형 회귀의 예측이 5.8인 것은 계산 오류가 아닙니다. 여러 관측의 숫자 손실을 줄인 회귀값입니다. 이를 사람이 실제로 5.8점이라고 평가했다고 바꾸어 읽거나, 무조건 6으로 반올림한 뒤 원래 회귀 성능과 같다고 적으면 안 됩니다. 반올림은 예측 규칙을 바꾸며, 제곱 오차도 달라질 수 있습니다.

실무 질문도 좁혀 봅시다. 화학 검사가 상대적으로 빠르다면 점수 예측을 추가 시음 우선순위의 참고로 쓸 수 있을까요? 그 가능성을 논의할 수는 있습니다. 하지만 원자료에는 검사 비용·소비자 구매·시음 대체 효과가 없으므로 이 점수만으로 인력 절감액이나 매출 증가를 산출할 수는 없습니다.

Suppose experts assign wine scores five, six and seven. Seven ranks above six, but the increase in enjoyment from five to six need not equal that from six to seven. An ordered score does not automatically measure equally spaced economic value.

The native description defines quality as the median of at least three expert assessments. The constructed ratings four, five and nine have median five and mean six. These are teaching numbers, not recovered individual expert responses: the public rows provide the final score, not every assessor’s rating.

We regress that native numeric score and use squared loss. Predicting seven for an observed five gives error two and loss four. This is an explicit equal-numeric-spacing comparison convention, not validated equal utility or market value. Ordinal models or tolerance-based decisions answer alternative questions. Declare the chosen loss before inspecting test performance.

ℓsq(y,y^)=(y−y^)2,ℓabs(y,y^)=∣y−y^∣\ell_{\mathrm{sq}}(y,\widehat y)=(y-\widehat y)^2,\qquad \ell_{\mathrm{abs}}(y,\widehat y)=|y-\widehat y|

An integer target can have a regression prediction of 5.8. That is a fitted value under numeric loss, not an observed fractional expert score. Rounding it to six changes the prediction procedure and may change squared error; do not report the rounded and unrounded procedures as identical.

A practical discussion might ask whether chemical predictions could help prioritize further tasting. The source does not observe testing costs, consumer purchases or the effects of replacing tasting. It therefore cannot by itself establish labor savings or revenue gains.

학부Undergraduate

고객 이탈의 특징 시점과 라벨 시점Feature timing and label timing in churn

고객이 떠난 뒤에만 알 수 있는 정보로 “떠날 고객”을 맞히면 매우 잘 맞는 것처럼 보일 수 있습니다. 그러나 전화 상담을 할 시점에 그 정보가 없었다면 실제 의사결정에는 쓸 수 없습니다. 예측 문제를 적을 때에는 “무엇을”뿐 아니라 “언제 알고 있었나”도 포함해야 합니다.

이란 이탈 자료의 공식 설명은 처음 9개월의 특징을 집계하고 12개월 말의 이탈 라벨을 기록하여 3개월의 계획 간격을 둔다고 말합니다. 이 설명은 실제 날짜 열이 모든 행에 있다는 뜻이 아닙니다. 공개 파일에 개별 관측 날짜가 없으므로 달력 순으로 훈련하고 미래 고객을 순차 검증했다고 주장하지 않습니다.

이탈 사례의 정보 순서 · 문서에 명시된 범위
구간사용 가능한 설명이 장에서 하지 않는 주장
처음 9개월특징 집계각 고객의 실제 시작일 복원
9개월 이후3개월 계획 간격실제 상담 개입의 효과 관측
12개월 말Churn 라벨월별 이탈 위험 곡선 추정

기본 설명변수는 통화 실패 수, 가입 기간, 통화 시간 합, 나이의 네 가지로 미리 고정합니다. 원파일의 나머지 변수도 모두 보존하지만, 변수를 더 넣어 본 결과를 보고 네 개를 골랐다는 실험은 하지 않습니다. Status와 Customer Value의 추가 사용은 기록 시점과 계산법을 확인한 별도의 비교 절차가 필요합니다.

회귀식에서 얻은 수치를 0과 1 사이로 자르면 이탈 확률처럼 읽을 수 있는 점수 범위를 만들 수 있습니다. 범위를 맞춘 것과 실제로 0.2를 받은 고객 100명 중 약 20명이 떠나는 보정은 다릅니다. 이 장은 Brier 손실과 순위·분류 지표를 보고하며 자동으로 확률 보정을 인증하지 않습니다.

정책으로 이어가려면 연락 비용, 혜택 비용, 고객 불편, 개입으로 이탈이 줄어드는 효과가 필요합니다. 잘 떠날 고객을 찾는 예측만으로 할인 쿠폰의 인과 효과가 생기지 않습니다. 예측 성능 표와 실제 유지 활동의 비용편익 표를 분리해서 생각하세요.

A churn model can appear excellent if it uses information known only after a customer leaves. Such information cannot support an earlier retention decision. A prediction question must specify when each input is available.

The official Iranian churn description places aggregated attributes in the first nine months and the label at the end of month twelve, with a three-month planning gap. It does not supply individual calendar dates in the released rows. Our group-preserving split is not a reconstructed prospective rolling evaluation.

Documented timing in the churn case
PeriodDocumented informationClaim not established
First nine monthsAggregated attributesIndividual start dates recovered
After month nineThree-month planning gapObserved effect of contacting customers
End of month twelveChurn labelMonthly hazard curve estimated

The four predeclared inputs are call failures, subscription length, seconds of use and age. All other native variables remain available in the factual download. This is not a claim that an unreported feature-search experiment selected these four. Additional use of Status or Customer Value needs a separately specified timing and construction audit.

Clipping a regression score into the unit interval makes its range probability-like. It does not establish calibration, such as approximately twenty departures among one hundred customers assigned score 0.2. We report Brier loss and ranking/classification diagnostics without certifying calibration.

Retention decisions additionally need contact and benefit costs, customer burdens and the causal effect of the intervention. Predicting who may leave does not identify what a coupon would change. Keep a prediction scorecard separate from a retention-policy cost-benefit analysis.

학부Undergraduate

개인 로그 임금과 사라지지 않는 결측 행Individual log wages and retained missing rows

개인 사례의 결과는 NLS 원열 lwage76입니다. 원 코드북의 1976년 로그 시급 열을 그대로 사용합니다. 다른 열 wage76에 새로 로그를 취해 같은 값이라고 가정하지 않습니다. 값의 절사 규칙이나 원기록의 정밀도가 다르면 새 계산은 다른 결과 변수가 될 수 있습니다. 설명변수는 교육 연수 ed76와 나이 age76입니다.

3,613개의 원행 중 이 비교에 필요한 결과가 없는 행은 603개이고, 설명변수와 결과가 갖추어진 행은 3,010개입니다. 결측값을 임금 0이나 로그 임금 0으로 바꾸면 원자료가 말하지 않은 소득을 만들어 넣게 됩니다. 또한 결측 토큰만으로 미응답·미취업·조사 오류 중 어느 원인인지 확정할 수 없습니다. “임금 라벨 결측”이라고 정확히 씁니다.

기본 분할은 결측 행을 삭제하기 전에 원 개인 ID 전체에 적용합니다. 그러므로 시험에 배정된 904명이 모두 평가 가능한 것은 아닙니다. 그중 159행은 필요한 라벨이 없고 실제 시험 위험의 분모는 745입니다. 원 ID와 예정된 역할은 그대로 남겨, 누가 어떤 이유로 평가에서 빠졌는지 확인할 수 있습니다.

NLS 예정 분할과 실제 평가 가능 행
역할예정 원행완전한 분석 행결측으로 제외
훈련1,8061,520286
검증903745158
시험904745159
전체3,6133,010603

로그 차이는 원 임금 차이와 다릅니다. 예측 로그 임금이 실제보다 0.1 높았다면 단위는 로그 점이고, 그 차이를 지수로 바꾸면 원 임금 비율이 exp(0.1)입니다. 다만 로그의 조건부 평균을 지수로 바꾼 값이 자동으로 원 임금의 조건부 평균은 아닙니다. 오차 분포와 재변환 문제를 다루어야 합니다. 여기서는 원 로그 결과의 MSE와 MAE를 보고합니다.

교육 연수를 넣어 예측 오차가 줄어도 교육을 1년 늘리면 임금이 얼마 오른다는 인과 결과는 아닙니다. 이 장의 회귀는 교육·나이와 기록된 로그 임금의 예측 관계입니다. 표본의 남성·시기·관측 범위, 기본 단위 비중, 결측 선택 때문에 현대 전체 노동시장에 곧장 일반화할 수도 없습니다.

The individual target is the native NLS variable lwage76, the source’s 1976 log hourly-wage measure. Do not assume that freshly logging wage76 reproduces it: trimming and recorded precision can define a different target. Inputs are years of schooling ed76 and age age76.

Of 3,613 native rows, 603 lack a required outcome label and 3,010 have the complete analysis fields. Replacing a missing token with wage zero or log wage zero invents an outcome. The token alone also does not identify nonresponse, nonemployment or recording error. State wage-label missingness without inventing its cause.

Assign roles using every original individual ID before removing incomplete analysis rows. Of 904 planned test records, 159 lack the needed label, leaving 745 in the test-risk denominator. Preserve the original IDs and planned roles so that exclusions remain auditable.

Planned NLS roles and complete analysis rows
RolePlanned native rowsComplete analysis rowsMissing exclusions
Train1,8061,520286
Validation903745158
Test904745159
Total3,6133,010603

A log difference is not a wage-level difference. A predicted log wage exceeding the observed value by 0.1 differs by 0.1 log points; exponentiating that difference gives a wage ratio exp(0.1). Exponentiating a conditional mean log wage does not automatically give a conditional mean wage. Retransformation requires attention to the error distribution. We evaluate the native log outcome directly.

Improved prediction from schooling does not identify the effect of adding one year of education. These are predictive associations among schooling, age and observed log wages. The male sample, historical period, unit analysis weights and missingness also limit transport to a modern labor market.

학부Undergraduate

같은 시험 행에서 비교해야 하는 이유Why candidates need the same evaluation rows

축구 선수가 한 번 슛해서 넣었고 다른 선수는 열 번 중 여섯 번 넣었습니다. 첫 선수의 100%가 더 높아도 어려운 기회가 얼마나 있었는지 보지 않으면 비교가 공정하지 않을 수 있습니다. 모형도 예측하지 못한 어려운 행을 조용히 빼면 평균 오차가 좋아 보일 수 있습니다. 분모와 포함 규칙을 결과와 함께 보여야 합니다.

가상 시험 결과 Y가 1, 3인 두 행을 보겠습니다. 모형 A는 2, 2를 예측하고 B는 1, 결측을 냅니다. A는 두 행에서 제곱 손실이 1, 1이므로 평균 1입니다. B는 첫 행에서만 손실 0입니다. 이것을 “B의 두 행 성능은 0”이라고 적으면 둘째 행을 평가하지 않았다는 사실을 감춥니다.

가상 두 행 · 결측 예측은 0이 아님
행YA 예측B 예측A 제곱 손실B 제곱 손실
r112110
r232결측1미정의

두 모형을 모두 평가할 수 있는 공통 집합은 첫 행뿐입니다. 그 집합에서는 A의 위험 1, B의 위험 0이므로 B가 더 작습니다. 그러나 공통 집합의 범위는 전체 두 행의 절반입니다. 공통 집합 성능과 전체 예측 가능 비율을 함께 보고해야 합니다. 결측된 B의 둘째 예측이 좋아질지 나빠질지 원자료에서 결정할 수 없습니다.

이 장의 실제 다섯 후보는 설명변수와 라벨이 모두 있는 같은 양의 비중 훈련 집합을 사용합니다. 상수 모형도 이 공통 훈련 집합으로 제한하여, 서로 다른 관측 집합에서 배운 효과가 모형 차이처럼 섞이지 않게 합니다. 일반적인 업무에서 상수는 X결측에도 예측할 수 있지만, 여기서는 비교 설계를 위해 정한 규칙임을 기억하세요.

검증 선택도 같은 원칙입니다. 한 후보의 예측이 빠진 행이 있으면 모든 후보의 검증 위험을 공통 완전 집합에서 계산합니다. 작은 위험만 볼 것이 아니라 제외 행 수·집단 구성·가중치 합도 확인하세요. 공통 집합을 쓴다는 규칙이 결측 선택 편향까지 제거하는 것은 아닙니다.

A player scoring on one attempt has a higher observed rate than a player scoring six times in ten attempts, but the opportunities may differ. Models can similarly look better by silently dropping difficult records. Report denominators and inclusion rules alongside error rates.

Consider two constructed test outcomes, one and three. A predicts two and two; B predicts one and a missing value. A has squared losses one and one, averaging one. B has zero loss only on the first record. Calling this zero error over both records hides the missing prediction.

Constructed records: a missing prediction is not zero
RecordYA predictionB predictionA squared lossB squared loss
r112110
r232Missing1Undefined

The common evaluable set contains only the first record. B has lower risk there, zero versus one, but the common set covers only half the original records. Report this restricted risk and coverage together. The missing second prediction does not reveal B’s full-set performance.

Our five factual candidates use the same positive-weight training rows with complete predictors and labels. Even the constant model follows that common frame so changes in training composition do not masquerade as model differences. A constant could predict without X in another application; the restriction here is an explicit comparison design.

Selection also evaluates every candidate on a common complete validation frame. Inspect exclusions, group composition and weight mass rather than only the smallest risk. Common-frame evaluation does not itself remove bias caused by missingness.

학부Undergraduate

상수 기준선은 얼마나 배웠는지를 묻는다A constant baseline asks what the features added

내일의 값을 모르겠으면 훈련 자료의 평균을 예측하는 방법부터 생각할 수 있습니다. 와인에서는 평균 품질, 로그 임금에서는 평균 로그 임금, 이탈에서는 훈련 이탈 비율입니다. 설명변수를 이용하지 않는 이 상수 기준선과 비교해야 복잡한 모형이 추가로 배운 것이 무엇인지 보입니다.

상수 c의 가중 제곱 손실은 c에 대한 이차식입니다. 평균을 μ라고 쓰면 아래처럼 평균에서 떨어진 거리의 제곱과 평균에서의 손실로 분해됩니다. 마지막 항이 0 이상이므로 양의 훈련 비중 합 아래 최솟값을 주는 상수는 μ입니다. 이 증명에는 정규분포나 선형 관계를 가정할 필요가 없습니다.

∑iwi(yi−c)2=∑iwi(yi−μ)2+W(c−μ)2,μ=∑iwiyiW,W=∑iwi>0\sum_iw_i(y_i-c)^2=\sum_iw_i(y_i-\mu)^2+W(c-\mu)^2,\qquad \mu=\frac{\sum_iw_iy_i}{W},\quad W=\sum_iw_i>0

가상 훈련 결과가 1과 5, 비중이 각각 1이면 평균은 3입니다. c=3의 제곱 손실 합은 4+4=8, 평균은 4입니다. c=2라면 1+9=10, 평균 5입니다. 시험 결과가 999라고 뒤늦게 드러나도 이 훈련 평균 3은 바꾸지 않습니다. 시험을 포함해 평균을 다시 구하면 평가 대상이 새 모형으로 바뀌기 때문입니다.

시험 상수 위험은 반드시 시험 평균을 최적으로 고른 상수의 위험과 같지는 않습니다. 우리 기준선은 훈련 평균을 고정해서 시험에 적용한 것입니다. 시험 평균을 본 뒤 상수를 고르면 “기준선은 학습하지 않았다”는 말과 달리 시험 라벨을 이용한 셈입니다.

기준선보다 손실이 작아졌다면 그 시험 집합에서 예측이 개선되었다고 말할 수 있습니다. 그 비율을 회사의 이익률로 부르거나 모든 미래 고객에 같은 개선이 반복된다고 보장할 수는 없습니다. 후반에는 같은 시험 행에서 선택 모형 손실에서 상수 손실을 뺀 쌍별 차이를 함께 읽겠습니다.

When future values are unknown, start by predicting a training mean: mean wine quality, mean log wage or the observed training churn proportion. Comparing against this feature-free baseline reveals whether added inputs helped under the chosen loss.

The weighted squared loss for a constant c is a quadratic. Write the training mean as μ. The decomposition below expresses loss as its value at μ plus a nonnegative squared-distance term. Thus μ minimizes the criterion whenever total training weight is positive; no Gaussian or linear relationship is needed.

∑iwi(yi−c)2=∑iwi(yi−μ)2+W(c−μ)2,μ=∑iwiyiW,W=∑iwi>0\sum_iw_i(y_i-c)^2=\sum_iw_i(y_i-\mu)^2+W(c-\mu)^2,\qquad \mu=\frac{\sum_iw_iy_i}{W},\quad W=\sum_iw_i>0

For constructed unit-weight training outcomes one and five, the mean is three. Predicting three gives loss sum eight and mean four; predicting two gives sum ten and mean five. A later test outcome of 999 must not change the fitted training mean. Recomputing it using test labels evaluates a different procedure.

A frozen training-mean baseline need not equal the best constant chosen after seeing the test mean. The latter uses the test labels. Calling a model simple does not exempt it from the train/test boundary.

A lower observed test risk supports an improvement on that test frame. It is neither a company profit margin nor a guarantee of identical future gains. Later, read the selected model’s loss minus the constant baseline’s loss on each of the same test records.

학부Undergraduate

재현 계약과 설명용 숫자를 구별하기Separate a reproducibility contract from teaching numbers

요리책에 “알아서 적당히 굽는다”고만 쓰여 있으면 다른 사람이 같은 결과를 얻기 어렵습니다. 모형 비교도 “자료를 나누고 회귀했다”만으로 재현되지 않습니다. 어떤 원파일, 열, 결측 처리, 묶음, 분할 순서, 학습 규칙, 선택 기준과 동률 규칙을 썼는지 기록해야 합니다.

이 장의 기본 계약은 원자료 전체 보존, 결과를 제외한 분할 묶음, 고정한 32비트 LCG 순서, 묶음별 훈련·검증·시험 배정, 훈련에서만 배운 평균·범위, 미리 선언한 다섯 후보, 검증 MSE 최소 선택입니다. 검증 점수가 정확히 같으면 선언 순서가 앞선 후보를 고릅니다. 시험 결과는 선택을 다시 하지 않고 보고합니다. 이후 평균 대신 최악 코호트 위험을 선택 기준으로 쓰는 실험은 별도로 선언합니다.

고정된 계산 순서는 같은 파일에서 같은 분할을 다시 만드는 데 도움이 됩니다. 이것이 국가나 고객을 확률적으로 대표 표집했다는 증명은 아닙니다. 같은 결과의 반복, 모집단에 대한 정확도, 미래 배포의 유효성은 서로 다른 주장입니다. 숫자가 같게 나왔다는 이유로 세 주장을 한꺼번에 승인하지 마세요.

본문에서 가상이라고 밝힌 두 행·세 행 예제는 손으로 계산하기 위해 만든 것입니다. 실제 사례의 6,497·3,613·3,150행과 섞지 않습니다. 실제 원행에서는 관측 토큰을, 모형 결과에서는 예측값을, 가상 실험에서는 지정한 값을 표시합니다. 그림도 원자료 관측과 예측을 구별해 읽으세요.

같은 결과를 설명하는 데 필요한 기록
구분적을 내용바뀌면 무엇이 바뀌나
자료원파일·열·단위·결측분석 대상과 결과
분할묶음·순서·역할훈련·검증·시험 집합
학습변환·후보·벌점예측 함수
선택검증 손실·동률 규칙최종 후보
평가같은 행·가중치·분모비교 위험의 뜻

첫 실습에서는 두 행짜리 상수·릿지·나무 계산을 직접 바꾸어 보세요. 다음에는 동일한 규칙을 실제 자료에 적용한 장부를 읽습니다. 손계산은 알고리즘의 의미를 이해하게 하고, 전행 재현은 그 의미가 실제 파일에서도 유지되는지 확인하게 합니다. 두 활동이 함께 있어야 결과 표의 숫자를 설명할 수 있습니다.

A recipe that only says to bake appropriately is hard to reproduce. Likewise, split the data and fit a regression leaves many choices unspecified. Record native files, columns, missingness, groups, split order, training, selection and ties.

Our baseline contract retains all native records, forms outcome-free split groups, uses a declared 32-bit LCG schedule, assigns whole groups to roles, learns means/ranges from training only, fits five predeclared candidates and minimizes validation MSE. Exact ties keep declaration order. Test outcomes report performance without reopening selection. A worst-cohort criterion is a separately declared experiment.

A deterministic schedule supports repeating the same split on the same files. It does not prove representative probability sampling. Computational reproducibility, population performance and deployment validity are distinct claims.

Small examples explicitly labeled constructed are teaching data. Do not mix them with the factual 6,497, 3,613 and 3,150 records. Distinguish native observations, fitted predictions and specified hypothetical values in figures as well as tables.

Records needed to explain a repeated comparison
ComponentRecordA change affects
DataFiles, columns, units, missingnessTarget and analysis population
SplitGroups, order, rolesTraining, validation and test sets
TrainingTransforms, candidates, penaltyPrediction function
SelectionValidation loss and tiesFinal candidate
EvaluationCommon rows, weights, denominatorMeaning of comparative risk

Begin with editable two-row constant, ridge and stump examples, then inspect the factual ledgers under the same rules. Hand calculation explains the algorithm; full-row reproduction checks its application to the actual files. Together they let you explain rather than merely copy a score.

학부Undergraduate

같은 묶음은 같은 역할에 둔다Assign an entire group to one role

문제집의 같은 문제가 표현만 조금 바뀌어 시험에 나오면 높은 점수를 받아도 완전히 새 문제를 푼 능력과는 다릅니다. 비슷한 정보가 훈련과 시험에 동시에 들어가는 모형 비교도 주의해야 합니다. 이 장은 원 ID 또는 결과를 제외한 동일 특징 묶음을 먼저 정하고, 그 묶음 전체를 한 역할에 둡니다.

계산 순서는 명확합니다. 묶음 이름을 ASCII 순으로 정렬하고, 고정한 시드에서 32비트 LCG 값을 갱신하며 Fisher–Yates 교환을 합니다. 섞은 묶음의 순위를 0부터 붙인 뒤 4로 나눈 나머지가 0이면 시험, 1이면 검증, 2·3이면 훈련입니다. 같은 묶음의 모든 원행은 같은 예정 역할을 받습니다. 결측 때문에 일부 행이 제외되더라도 예정 역할을 다시 돌려 배정하지 않습니다.

st+1=(1664525st+1013904223) mod 232,j↔(st+1 mod (j+1))s_{t+1}=(1664525s_t+1013904223)\bmod 2^{32},\qquad j\leftrightarrow \bigl(s_{t+1}\bmod(j+1)\bigr)

이 수식은 분할을 정확히 다시 만들기 위한 유한한 계산 규칙입니다. 나머지 연산의 인덱스가 모든 순열을 정확히 같은 확률로 만든다거나, 사회의 대상이 독립적으로 표집되었다는 증명은 아닙니다. 시드를 적으면 재현 가능하다는 주장과 표본의 확률 구조에 관한 주장을 분리하세요.

묶음 수의 약 절반이 훈련으로 가도 원행 수가 정확히 절반일 필요는 없습니다. 어떤 묶음에는 한 행, 어떤 묶음에는 여러 행이 있기 때문입니다. 실제 와인은 5,320묶음을 나눈 뒤 원행 기준으로 훈련 3,255·검증 1,628·시험 1,614가 됩니다. 행 수를 맞추려고 같은 묶음을 찢으면 원래 비교 설계를 바꾼 셈입니다.

분할 실습에서는 묶음이 같은 두 행의 이름을 다르게 적어 보세요. 행 ID만 바꾸고 묶음 ID를 유지하면 두 행의 역할은 같습니다. 묶음 자체를 바꾸면 역할 배정의 입력이 바뀌므로 새 실험으로 기록해야 합니다. 시드를 바꾸는 실험도 미리 정한 민감도 점검으로 하고, 좋은 시험 점수가 나온 시드만 선택하지 마세요.

Seeing a near-copy of a practice question on an exam differs from solving a new problem. Model comparisons need a similar boundary. Define original-ID or outcome-free identical-predictor groups first, then assign each complete group to one role.

Sort ASCII group names, update a declared 32-bit LCG state and apply Fisher–Yates swaps. Number the resulting groups from zero: rank modulo four assigns test, validation, train and train. Every native row in a group receives that planned role. Later exclusions do not trigger reassignment.

st+1=(1664525st+1013904223) mod 232,j↔(st+1 mod (j+1))s_{t+1}=(1664525s_t+1013904223)\bmod 2^{32},\qquad j\leftrightarrow \bigl(s_{t+1}\bmod(j+1)\bigr)

This is an explicit finite computational schedule. Modulo indexing does not prove that all permutations are equally probable or that population units were independently sampled. Repeating a seeded calculation and justifying a sampling model are different claims.

Half the groups need not mean exactly half the rows because group sizes differ. The 5,320 wine groups produce 3,255 training, 1,628 validation and 1,614 test records. Splitting a group to force equal row counts changes the design.

In the split lab, rename a record while retaining its group and check that grouped records stay together. Changing a group or seed changes the experiment. Treat alternative seeds as declared sensitivity checks rather than searching for the best test score.

학부Undergraduate

동일한 특징과 동일한 물리적 대상Identical predictors do not authenticate an object

사진 두 장이 같은 색을 가졌다고 같은 물체라고 확정할 수는 없습니다. 반대로 같은 물체를 다르게 찍으면 색이 달라 보일 수도 있습니다. 이 장의 특징 지문도 이런 한계가 있습니다. 동일한 원 설명 정보를 역할 경계 안에 묶는 규칙이며, 실제 병이나 고객의 이력 관리 시스템을 복원하는 것은 아닙니다.

와인은 적·백 지시자와 원 화학 변수 11개, 이탈은 원 설명변수 13개를 원래 순서로 사용합니다. 품질이나 Churn 라벨은 지문에 넣지 않습니다. 값은 정확한 유리수의 표준 문자열로 바꾸므로 0.10과 0.1은 같은 수로 취급합니다. 원래 표기와 열 이름은 원파일에 그대로 남깁니다. 이 정규화가 측정 정밀도를 더 높여 주는 것은 아닙니다.

NLS는 원 개인 ID가 있으므로 그 ID를 묶음으로 씁니다. 와인·이탈의 SHA-256 지문은 정해진 값 배열의 계산 식별자입니다. 결과가 다른 동일 특징 행도 같은 묶음으로 유지합니다. 결과를 지문에 넣으면 라벨 차이만으로 묶음이 갈라져, 정보가 거의 같은 행이 양쪽 역할에 들어갈 수 있습니다.

묶음 규칙에 따라 평가 질문도 달라집니다. 동일 특징 기록을 같은 역할에 두면 적어도 그 완전 일치 정보는 훈련과 시험에 나누어 놓지 않습니다. 실제로 같은 고객의 변한 시점 기록이 존재하는지, 더 느슨한 유사성이 얼마나 있는지는 이 지문만으로 알 수 없습니다. 알려진 고객 ID·시점이 있는 업무에서는 그런 정보를 우선 검토해야 합니다.

실습에서 “행 ID가 다르다 → 독립 관측”이라고 쓰지 말고, 원 ID 존재 여부·묶음 규칙·미확인 관계를 세 줄로 적어 보세요. 통계적 가정이 파일의 주소 규칙 속에 숨어 들어가는 것을 막는 간단한 습관입니다.

Equal colors in two images do not prove that they show the same object, and the same object can look different under different conditions. Predictor fingerprints have an analogous limitation. They block identical recorded information across roles without reconstructing authenticated bottle or customer histories.

Wine fingerprints use type followed by eleven native chemical predictors; churn fingerprints use all thirteen native predictors in header order. Quality and Churn labels are excluded. Canonical exact numeric strings treat 0.10 and 0.1 as equal values while factual downloads retain original tokens and names. Canonicalization does not improve measurement precision.

NLS uses its original individual IDs. The other SHA-256 fingerprints are computational identifiers for a specified value array. Rows with equal predictors and different labels stay together. Including the label could split otherwise equal information across roles.

This blocking rule changes the evaluation question: exact predictor matches do not straddle the split. It does not identify changed repeated records from one customer or every weaker similarity. When verified customer IDs and timestamps exist, examine those instead of assuming fingerprints recover them.

For each dataset, write down identifier availability, grouping rules and relationships still unknown. This prevents a file-address convention from silently becoming a statistical independence assumption.

학부Undergraduate

평균과 범위도 훈련에서만 배운다Learn means and ranges on training rows only

학교에서 자기 반 시험의 평균을 뺀 점수를 비교한다고 해 봅시다. 다른 반 점수까지 보고 평균을 새로 정하면 비교의 기준이 바뀝니다. 예측 변환도 학습 절차입니다. 훈련에서 특징의 평균과 범위를 계산한 뒤 검증·시험에 같은 숫자를 적용해야 합니다. 시험에 극단값이 있다는 이유로 훈련의 눈금을 다시 맞추지 않습니다.

특징 j의 훈련 가중 평균을 μ_j, 양의 비중을 가진 완전 훈련 행에서의 최대−최소를 s_j라고 둡니다. 범위가 0인 상수 특징에는 s_j=1을 씁니다. 모든 훈련 값이 같으면 중심화한 값이 0이므로 1로 나누어도 학습 정보가 새로 생기지는 않습니다.

μj=∑i∈ItrwixijWtr,sj={max⁡i∈Itrxij−min⁡i∈Itrxij,if positive,1,otherwise,zij=xij−μjsj\mu_j=\frac{\sum_{i\in I_{tr}}w_i x_{ij}}{W_{tr}},\qquad s_j=\begin{cases}\max_{i\in I_{tr}}x_{ij}-\min_{i\in I_{tr}}x_{ij},&\text{if positive},\\1,&\text{otherwise},\end{cases}\qquad z_{ij}=\frac{x_{ij}-\mu_j}{s_j}

가상 훈련 X가 0, 2이면 μ=1, s=2이므로 변환 값은 −1/2, 1/2입니다. 시험 X=100은 (100−1)/2=49.5입니다. 시험 값이 크다고 범위를 100으로 바꾸거나 변환 값을 1에 자르지 않습니다. 큰 값은 훈련 범위 밖의 외삽임을 보여 줍니다. 이 변환에서 범위를 나눈 것과 값을 [0,1]로 제한하는 것은 다른 연산입니다.

NLS와 와인·이탈은 여러 단위의 X를 함께 쓰므로 이 변환이 릿지 벌점의 의미에도 영향을 줍니다. 원 나이 1년과 통화 시간 1초에 같은 원계수 벌점을 바로 주는 것과, 훈련 범위로 나눈 특징의 계수에 벌점을 주는 것은 다른 모형입니다. 변환·벌점·학습 순서를 한 묶음으로 기록하세요.

실습에서는 시험 행의 X만 100에서 1,000으로 바꾸되 훈련 두 행과 역할을 그대로 두세요. 훈련 μ와 s는 유지되고 시험 예측만 달라져야 합니다. 시험까지 포함한 평균으로 바뀌면 정보 경계가 깨진 것입니다. 공식 전처리·누출 안내도 학습할 변환과 적용할 변환을 구분합니다.

A reference average changes when another class is included in its calculation. Feature transformation is part of learning too: estimate training means and ranges, then apply those frozen values to validation and test rows. An extreme test point must not redefine the training scale.

For feature j, use the weighted training mean μ_j and the max-minus-min range s_j over positive complete training rows. Replace a zero range with one. A constant training feature then remains zero after centering; the replacement does not invent information.

μj=∑i∈ItrwixijWtr,sj={max⁡i∈Itrxij−min⁡i∈Itrxij,if positive,1,otherwise,zij=xij−μjsj\mu_j=\frac{\sum_{i\in I_{tr}}w_i x_{ij}}{W_{tr}},\qquad s_j=\begin{cases}\max_{i\in I_{tr}}x_{ij}-\min_{i\in I_{tr}}x_{ij},&\text{if positive},\\1,&\text{otherwise},\end{cases}\qquad z_{ij}=\frac{x_{ij}-\mu_j}{s_j}

Constructed training X values zero and two give mean one and range two, so transformed values are minus one-half and one-half. Test X equal to one hundred becomes 49.5. Do not change the range to one hundred or clip transformed X to one. This is extrapolation beyond the training range, not a transformation error.

Scaling also defines ridge’s penalty. Penalizing coefficients for raw years and seconds differs from penalizing coefficients after training-range scaling. Record transformation, penalty and training order together.

In the lab, change only the held-out X from one hundred to one thousand while preserving the split and training rows. Means and scales must stay fixed even though the test prediction changes. The official preprocessing and leakage guidance likewise separates fitting a transformation from applying it.

대학원 연결Graduate bridge

상수·선형 릿지의 목적함수와 유일성The constant and ridge objectives, including uniqueness

직선은 특징이 변할 때 결과가 어떻게 함께 변하는지를 표현합니다. 릿지는 직선을 맞추는 동시에 기울기가 지나치게 커지는 것을 벌점으로 조절합니다. 여기서는 훈련 변환값 z에 대한 절편 θ_0와 기울기 θ_j를 학습합니다. 상수 후보는 S7의 훈련 평균이고, 릿지는 아래 목적함수를 최소화합니다.

f^λ(x)=θ0+∑j=1pθjzj(x),L(θ)=12Wtr∑i∈Itrwi(yi−θ0−zi⊤θ1:p)2+λ2∑j=1pθj2\widehat f_\lambda(x)=\theta_0+\sum_{j=1}^p\theta_jz_j(x),\qquad L(\theta)=\frac{1}{2W_{tr}}\sum_{i\in I_{tr}}w_i(y_i-\theta_0-z_i^\top\theta_{1:p})^2+\frac{\lambda}{2}\sum_{j=1}^p\theta_j^2

절편에는 벌점을 주지 않습니다. 모든 결과가 대체로 5 근처에 있다는 이유로 기준 수준 자체를 0으로 끌어당기지 않기 위해서입니다. λ가 커지면 이 기준 수준에서 특징에 따라 움직이는 기울기를 더 강하게 억제합니다. 이 비교의 λ는 1/100, 1/10, 1로 미리 정합니다. 시험 점수를 본 뒤 목록을 늘리는 것은 원래 선언한 비교와 다릅니다.

가상 훈련 (X,Y)=(0,1),(2,5)에서 μ_X=1, 범위 2, 평균 Y=3입니다. 변환 X는 ±1/2이므로 절편은 3, 기울기는 1/(1/4+λ)입니다. λ=0이면 기울기 4로 두 점을 정확히 통과합니다. λ=1이면 기울기 4/5이고 두 훈련 예측은 13/5, 17/5입니다. 기울기가 줄며 훈련 오차는 늘지만 이것이 시험 오차를 늘릴지 줄일지는 별도 관측으로 평가해야 합니다.

대학원 연결로 유일성을 확인해 봅시다. λ>0이고 양의 훈련 비중 합이 있으면 헤시안의 이차형은 예측 방향의 제곱 평균과 λ배 기울기 방향 제곱의 합입니다. 이 값이 0이려면 기울기 방향이 모두 0이고 절편 방향도 0이어야 하므로 양의 정부호입니다. 따라서 계수는 유일합니다. 설명변수가 서로 같더라도 양의 릿지 벌점이 이 문제를 해결합니다.

λ=0에서는 설계행렬의 순위가 부족하면 여러 계수가 같은 훈련 손실을 만들 수 있습니다. 실습은 자유 좌표를 0으로 둔 대표해와 영공간을 보존하고, 각 질의 예측이 모든 최소해에서 같은지도 따로 표시합니다. 대표 숫자가 나왔다고 그 예측이 자료에 의해 유일하게 정해졌다고 말하지 마세요.

A line describes how predictions change with features. Ridge fits that line while penalizing large slopes. Learn an intercept θ_0 and coefficients for training-transformed features z. The constant candidate is the training mean from section seven; ridge minimizes the following criterion.

f^λ(x)=θ0+∑j=1pθjzj(x),L(θ)=12Wtr∑i∈Itrwi(yi−θ0−zi⊤θ1:p)2+λ2∑j=1pθj2\widehat f_\lambda(x)=\theta_0+\sum_{j=1}^p\theta_jz_j(x),\qquad L(\theta)=\frac{1}{2W_{tr}}\sum_{i\in I_{tr}}w_i(y_i-\theta_0-z_i^\top\theta_{1:p})^2+\frac{\lambda}{2}\sum_{j=1}^p\theta_j^2

The intercept is unpenalized, so an overall outcome level near five is not shrunk toward zero merely because of its level. Larger λ discourages feature-dependent movement around that level. The factual candidate list fixes λ at one-hundredth, one-tenth and one before test evaluation.

Constructed training pairs (zero, one) and (two, five) have centered scaled features minus and plus one-half. The fitted intercept is three and the slope is 1/(one-quarter plus λ). At λ zero, slope four interpolates the points. At λ one, slope four-fifths gives training predictions thirteen-fifths and seventeen-fifths. Increased training error after shrinkage does not determine the direction of test error.

For a graduate bridge, examine the Hessian quadratic form. With positive λ and training weight, it is a mean squared prediction direction plus λ times squared slope directions. A zero value forces all slope directions and then the intercept direction to zero. The Hessian is positive definite, so the coefficient vector is unique even with duplicate features.

At λ zero, rank deficiency can leave multiple coefficient minimizers. The lab retains a representative with free coordinates zero, its nullspace, and a separate flag for whether each query prediction is invariant across minimizers. A returned representative prediction is not automatically identified by the data.

학부Undergraduate

세 벌점과 한 번 나누는 나무Three penalties and a one-split tree

비교 후보를 미리 적는 이유는 마음에 드는 결과가 나올 때까지 규칙을 바꾸는 일을 드러내기 위해서입니다. 이 장은 상수, 세 릿지, 한 단계 나무의 다섯 후보를 씁니다. “한 단계”는 특징 하나의 문턱으로 왼쪽·오른쪽을 한 번 나눈다는 뜻입니다. 수십 번 나누는 큰 나무나 랜덤 포리스트를 몰래 같은 이름으로 부르지 않습니다.

나무는 훈련 행에서 특징값을 정렬하고, 서로 다른 인접 값의 중간을 문턱 후보로 둡니다. 각 잎의 예측은 그 잎 훈련 결과의 가중 평균입니다. 모든 특징과 허용 문턱의 훈련 가중 제곱 손실 합을 비교합니다. 두 잎에는 양의 비중 훈련 행이 최소 다섯 개씩 있어야 합니다. 이것은 최소 행 수 조건이며, 비중 합이 다섯 이상이라는 조건과는 다릅니다.

손실이 정확히 같으면 앞 특징, 그 안에서는 작은 문턱을 유지합니다. 어떤 나눔도 상수보다 훈련 손실을 엄격하게 줄이지 못하면 나누지 않습니다. 따라서 최종 나무가 상수로 남는 것도 정상 결과입니다. 다른 분류 나무에서 쓰는 Gini 기준과 섞지 마세요. 이 장의 나무는 회귀 제곱 손실을 기준으로 하며, 이탈에서는 잎의 0/1 평균이 점수입니다.

μ^L=∑i∈LwiyiWL,μ^R=∑i∈RwiyiWR,SSE⁡(L,R)=∑i∈Lwi(yi−μ^L)2+∑i∈Rwi(yi−μ^R)2\widehat\mu_L=\frac{\sum_{i\in L}w_iy_i}{W_L},\qquad \widehat\mu_R=\frac{\sum_{i\in R}w_iy_i}{W_R},\qquad \operatorname{SSE}(L,R)=\sum_{i\in L}w_i(y_i-\widehat\mu_L)^2+\sum_{i\in R}w_i(y_i-\widehat\mu_R)^2

손계산 실습에서는 최소 잎 행 수를 1로 낮추어 세 가상 행 X=(0,1,2), Y=(0,1,0)을 봅니다. 문턱 1/2과 3/2은 모두 SSE=1/2입니다. 같은 특징에서는 앞 문턱 1/2을 유지하므로 예측은 0, 1/2, 1/2입니다. 실제 자료의 기본 최소 다섯 행 규칙과 이 작은 예제의 설정을 구별하세요.

이탈 릿지의 원 예측이 −0.1이나 1.2가 될 수 있습니다. 평가는 미리 정한 [0,1] 자르기를 적용하고 원 예측도 함께 남깁니다. 나무의 양수 비중 이진 평균은 이미 그 구간 안에 있습니다. 잘라서 성능이 달라지는 것은 명시한 예측 절차의 일부이며, 확률 보정의 증명은 아닙니다.

Predeclaring candidates makes changes in the comparison visible. We use five: a constant, three ridge models and a one-split tree. One split means one threshold on one feature, not a large tree or forest under a shorter name.

Sort training feature values and consider midpoints between distinct adjacent values. Each leaf predicts its weighted training mean. Compare weighted training SSE over all eligible features and thresholds. The factual default requires at least five positive-weight training rows in each leaf; this is a row-count constraint rather than a minimum weight mass.

Exact ties keep the first feature and then the smaller threshold. Without strict improvement over the constant, retain a constant tree. This tree uses regression squared loss, not a Gini criterion. Binary leaf means provide churn scores.

μ^L=∑i∈LwiyiWL,μ^R=∑i∈RwiyiWR,SSE⁡(L,R)=∑i∈Lwi(yi−μ^L)2+∑i∈Rwi(yi−μ^R)2\widehat\mu_L=\frac{\sum_{i\in L}w_iy_i}{W_L},\qquad \widehat\mu_R=\frac{\sum_{i\in R}w_iy_i}{W_R},\qquad \operatorname{SSE}(L,R)=\sum_{i\in L}w_i(y_i-\widehat\mu_L)^2+\sum_{i\in R}w_i(y_i-\widehat\mu_R)^2

For a constructed three-row hand calculation, set minimum leaf rows to one: X=(zero, one, two), Y=(zero, one, zero). Thresholds one-half and three-halves both yield SSE one-half. Keep the earlier threshold, giving predictions zero, one-half and one-half. This small-example setting differs from the factual default of five.

Binary ridge can produce raw scores such as minus 0.1 or 1.2. A predeclared clip into the unit interval is applied for evaluation while retaining raw predictions. Positive-weight binary leaf means already lie in that interval. Clipping is part of the procedure, not evidence of calibration.

학부 심화 · 선택Advanced undergraduate · optional

완전한 학습 절차를 함수로 기록한다Record the complete learning procedure as a function

“릿지 λ=0.1”이라는 이름만으로 같은 모형이라고 생각하기 쉽습니다. 그러나 어떤 행을 쓰는지, 평균·범위를 언제 구하는지, 목적함수를 합으로 쓰는지 평균으로 쓰는지가 다르면 같은 λ도 다른 뜻입니다. 재현할 대상은 회귀 계수 하나가 아니라 원자료에서 예측까지 이어지는 전체 함수입니다.

훈련 행 ID와 양의 비중, 완전한 X·Y를 확인한 뒤 훈련 평균·범위를 구합니다. 그 좌표로 모형을 맞추고, 같은 좌표를 모든 질의에 적용합니다. 질의는 결과 Y가 없어도 X가 완전하면 예측할 수 있습니다. 그러나 그 질의를 평가 손실에 넣으려면 관측 Y도 필요합니다. “예측 가능”과 “성능 평가 가능”은 다른 상태입니다.

합 손실과 평균 손실의 벌점 대응도 계산할 수 있습니다. 평균 SSE/2+λ||θ||²/2의 최소해는 전체 식에 2W를 곱한 SSE+Wλ||θ||²의 최소해와 같습니다. 다른 코드가 합 SSE+α||θ||²를 최소화한다면 동일 변환·동일 가중치·동일 절편 처리 아래 α=Wλ이어야 합니다. 이름만 같은 λ를 복사하는 대신 목적함수를 맞추어야 합니다.

arg⁡min⁡θ{SSE⁡(θ)2W+λ2∥θ1:p∥2}=arg⁡min⁡θ{SSE⁡(θ)+Wλ∥θ1:p∥2},W>0\arg\min_\theta\left\{\frac{\operatorname{SSE}(\theta)}{2W}+\frac{\lambda}{2}\|\theta_{1:p}\|^2\right\}=\arg\min_\theta\left\{\operatorname{SSE}(\theta)+W\lambda\|\theta_{1:p}\|^2\right\},\qquad W>0

양의 완전 훈련 행이 없으면 평균과 모형을 만들어 낼 근거가 없습니다. 이때 함수는 미정의 모형과 사유를 반환합니다. 0으로 채운 계수나 0점 위험이 나오지 않는 것이 올바른 동작입니다. 상수 특징·순위 부족·한 클래스처럼 특별한 입력도 함수의 계약에 들어 있어야 합니다.

실무 기록에는 후보별로 같은 훈련 ID 집합, 특징 순서, μ와 s, 계수 또는 문턱, 벌점, 자르기와 미정의 사유를 남깁니다. 작은 표의 손계산과 실제 전행 예측이 연결되는 고리입니다. 프로그램의 기본값이 바뀌어도 이 기록으로 같은 절차인지 판단할 수 있습니다.

The label ridge with λ equal to 0.1 does not uniquely specify a model. Training-frame rules, transformation timing and sum versus mean normalization can all change its meaning. Reproduce the full function from native data to predictions, not just a coefficient vector.

Identify positive complete training X/Y rows, learn their means/ranges, fit in those coordinates and apply the same transform to each query. A complete-X query can be predicted without Y, but evaluating its loss also requires an observed Y. Predictability and evaluability are distinct.

Penalty normalizations can be aligned algebraically. Multiplying mean SSE/2 plus λ slope norm squared/2 by positive 2W gives SSE plus Wλ slope norm squared. If another implementation minimizes sum SSE plus α slope norm squared, matching objectives requires α=Wλ under the same transform, weights and intercept treatment.

arg⁡min⁡θ{SSE⁡(θ)2W+λ2∥θ1:p∥2}=arg⁡min⁡θ{SSE⁡(θ)+Wλ∥θ1:p∥2},W>0\arg\min_\theta\left\{\frac{\operatorname{SSE}(\theta)}{2W}+\frac{\lambda}{2}\|\theta_{1:p}\|^2\right\}=\arg\min_\theta\left\{\operatorname{SSE}(\theta)+W\lambda\|\theta_{1:p}\|^2\right\},\qquad W>0

With no positive complete training rows, there is no defined mean or fitted model. Return an undefined result and a reason rather than invented zero coefficients or zero risk. Constant features, rank deficiency and single-class inputs also belong in the function’s contract.

Record shared training IDs, feature order, means and scales, coefficients or thresholds, penalties, clipping and undefined states. These records connect hand calculations with full-data predictions and identify whether a program’s changed defaults still implement the same procedure.

학부Undergraduate

검증 평균·최악 코호트·동률Validation means, worst-cohort criteria and ties

선생님이 시험을 채점하기 전에 “평균 점수”로 반을 평가할지 “가장 약한 집단의 점수”로 평가할지 정하면 두 규칙을 비교할 수 있습니다. 점수를 본 뒤 유리한 규칙으로 바꾸면 다른 문제가 됩니다. 모형 선택도 평균 위험과 최악 코호트 위험을 구별해 미리 선언합니다.

가상 검증 집단 G의 비중이 9, H의 비중이 1이고 두 행의 Y=0이라고 합시다. 후보 A 예측은 G에서 1, H에서 3이고, B는 둘 다 2입니다. A의 평균 제곱 위험은 (9×1+1×9)/10=9/5, B는 4입니다. 평균 기준이면 A를 고릅니다. 코호트별 위험 중 최댓값은 A가 9, B가 4이므로 최악 코호트 기준이면 B를 고릅니다.

가상 검증 선택의 두 기준
후보G 제곱 위험H 제곱 위험전체 비중 평균최악 코호트
A199/59
B4444

어느 쪽이 옳은지는 수학만으로 정해지지 않습니다. 평균과 집단 보호 중 어떤 목적을 정했는지에 달립니다. 최악 집단의 수치가 더 크다는 이유만으로 모집단 공정성 전체를 인증하거나 부정할 수도 없습니다. 어떤 집단을 관측했고 어떤 손실·표본 크기를 썼는지 적어야 합니다.

필수 코호트가 검증에서 하나도 평가되지 않으면 그 코호트 위험은 미정의입니다. 이를 0으로 넣어 최악값을 구하지 않습니다. 기본 최악 코호트 선택도 모든 필수 코호트의 양의 평가 비중이 있을 때만 정의됩니다. “최악”이라고 부를 집합이 비어 있는 문제를 숫자로 감추지 않는 것입니다.

검증 점수가 정확히 같은 두 후보는 선언 순서를 유지합니다. 작은 표시 자릿수에서 둘 다 0.13으로 보이는 것과 정확히 같은 위험은 다릅니다. 정확값을 펼쳐 확인하되, 모형을 고르기 위해 시험 결과를 먼저 보지 마세요. 시험은 선택 후 남겨 둔 질문에 답하는 자료입니다.

A teacher can choose in advance to evaluate a class by its average or its weakest group. Changing the rule after seeing scores is different. Likewise, declare mean-risk or worst-cohort selection before inspecting results.

In a constructed validation set, G has weight nine and H weight one; both outcomes are zero. A predicts one in G and three in H, while B predicts two in each. Mean squared risks are nine-fifths and four, selecting A. Worst-cohort risks are nine and four, selecting B.

Two criteria on the same constructed validation set
CandidateG squared riskH squared riskOverall weighted meanWorst cohort
A199/59
B4444

Mathematics alone does not choose between these objectives. State the substantive aim and which groups, losses and sample sizes were observed. A worst-group score does not certify fairness for an entire population.

A required cohort with no positive evaluable validation mass has undefined risk. Do not substitute zero. The worst-cohort criterion requires defined risks for every declared required cohort.

Exact ties keep candidate declaration order. Two risks both displayed as 0.13 need not be exactly equal; expand exact values if needed. Do not use test outcomes to resolve the selection. The test set answers a question left after selection.

대학원 연결Graduate bridge

시험 라벨이 바꾸면 안 되는 것What test labels must not change

시험지를 채점하기 전에 답안을 고쳤다면 처음 답안의 실력을 평가한 것이 아닙니다. 모형 비교에서도 시험 라벨을 보고 특징, 벌점, 문턱, 코호트 기준이나 시드를 바꾸면 새 절차를 고른 것입니다. 이름을 그대로 두어도 시험은 더 이상 처음처럼 선택과 분리되어 있지 않습니다.

작은 확인 실험을 하겠습니다. 훈련은 (X,Y)=(0,1),(2,5), 검증은 (1,3), 시험은 (1,999)로 역할을 고정합니다. 시험 Y를 −999로 바꾸어도 훈련 변환 μ=1·범위 2, 상수 3, 릿지 계수, 훈련 나무와 검증 위험은 같아야 합니다. 이 예에서 검증 동률의 첫 후보인 상수가 선택되어 선택 모형과 상수 기준선의 시험 예측은 모두 3입니다. 두 모형의 시험 제곱 손실은 각각 992,016에서 1,004,004로 바뀌지만 선택 모형 손실에서 기준선 손실을 뺀 쌍별 차이는 0으로 유지됩니다. 일반적으로 두 예측이 서로 다르면 이 차이도 시험 라벨에 따라 바뀔 수 있습니다. 시험 Y를 쓰는 보고서와 쓰지 않아야 하는 학습 부분을 구분하는 실험입니다.

이 장의 원 지문은 라벨을 제외하므로 시험 Y만 수정해도 그 값 때문에 묶음이 새로 생기지는 않습니다. 다만 특징·묶음 정의·분할 자체를 바꾸면 다른 입력 계약입니다. 고정된 시험 행의 라벨을 바꾸는 확인과 원자료 전체를 새로 분할하는 실험을 섞지 마세요.

검증 라벨은 후보 선택에 쓰므로 바뀌면 선택 후보가 바뀔 수 있습니다. 훈련 라벨은 계수와 잎 평균을 바꿀 수 있습니다. 세 역할 모두 같은 형식의 숫자라고 해서 정보 흐름까지 같은 것은 아닙니다. 계산 다이어그램으로 훈련 → 후보 함수, 검증 → 후보 선택, 시험 → 최종 보고의 화살표를 그려 보세요.

대학원 수준에서는 시험 위험이 무엇에 조건부인지도 묻습니다. 고정된 훈련·검증 결과와 선택 모형을 조건으로, 별도 시험 표본이 목표 모집단에서 적절하게 관측되었다면 그 고정 함수의 위험 추정이라는 해석을 검토할 수 있습니다. 현재 파일의 결정적 분할과 미확인 의존만으로 그 표집 가정이 증명되지는 않습니다. 이후 쌍별 민감도도 이 한계를 정직하게 이어갑니다.

Changing an answer after seeing the marking key no longer evaluates the original answer. Similarly, choosing features, penalties, thresholds, groups or seeds after test inspection defines a new procedure, even if the model’s name stays the same.

Fix roles in a constructed example: training pairs (zero, one) and (two, five), validation pair (one, three), and test pair (one, 999). Replace only test Y by minus 999. Training mean one and range two, constant three, ridge coefficients, training tree and validation risks must remain unchanged. The first declared constant wins the validation tie, so both the selected model and constant baseline predict three on this test point. Each squared loss changes from 992,016 to 1,004,004, while their paired difference stays zero. With different model predictions in another example, the difference can also change with the test label. This separates legitimate reporting from prohibited learning paths.

Native fingerprints exclude labels, so modifying only test Y does not change a group through that value. Changing predictors, grouping or the split itself is a different input contract. Do not confuse a frozen-role label check with refitting the whole splitting design.

Validation labels may change selection, while training labels may change coefficients and leaf means. Identical numeric formats do not imply identical information roles. Draw the arrows: training to candidate functions, validation to selection, test to final reporting.

At graduate level, ask what the risk estimate conditions on. Given frozen training/validation results and a selected function, a suitably sampled separate test set may estimate that function’s target risk. The deterministic file split and unknown dependence do not prove the needed sampling assumptions. Later paired sensitivity diagnostics retain this limitation.

학부 심화 · 선택Advanced undergraduate · optional

제곱·절대 손실은 다른 질문이다Squared and absolute loss answer different questions

실제값과 예측값의 차이를 오차라고 부르겠습니다. 이 장에서는 예측−관측을 잔차 방향으로 적지만, 제곱과 절댓값을 취하면 방향은 없어집니다. 제곱 손실은 큰 오차를 훨씬 크게 세고, 절대 손실은 거리 자체를 셉니다. 어느 쪽을 쓰는지가 “가장 좋은 예측”의 뜻을 바꿉니다.

가상 후보 A의 두 오차가 0, 3이고 B의 오차는 2, 2입니다. A의 MAE는 3/2로 B의 2보다 작지만, MSE는 9/2로 B의 4보다 큽니다. “두 지표를 보았더니 다른 후보가 이겼다”는 결과는 모순이 아닙니다. 한 번의 큰 오차와 두 번의 중간 오차 중 무엇을 더 크게 벌할지 다르게 정한 것입니다.

MSE⁡=∑iwi(y^i−yi)2W,MAE⁡=∑iwi∣y^i−yi∣W,W=∑iwi>0\operatorname{MSE}=\frac{\sum_iw_i(\widehat y_i-y_i)^2}{W},\qquad\operatorname{MAE}=\frac{\sum_iw_i|\widehat y_i-y_i|}{W},\qquad W=\sum_iw_i>0

단위도 구분하세요. 임금 수준을 원으로 예측했다면 MAE는 원, MSE는 원의 제곱입니다. 이 장의 NLS 결과는 로그 임금이므로 로그 점과 로그 점의 제곱입니다. MSE의 제곱근인 RMSE는 다시 결과와 같은 숫자 단위를 갖지만, 표에 MSE라고 쓰고 제곱근 값을 넣으면 다른 지표를 보고한 셈입니다.

비중은 확률처럼 합이 1이어야 할 필요가 없습니다. 1,3과 10,30은 같은 평균 위험을 줍니다. 비중 합으로 나누기 때문입니다. 반면 원행 수와 가중 질량은 다르므로 “평가 2행, 총 비중 4”처럼 함께 적어야 합니다. 비중 0인 행도 원기록과 입력 검증에서는 남기되 위험의 분모에는 넣지 않습니다.

상수 예측의 모집단 최적값을 더 공부한다면, 유한한 2차 모멘트 아래 제곱 손실은 조건부 평균을, 유한한 1차 절대모멘트 아래 절대 손실은 조건부 중앙값을 목표로 한다는 연결을 볼 수 있습니다. 작은 표의 평균 오차만 바꾸는 일이 어떤 통계적 대상을 바꾸는지도 생각해 보세요.

Call prediction minus observation the signed error. Squared and absolute losses remove its sign but penalize magnitude differently. Squaring amplifies large errors; absolute loss counts distance. The chosen rule changes what best prediction means.

Constructed errors zero and three for A give MAE three-halves and MSE nine-halves. Errors two and two for B give both MAE two and MSE four. A wins by MAE, B by MSE. This is not a contradiction: the criteria price a large miss differently from two moderate misses.

MSE⁡=∑iwi(y^i−yi)2W,MAE⁡=∑iwi∣y^i−yi∣W,W=∑iwi>0\operatorname{MSE}=\frac{\sum_iw_i(\widehat y_i-y_i)^2}{W},\qquad\operatorname{MAE}=\frac{\sum_iw_i|\widehat y_i-y_i|}{W},\qquad W=\sum_iw_i>0

MAE has outcome units and MSE squared outcome units. Here NLS uses log points and squared log points. RMSE takes the square root to return to the outcome’s numeric units; do not label that value MSE.

Weights need not sum to one: one and three yield the same mean risk as ten and thirty. Record row count and weight mass separately. Zero-weight rows remain in the source and input checks but contribute no evaluation mass.

For a population bridge, finite second moments connect squared-loss-optimal predictions to conditional means. Finite first absolute moments connect absolute-loss-optimal predictions to conditional medians. A change of loss can therefore change the statistical target, not merely the appearance of a score.

학부Undergraduate

상수 결과에서 R²가 사라지는 이유Why R-squared is undefined for a constant outcome

R²는 보통 “전체 점수의 몇 퍼센트를 맞혔다”는 뜻으로 오해되지만 그런 정확도 비율이 아닙니다. 같은 평가 집합에서 실제 Y의 평균을 기준으로 한 변동 SST와 모형의 오차 SSE를 비교하는 지표입니다. 원자료가 어떤 역할인지와 어떤 비중인지에 따라 그 평가 평균도 달라집니다.

y‾I=∑i∈IwiyiWI,SST⁡I=∑i∈Iwi(yi−y‾I)2,RI2=1−SSE⁡ISST⁡I,SST⁡I>0\overline y_I=\frac{\sum_{i\in I}w_iy_i}{W_I},\quad \operatorname{SST}_I=\sum_{i\in I}w_i(y_i-\overline y_I)^2,\quad R_I^2=1-\frac{\operatorname{SSE}_I}{\operatorname{SST}_I},\quad \operatorname{SST}_I>0

실제 Y가 2,2로 모두 같다면 평가 평균도 2이고 SST=0입니다. 예측이 2,3이면 SSE=1이지만 1/0을 계산할 수 없습니다. 예측이 2,2로 완벽해도 비율은 0/0입니다. MSE 0으로 완벽한 제곱 예측이라는 사실을 보고하면서도 R²는 미정의로 둘 수 있습니다. 미정의가 곧 모형 실패나 0점이라는 뜻은 아닙니다.

SST가 양수여도 시험 R²는 음수일 수 있습니다. 실제 Y=(0,2), 예측=(4,4)이면 평가 평균 1, SST=2, SSE=20이므로 R²=−9입니다. 이것은 확률이 −9라는 뜻이 아니라, 그 평가 집합의 평균 상수보다 SSE가 열 배라는 뜻입니다. 음수값을 0으로 잘라 예쁘게 보이면 성능 악화를 숨깁니다.

주의할 점은 평가 평균 기준의 SST가 S7에서 학습한 훈련 평균 상수의 시험 SSE와 같지 않을 수 있다는 것입니다. R²의 분모에는 평가 집합 평균을 사용하지만 그 평균을 실제 예측 모형으로 학습에 되돌려 쓰지는 않습니다. “훈련 상수 대비 개선율”을 보고하려면 별도의 훈련 상수 시험 손실을 분모로 정의해야 합니다.

한 클래스만 있는 이탈 집합도 Y의 분산이 0이므로 R²가 미정의입니다. 아래에서 볼 AUROC의 두 클래스 조건과 각각 구별하되, 공통적으로 필요한 분모가 없으면 숫자를 만들어 넣지 않는다는 원칙을 유지합니다.

R-squared is not the percentage of answers correctly predicted. It compares model SSE with outcome variation SST around the mean of the same evaluation frame. That frame’s role and weights define its mean.

y‾I=∑i∈IwiyiWI,SST⁡I=∑i∈Iwi(yi−y‾I)2,RI2=1−SSE⁡ISST⁡I,SST⁡I>0\overline y_I=\frac{\sum_{i\in I}w_iy_i}{W_I},\quad \operatorname{SST}_I=\sum_{i\in I}w_i(y_i-\overline y_I)^2,\quad R_I^2=1-\frac{\operatorname{SSE}_I}{\operatorname{SST}_I},\quad \operatorname{SST}_I>0

Observed outcomes two and two give SST zero. Predictions two and three yield SSE one, but division by zero is undefined. Even perfect predictions give a zero-over-zero ratio. Report perfect MSE zero while retaining undefined R-squared. Undefined is not a score of zero.

Test R-squared may be negative when SST is positive. Outcomes zero and two with predictions four and four give SST two and SSE twenty, hence minus nine. This means ten times the evaluation-mean baseline SSE, not a negative probability. Clipping it to zero hides poor performance.

Evaluation SST need not equal the test SSE of the frozen training-mean baseline. Using an evaluation mean in a descriptive denominator does not authorize feeding it back into training. Define a separate skill ratio if the desired denominator is the training-baseline test loss.

A single-class churn frame also has zero outcome variation. Distinguish this R-squared condition from AUROC’s two-class requirement while retaining the common rule: do not invent a value when its denominator is absent.

학부Undergraduate

순서를 유지해도 숫자 손실은 달라진다Order-preserving recoding changes numeric loss

길이를 센티미터에서 미터로 바꾸면 숫자는 달라도 물리량은 같은 규칙으로 변환됩니다. 순서형 점수에서는 더 넓은 문제가 생깁니다. 순서만 보존하는 변환은 많지만 그 간격이 모두 같지 않기 때문입니다. 품질 5,6,7을 25,36,49로 바꾸어도 순서는 유지되지만 예측 오차의 제곱은 변합니다.

가상으로 실제 5를 6으로 예측한 경우와 실제 6을 7로 예측한 경우를 비교하세요. 원 숫자에서는 두 제곱 손실이 모두 1입니다. 점수와 예측을 모두 제곱하여 다시 쓰면 첫 차이는 36−25=11, 둘째는 49−36=13이므로 손실은 121과 169입니다. 따라서 단순한 순서 보존만으로 제곱 위험의 비교가 불변인 것은 아닙니다.

가상 점수 재표기의 효과
실제→예측원 제곱 손실제곱 재표기의 차이재표기 후 제곱 손실
5→6111121
6→7113169

이 예는 이 장의 실제 타깃을 제곱해서 바꾸자는 제안이 아닙니다. 원 품질 숫자를 그대로 쓰는 손실 규칙이 무엇을 가정하는지 드러내는 확인입니다. 실제 후보를 새 척도로 다시 학습하면 학습 문제 자체도 달라집니다. 같은 예측의 재표기 실험과 새 타깃으로 재학습한 실험을 구분하세요.

순서형 분류나 “한 점 이내” 비율을 보조 지표로 만들 수도 있습니다. 다만 보조 규칙도 관측 가능한 점수에서 계산하는 것이지 소비자 만족의 참척도가 아닙니다. 여러 지표 중 마음에 드는 결과만 남기지 말고 주요 선택 지표와 보조 진단을 구분해 보고합니다.

국가 맥락의 실무 설명에서는 포르투갈 시음 평가를 다른 나라 소비자 선호로 곧바로 옮기지 않습니다. 원자료는 화학 측정과 전문가 점수의 특정 관측 범위입니다. 산업에 도움 될 가능성과 소비자·시기 이동에서 검증된 효과는 다른 주장입니다.

Changing centimeters to meters transforms a physical scale by a known factor. Ordinal scores permit many order-preserving recodings with different spacings. Squaring scores five, six and seven preserves order but changes numeric prediction losses.

For constructed predictions five to six and six to seven, both original squared losses are one. Squaring both observed and predicted scores gives gaps eleven and thirteen, hence losses 121 and 169. Order preservation alone does not make squared-risk comparisons invariant.

A constructed score recoding
Observed to predictedOriginal squared lossRecoded gapRecoded squared loss
5 to 6111121
6 to 7113169

This is a diagnostic of the declared numeric convention, not a proposal to replace the factual target. Refitting models on a new target scale also changes the learning problem. Distinguish recoding fixed predictions from training a new procedure.

Ordinal classification or a within-one-point rate could be auxiliary criteria, but neither automatically measures true consumer satisfaction. Predeclare the primary selection criterion and report auxiliary diagnostics without retaining only favorable ones.

The Portugal industry context does not transport expert tasting results directly to consumers elsewhere. The data cover a specified chemical/sensory setting. Possible industrial usefulness differs from demonstrated effects across populations and time.

학부Undergraduate

Brier 점수·자르기·0.5 문턱Brier loss, clipping and the half-probability threshold

이탈 여부 Y는 0또는 1입니다. 점수 p를 0과 1 사이에 두고 (p−Y)²를 평균내면 이 장에서 쓰는 한 성분 Brier 손실입니다. 예를 들어 Y=1에 p=0.8이면 손실은 0.04이고, Y=0에 같은 p면 0.64입니다. 실제 라벨에 가까운 점수를 작게 벌합니다. 어떤 자료에서는 두 클래스의 성분을 합한 정의를 쓰기도 하므로 이 장의 한 성분 규칙을 명시합니다.

Brier⁡=∑iwi(pi−yi)2W,p~i=min⁡(1,max⁡(0,f^i)),c^i=1{p~i≥1/2}\operatorname{Brier}=\frac{\sum_iw_i(p_i-y_i)^2}{W},\qquad \widetilde p_i=\min(1,\max(0,\widehat f_i)),\qquad \widehat c_i=\mathbf1\{\widetilde p_i\geq1/2\}

기본 릿지 원값 f가 구간 밖이면 p로 자르고 원값도 보존합니다. Y가 0또는 1이므로 그 구간으로의 사영은 각 행의 제곱 거리를 늘리지 않습니다. 원값이 음수면 0이 두 가능한 결과 모두에 더 가깝고, 1보다 크면 1이 더 가깝기 때문입니다. 이 사실은 제곱 손실에 대한 기하학적 성질이지 확률 보정의 증명이 아닙니다.

분류는 점수를 라벨 하나로 바꾸는 다른 단계입니다. 이 장의 실제 비교는 정확한 p≥1/2이면 1, 아니면 0으로 정합니다. 실제 p가 1/2보다 조금 작지만 화면 반올림으로 0.5처럼 보여도 분류는 0입니다. 표시된 반올림 숫자로 다시 비교하면 계산 결과를 바꿀 수 있습니다.

Brier는 같아도 문턱 분류의 결과가 다를 수 있고, 같은 분류 라벨이라도 Brier는 다를 수 있습니다. Y=1에 p=0.51과 0.99는 둘 다 문턱 0.5에서 1이지만 제곱 손실은 0.2401과 0.0001입니다. 분류표만으로 점수의 수치 정확도를 모두 읽을 수 없는 이유입니다.

업무 비용이나 목표가 달라 문턱을 바꿀 수는 있습니다. 그때는 문턱도 검증에서 정할 선택 규칙으로 기록하고, 최종 시험을 본 뒤 가장 좋아 보이는 문턱만 보고하지 않습니다. 기본 0.5 규칙과 새 문턱 실험의 결과를 구분하세요.

Churn Y is zero or one. Averaging (p−Y) squared for scores in the unit interval gives our one-component Brier loss. Score 0.8 incurs loss 0.04 at Y one and 0.64 at Y zero. Some definitions sum two class components, so state the convention used here.

Brier⁡=∑iwi(pi−yi)2W,p~i=min⁡(1,max⁡(0,f^i)),c^i=1{p~i≥1/2}\operatorname{Brier}=\frac{\sum_iw_i(p_i-y_i)^2}{W},\qquad \widetilde p_i=\min(1,\max(0,\widehat f_i)),\qquad \widehat c_i=\mathbf1\{\widetilde p_i\geq1/2\}

Clip raw ridge predictions to the unit interval while retaining the raw values. Projection cannot increase squared distance to either binary outcome: zero is closer than a negative prediction, and one is closer than a prediction above one. This geometric fact does not establish probability calibration.

Classification is a separate step. The factual default predicts class one at exact p at least one-half. A value just below one-half may display as 0.5 after rounding, but its class remains zero. Reclassifying the displayed approximation would change the calculation.

For Y one, scores 0.51 and 0.99 both predict class one yet have Brier losses 0.2401 and 0.0001. A confusion table therefore cannot reveal all numeric score accuracy.

Alternative operational thresholds may be appropriate, but record their validation-selection rule before final testing. A threshold chosen after examining test performance is a new selection step. Keep it separate from the predeclared half-threshold comparison.

학부 심화 · 선택Advanced undergraduate · optional

혼동 행렬의 질량과 행 수Confusion masses and record counts

실제 이탈이 1인데 예측도 1이면 참양성 TP, 실제 0인데 예측 1이면 거짓양성 FP입니다. 실제 0·예측 0은 TN, 실제 1·예측 0은 FN입니다. “양성”은 여기서 이탈 라벨 1이라는 뜻이지 좋은 결과라는 뜻이 아닙니다. 용어를 일상적인 좋음·나쁨과 섞지 마세요.

같은 네 칸을 원행 개수로 셀 수도 있고 분석 비중의 합으로 셀 수도 있습니다. 비중 4인 참음성 한 행은 행 수 TN=1, 가중 질량 TN=4입니다. 표에 행과 비중을 함께 적어야 비율의 분모를 확인할 수 있습니다. 원자료의 기본은 단위 비중이라 둘이 같지만 일반 실습에서는 다를 수 있습니다.

TPR⁡=TPTP+FN,TNR⁡=TNTN+FP,Precision⁡=TPTP+FP,BalancedAccuracy⁡=TPR⁡+TNR⁡2\operatorname{TPR}=\frac{TP}{TP+FN},\quad\operatorname{TNR}=\frac{TN}{TN+FP},\quad\operatorname{Precision}=\frac{TP}{TP+FP},\quad\operatorname{BalancedAccuracy}=\frac{\operatorname{TPR}+\operatorname{TNR}}{2}

이탈 고객이 매우 적으면 모두 “남는다”라고 예측해도 전체 정확도가 높을 수 있습니다. 그러나 실제 이탈자의 탐지율 TPR은 0입니다. 균형 정확도는 두 클래스의 재현율을 같은 비중으로 평균내므로 다른 질문에 답합니다. 그렇다고 균형 정확도가 실제 연락 비용을 자동 반영하는 것은 아닙니다.

실제 양성이 없으면 TPR은 미정의, 실제 음성이 없으면 TNR은 미정의입니다. 예측 양성이 하나도 없으면 precision의 분모가 0입니다. 빈 분모를 0이나 1로 임의 대체하면 “평가 불가”를 실패나 성공으로 바꾸게 됩니다. 이 장은 그 상태와 사유를 그대로 보여 줍니다.

문턱의 비용 해석은 추가 가정이 필요합니다. 보정된 이탈 확률 p와 일정한 거짓양성 비용 C_FP·거짓음성 비용 C_FN만 비교한다면 양성 행동의 기대 손실은 (1−p)C_FP, 음성 행동은 pC_FN입니다. 양성 선택의 문턱은 C_FP/(C_FP+C_FN)입니다. 실제 자료에는 이 비용·행동 효과가 없으므로 아래 식을 관측된 최적 유지 정책이라고 부르지 않습니다.

(1−p)CFP≤pCFN ⟺ p≥CFPCFP+CFN,CFP,CFN>0(1-p)C_{FP}\leq pC_{FN}\ \Longleftrightarrow\ p\geq\frac{C_{FP}}{C_{FP}+C_{FN}},\qquad C_{FP},C_{FN}>0

True positive means observed churn one and predicted class one; false positive means observed zero and predicted one. True and false negatives complete the table. Positive names the target label, not a favorable customer outcome.

Count records or sum analysis weights in each cell. One true-negative record with weight four contributes record count one and mass four. Unit factual weights make the two equal, but editable weighted examples need both.

TPR⁡=TPTP+FN,TNR⁡=TNTN+FP,Precision⁡=TPTP+FP,BalancedAccuracy⁡=TPR⁡+TNR⁡2\operatorname{TPR}=\frac{TP}{TP+FN},\quad\operatorname{TNR}=\frac{TN}{TN+FP},\quad\operatorname{Precision}=\frac{TP}{TP+FP},\quad\operatorname{BalancedAccuracy}=\frac{\operatorname{TPR}+\operatorname{TNR}}{2}

Predicting no churn for everyone can have high accuracy when departures are rare, while positive recall is zero. Balanced accuracy averages class recalls equally. It answers a different question and still does not automatically encode contact costs.

Without observed positives, TPR is undefined; without negatives, TNR is undefined. Without predicted positives, precision has zero denominator. Preserve these states rather than converting unavailable evaluation into arbitrary success or failure.

A cost threshold requires additional assumptions. For calibrated probability p and constant false-positive/false-negative costs only, positive action has expected loss (1−p)C_FP and negative action pC_FN. The threshold follows below. Neither these costs nor intervention effects are observed in the factual source, so this is not an empirically established optimal retention policy.

(1−p)CFP≤pCFN ⟺ p≥CFPCFP+CFN,CFP,CFN>0(1-p)C_{FP}\leq pC_{FN}\ \Longleftrightarrow\ p\geq\frac{C_{FP}}{C_{FP}+C_{FN}},\qquad C_{FP},C_{FN}>0
학부 심화 · 선택Advanced undergraduate · optional

가중 AUROC·동률·없는 클래스Weighted AUROC, ties and absent classes

점수 순위가 실제 이탈자를 비이탈자보다 앞에 두는지 보려면 양성 한 행과 음성 한 행을 비교할 수 있습니다. 양성 점수가 높으면 1, 같으면 1/2, 낮으면 0을 줍니다. 이런 쌍을 비중 곱으로 평균낸 것이 이 장의 가중 AUROC입니다. 점수가 같은 경우를 모두 성공으로 세거나 삭제하면 다른 정의가 됩니다.

AUC⁡=∑i:yi=1∑j:yj=0wiwj(1{pi>pj}+121{pi=pj})W+W−,W+W−>0\operatorname{AUC}=\frac{\sum_{i:y_i=1}\sum_{j:y_j=0}w_iw_j\left(\mathbf1\{p_i>p_j\}+\frac12\mathbf1\{p_i=p_j\}\right)}{W_+W_-},\qquad W_+W_->0

가상으로 양성 p=0.8의 비중이 2이고, 음성 p=0.3·0.8의 비중은 각각 1이면 쌍의 분모는 2×2=4입니다. 낮은 음성과의 승리 비중이 2, 동률의 절반 비중이 1이므로 AUC=3/4입니다. 이 수치는 문턱 0.5의 TP·FP 개수만으로는 구할 수 없습니다.

양성이나 음성이 아예 없으면 비교할 종류의 쌍이 없으므로 AUC는 미정의입니다. 이를 “무작위 수준이니 0.5”로 넣지 않습니다. 0.5라는 기회 수준 해석도 두 클래스와 점수 법칙에 대한 조건 속에서 성립하는 다른 주장입니다.

엄격히 증가하는 점수 변환은 순위와 동률을 보존하므로 AUC를 바꾸지 않습니다. 그러나 Brier는 값의 거리까지 보기 때문에 바뀔 수 있습니다. 실제 보정 확률과 점수의 순위 능력을 구별하세요. 구간 자르기는 서로 다른 극단 점수를 같은 0또는 1로 합칠 수 있으므로 엄격 증가 변환과도 다릅니다.

이 장은 표에 AUC와 Brier, 고정 문턱 혼동표를 함께 둡니다. 서로를 대체하는 반복 지표가 아니라 순위·수치 오차·행동 분류의 다른 관점을 제공하기 때문입니다. 작은 특정 코호트에서 한 클래스가 사라지면 그 미정의도 보고 내용입니다.

Compare one positive record with one negative record. Award one if the positive score is higher, one-half for a tie and zero otherwise. Averaging with pair weights gives our weighted AUROC. Dropping ties or counting them as full wins defines a different quantity.

AUC⁡=∑i:yi=1∑j:yj=0wiwj(1{pi>pj}+121{pi=pj})W+W−,W+W−>0\operatorname{AUC}=\frac{\sum_{i:y_i=1}\sum_{j:y_j=0}w_iw_j\left(\mathbf1\{p_i>p_j\}+\frac12\mathbf1\{p_i=p_j\}\right)}{W_+W_-},\qquad W_+W_->0

A constructed positive score 0.8 has weight two; negative scores 0.3 and 0.8 each have weight one. Total pair mass is four. Winning mass two plus tie credit one gives AUC three-quarters. A confusion table at threshold 0.5 alone does not determine it.

With either class absent, no positive-negative comparison exists and AUC is undefined, not an automatically assigned chance score of one-half.

A strictly increasing score transform preserves rankings and ties, hence AUC. It may change Brier loss because numeric distances change. Clipping is not strictly increasing: it can collapse distinct extreme scores into ties at zero or one.

Report AUC, Brier and fixed-threshold confusion diagnostics together as views of ranking, numeric error and classification. A small cohort losing a class has an undefined diagnostic worth reporting, not a cell to hide.

학부Undergraduate

전체 평균은 코호트 구성의 영향을 받는다Overall risk depends on cohort composition

두 반 중 학생이 많은 반의 점수가 학교 평균에 더 큰 영향을 줍니다. 전체 위험도 코호트별 위험을 해당 코호트의 평가 비중으로 평균낸 값입니다. 두 모형이 같은 코호트에서 어떤 성능인지와 평가 집합의 코호트 구성이 함께 전체 수치를 만듭니다.

RI=∑g∈GWI,gWIRI,g,WI,g>0 for each included group,∑gWI,g=WIR_I=\sum_{g\in\mathcal G}\frac{W_{I,g}}{W_I}R_{I,g},\qquad W_{I,g}>0\text{ for each included group},\quad \sum_gW_{I,g}=W_I

실제 와인 시험은 적포도주 384행과 백포도주 1,230행입니다. 그래서 두 코호트 위험을 단순히 반씩 더한 수치가 전체 MSE와 같다고 가정하면 안 됩니다. 이 장은 원행 비중 1의 전체 위험과 각각의 위험을 구분합니다. 두 종류를 반씩 중요하게 보는 별도 목표가 있다면 그 분석 비중을 새로 선언해야 합니다.

NLS에서는 교육 12년 이하와 초과를, 이탈에서는 원 요금제 코드를 기준으로 진단합니다. 이 코호트가 모든 중요한 사회적 집단을 대표한다거나 코호트 차이가 차별의 인과 효과라는 주장은 하지 않습니다. 관측된 집단의 크기·원 변수 정의·손실 단위를 함께 읽어야 합니다.

가상의 G·H가 비중 9대1이고 위험이 1과9면 전체는 9/5입니다. 같은 집단별 모형 성능을 두고 새 적용 집단이 비중 1대9라면 전체 위험은 41/5로 바뀝니다. 모형이 바뀌지 않아도 구성이 달라 전체 점수가 움직일 수 있습니다. 물론 실제 이동에서 집단 안의 성능도 유지된다고 보장하는 것은 또 다른 가정입니다.

실제 표에서는 낮은 전체 손실만 보고 가장 작은 코호트를 생략하지 마세요. 양의 평가 질량이 없는 코호트는 미정의로 남깁니다. 관측되지 않은 집단의 위험을 전체 평균으로 대신 채우는 것은 직접 관측한 집단 성능이 아닙니다.

A larger class contributes more to a school-wide average. Overall risk similarly averages cohort risks by their evaluation weight masses. Both within-cohort performance and cohort composition determine the result.

RI=∑g∈GWI,gWIRI,g,WI,g>0 for each included group,∑gWI,g=WIR_I=\sum_{g\in\mathcal G}\frac{W_{I,g}}{W_I}R_{I,g},\qquad W_{I,g}>0\text{ for each included group},\quad \sum_gW_{I,g}=W_I

The factual wine test frame has 384 red and 1,230 white records. Half-and-half averaging of their risks is not the overall unit-row-weight MSE. A separate objective valuing types equally would require separately declared weights.

NLS diagnostics use schooling at most twelve versus above twelve; churn uses native tariff categories. These groups do not represent every important social grouping, and their loss differences are not identified causal discrimination effects. Read sizes, definitions and units together.

Hypothetical group risks one and nine with masses nine-to-one give overall risk nine-fifths. With the same within-group risks and masses one-to-nine, it becomes forty-one-fifths. Composition alone can change the score. Whether within-group risks actually transport is a further assumption.

Do not suppress a small cohort because overall loss is low. Preserve undefined risks for cohorts with no positive evaluation mass. Filling their cells with the overall mean is not observing their performance.

학부 심화 · 선택Advanced undergraduate · optional

후보별 결측과 공통 완전 집합Candidate missingness and a common complete frame

한 후보가 어려운 고객에게만 예측을 내지 않는다면 남은 행의 평균은 좋아 보일 수 있습니다. 후보마다 자기만의 완전 집합에서 위험을 계산해 순위를 매기면 모형 차이와 평가 대상 차이가 섞입니다. 선택에는 모든 후보의 예측과 Y가 있는 같은 양의 비중 집합을 사용합니다.

공통 평가 가능 조건은 활성 역할, 양의 비중, 관측 Y, 모든 후보의 예측입니다. 같은 행이라도 원행, 예정 역할, 완전 분석 역할, 후보별 예측 가능성, 공통 평가 가능성은 별도 필드입니다. 이 여러 상태를 0또는 1 하나로 합치면 왜 행이 빠졌는지 읽을 수 없습니다.

Icommon,r={i:role⁡i=r, wi>0, yi observed, y^i(m) defined for every m}I_{common,r}=\{i:\operatorname{role}_i=r,\ w_i>0,\ y_i\text{ observed},\ \widehat y_i^{(m)}\text{ defined for every }m\}

NLS의 라벨 결측 행도 X가 완전하면 고정된 모형은 예측할 수 있습니다. 그런 예측을 원행 장부에 남기는 것은 유용합니다. 그러나 실제 라벨이 없으므로 관측 오차·정답 여부·경험 위험을 계산한 행처럼 세지 않습니다. 예측이 없는 상태와 라벨이 없는 상태의 사유도 구분합니다.

공통 집합을 쓰면 그 제한된 집합에서 후보 위험은 비교할 수 있습니다. 하지만 한 후보가 많은 행을 빠뜨려 공통 집합이 아주 작아지면 원래 업무 질문을 충분히 평가하지 못합니다. 원행 대비 예측 비율, 라벨 관측 비율, 공통 평가 비율을 함께 보고하고 필요하면 최소 제공 범위를 미리 제약으로 정합니다. 작은 공통 집합의 위험 0을 전체 업무 성공으로 포장하지 않습니다.

일반 λ=0 실습에서는 예측이 대표 최소해에 따라 달라질 수도 있습니다. 계산된 대표값을 평가한 숫자와 모든 최소해에서 유일한 예측이라는 조건을 구분해야 합니다. 이 장의 실제 기본 릿지는 양의 λ를 사용하여 그 계수 유일성 조건을 충족하지만, 실습의 경계 상태를 사라지게 숨기지는 않습니다.

A candidate refusing only difficult customers can look strong on its remaining rows. Ranking candidate-specific complete-case risks mixes model differences with evaluation-population differences. Selection instead uses common positive-weight rows with observed labels and predictions from every candidate.

The common condition is an active role, positive weight, observed Y and defined predictions for all candidates. Native record status, planned role, complete analysis role, individual predictability and common evaluability are distinct fields, not one interchangeable flag.

Icommon,r={i:role⁡i=r, wi>0, yi observed, y^i(m) defined for every m}I_{common,r}=\{i:\operatorname{role}_i=r,\ w_i>0,\ y_i\text{ observed},\ \widehat y_i^{(m)}\text{ defined for every }m\}

An NLS row with missing Y can still receive a prediction when X is complete. Retain that prediction in the source ledger, but do not count it as an observed error or empirical-risk record. Missing prediction and missing label are separate reasons.

Common-frame risks compare candidates on that restricted frame. If a candidate’s missing predictions shrink it severely, the original task remains poorly evaluated. Report prediction coverage, label availability and common evaluation coverage, and predeclare minimum coverage if needed. A tiny-frame risk of zero is not whole-task success.

Generic zero-penalty labs may return a representative prediction that varies across coefficient minimizers. Its computed risk differs from claiming that prediction is invariant across all minimizers. Positive factual ridge penalties ensure coefficient uniqueness here, while the generic boundary remains visible.

학부Undergraduate

실제 적·백포도주 결과를 함께 읽기Read the factual red and white wine results together

이제 가상 숫자에서 실제 기본 비교로 돌아갑니다. 검증 MSE가 고른 후보는 λ=1/100 릿지입니다. 원행을 보존한 시험 집합은 적포도주 384행·백포도주 1,230행, 합계 1,614행입니다. 아래 수치는 이 분할·특징 12개·다섯 사전 후보·선택 규칙의 결과이며 원 와인 논문에 실린 다른 모형의 성능을 옮겨 적은 것이 아닙니다.

실제 기본 와인 시험 MSE · 숫자는 반올림
후보적포도주 384행백포도주 1,230행전체 1,614행
훈련 평균 상수0.678626510.799264140.77056225
검증 선택 ridge λ=0.010.416505130.613379250.56653931

전체 열은 두 종류를 반반 더한 값이 아니라 384/1,614와 1,230/1,614의 비중으로 합친 위험입니다. 이 시험에서는 선택 모형의 MSE가 두 종류와 전체에서 모두 상수보다 작습니다. 동시에 백포도주의 오차가 적포도주보다 큽니다. 이 차이를 “백포도주 생산이 더 어렵다”거나 “전문가가 틀렸다”는 원인 설명으로 바로 바꿀 수는 없습니다.

두 종류의 결과 분포·표본 범위·설명 변수와 선형 관계의 적합도 등이 다를 수 있습니다. 이 표는 그 원인들을 각각 분리한 실험이 아닙니다. 통계 비교에서 발견한 차이를 새로운 내용 질문으로 바꾸되 관측한 범위를 넘어서 확정하지 않는 것이 전문가의 태도입니다.

세 릿지와 나무의 모든 검증·시험 위험도 후반 핵심 표에 함께 둡니다. 여기서 두 줄만 고른 것은 미리 정한 상수 기준선과 검증 선택 후보의 직접 비교를 읽기 위해서입니다. 시험에서 가장 좋아 보이는 후보를 다시 선택했다는 뜻이 아닙니다. 표 제목의 단위와 “검증 선택”을 빠뜨리지 마세요.

Return from teaching numbers to the factual baseline. Validation MSE selects ridge with λ one-hundredth. The preserved test frame contains 384 red and 1,230 white records, totaling 1,614. These are results of this chapter’s split, twelve inputs, five candidates and selection rule, not scores copied from the original paper’s other models.

Factual baseline wine test MSE, rounded
CandidateRed: 384 rowsWhite: 1,230 rowsAll: 1,614 rows
Training-mean constant0.678626510.799264140.77056225
Validation-selected ridge λ=0.010.416505130.613379250.56653931

The overall column weights types by 384/1,614 and 1,230/1,614, not equally. The selected model beats the constant on both types and overall in this test frame. White-wine loss remains higher. That does not establish that white-wine production is harder or that assessors were wrong.

Outcome distributions, sample scope and the suitability of linear relationships can differ. This table does not separately identify those explanations. Turn a diagnostic difference into a further substantive question rather than a proved cause.

Later core tables retain validation and test risks for every candidate. These two rows focus on the predeclared baseline and the validation-selected model; they do not select a new model by test performance. Preserve units and the validation-selected qualifier.

학부Undergraduate

같은 행에서 손실을 뺀다Subtract losses on the same record

평균 두 개를 나란히 놓는 것보다, 같은 대상에서 어느 모형이 얼마나 더 틀렸는지 보면 비교를 더 분명하게 읽을 수 있습니다. 후보 A의 손실에서 후보 B의 손실을 뺀 d_i를 만듭니다. 양수는 A가 더 큰 손실, 음수는 A가 더 작은 손실입니다. 손실이 작을수록 좋다는 방향을 먼저 확인하세요.

di=ℓ(yi,y^iA)−ℓ(yi,y^iB),Δ^=∑i∈IwidiWI=R^A(I)−R^B(I)d_i=\ell(y_i,\widehat y_i^A)-\ell(y_i,\widehat y_i^B),\qquad\widehat\Delta=\frac{\sum_{i\in I}w_id_i}{W_I}=\widehat R_A(I)-\widehat R_B(I)

등식의 마지막 연결은 두 후보가 같은 Y·같은 양의 비중·같은 평가 집합을 사용할 때 성립합니다. 후보별로 다른 결측 집합을 쓰고 평균을 빼면 이 같은 행의 평균 차이가 아닐 수 있습니다. 그래서 S24의 공통 집합을 먼저 고정합니다.

가상 두 행에서 Y=0이고 A 예측이 1,1, B 예측이 2,0이면 제곱 손실 차이는 −3,1입니다. 단위 비중 평균은 −1이므로 전체적으로 A 손실이 작지만 둘째 행에서는 A가 더 틀립니다. 전체 평균 개선이 모든 관측의 개선을 뜻하지 않는다는 사실을 행 수준에서 볼 수 있습니다.

실제 기본 와인의 선택 모형 대 상수 평균 차이는 약 −0.20402294 품질 점수의 제곱입니다. 이는 같은 1,614시험 행에서 0.56653931−0.77056225를 정밀하게 계산한 차이입니다. 이를 와인 가치의 인과 효과, 매출 개선율, 모든 새 표본의 보장으로 부르지 않습니다.

쌍이라는 말은 두 번 측정한 잠재 결과나 개입 전후가 아니라, 같은 관측 라벨에 대한 두 모형의 손실이라는 뜻입니다. 앞 장 인과 분석의 처리·비처리 잠재 결과와 섞어 쓰지 마세요.

Beyond two average scores, compare how much more each model loses on the same record. Define d_i as A’s loss minus B’s. Positive means A is worse, negative A is better, because lower loss is preferred.

di=ℓ(yi,y^iA)−ℓ(yi,y^iB),Δ^=∑i∈IwidiWI=R^A(I)−R^B(I)d_i=\ell(y_i,\widehat y_i^A)-\ell(y_i,\widehat y_i^B),\qquad\widehat\Delta=\frac{\sum_{i\in I}w_id_i}{W_I}=\widehat R_A(I)-\widehat R_B(I)

The final equality requires identical labels, weights and evaluation frame. Candidate-specific missingness can invalidate that same-record interpretation. Freeze the common frame first.

For constructed outcomes zero and zero, A predicts one and one while B predicts two and zero. Squared-loss differences are minus three and one, averaging minus one. A wins overall but loses on the second record. Aggregate improvement does not mean every record improved.

The factual wine selected-minus-constant difference is approximately minus 0.20402294 squared quality-score units, computed on the same 1,614 records. It is not a causal wine-value effect, revenue gain or future guarantee.

Paired here means two model losses against one observed label. It does not mean two observed potential outcomes or a before/after intervention comparison.

학부Undergraduate

행 비중과 묶음 비중을 섞지 않는다Do not confuse row weighting with group weighting

같은 묶음에 행이 여러 개라면 그 묶음은 원행 평균에 더 큰 비중으로 들어갈 수 있습니다. 이것은 오류가 아니라 어떤 대상을 평균내는지의 선택입니다. 모든 기록 한 행을 같은 비중으로 볼지, 물리적 대상이나 묶음 하나를 같은 비중으로 볼지 먼저 정해야 합니다. 이 장의 기본 위험은 원행의 단위 비중 평균입니다.

가상 G묶음의 손실 차이는 1이고 비중이 1, H묶음의 차이는 3이고 비중이 3이라고 하겠습니다. 원래 비중 평균은 (1×1+3×3)/4=5/2입니다. 묶음 평균 1과3을 다시 반씩 평균내면 2로 다릅니다. 어느 값이 나왔는지 설명하려면 묶음별 질량 W_g와 차이 합 S_g를 함께 적어야 합니다.

Wg=∑i∈gwi,Sg=∑i∈gwidi,Δ^=∑gSg∑gWgW_g=\sum_{i\in g}w_i,\qquad S_g=\sum_{i\in g}w_id_i,\qquad \widehat\Delta=\frac{\sum_gS_g}{\sum_gW_g}

같은 비율의 비중을 모두 일정 배로 늘려도 평균 차이는 변하지 않습니다. 그러나 일부 코호트나 묶음의 상대 비중을 바꾸면 목표가 바뀝니다. 기본 비교 뒤에 인구 대표 비중을 적용하고 싶다면 그 모집단과 비중의 출처를 새로 밝혀야 합니다. 데이터 파일에 표본 비중 열이 있다고 어떤 분석에나 자동으로 옮겨 넣지 않습니다.

원 묶음을 지우는 민감도에서는 그 안의 모든 평가 행과 비중을 함께 뺍니다. 큰 묶음 하나를 제거하면 작은 묶음을 제거할 때보다 분모가 많이 달라집니다. 따라서 지운 묶음의 행 수, 질량, 원 손실 차이와 남은 평균을 같이 보면 변화의 이유를 이해할 수 있습니다.

실제 와인 지문 묶음은 계산상 동일 특징 기록을 묶은 것이므로 그것이 곧 독립 표집 단위라는 결론은 내리지 않습니다. 묶음 보존은 정보 경계에 대한 규칙이고, 표집 추론에서 적절한 군집을 정하는 문제는 실제 수집 과정 지식이 더 필요합니다.

Multiple records in one group can give that group more mass in a row-average risk. Decide whether the estimand weights rows, authenticated objects or groups equally. The factual baseline uses unit row weights.

In a constructed example, G has loss difference one and mass one; H has difference three and mass three. Their weighted mean is five-halves. Averaging group means equally gives two instead. Record each group’s mass and weighted difference sum to explain the target.

Wg=∑i∈gwi,Sg=∑i∈gwidi,Δ^=∑gSg∑gWgW_g=\sum_{i\in g}w_i,\qquad S_g=\sum_{i\in g}w_id_i,\qquad \widehat\Delta=\frac{\sum_gS_g}{\sum_gW_g}

Common rescaling preserves a weighted mean, but changing relative masses changes the target. Applying population weights requires stating that population and the source of its weights. A weight column is not automatically appropriate for every analysis.

Delete-group diagnostics remove all evaluation rows and weight within a group. Large groups change the denominator more. Read deleted counts, masses, differences and remaining estimates together.

Identical-predictor fingerprints do not prove independent sampling groups. Preserving an information boundary and choosing valid inference clusters are separate problems requiring knowledge of actual data collection.

학부Undergraduate

원 묶음 하나를 뺄 때의 민감도Sensitivity to deleting one original group

한 반의 평균을 이야기할 때 특정 학생 한 명을 빼면 결론이 크게 달라지는지 살펴볼 수 있습니다. 여기서는 평가 묶음 하나를 통째로 빼고 같은 고정 예측의 평균 손실 차이를 다시 계산합니다. 큰 변화를 보이는 묶음이 있으면 입력·결과·예측과 집단 구성을 자세히 확인할 이유가 됩니다.

전체 질량 W와 가중 차이 합 S에서 묶음 g의 W_g와 S_g를 뺍니다. 남은 질량이 양수일 때 다음 값이 정의됩니다. 분모도 함께 줄여야 하며, 단순히 전체 평균에서 묶음 평균을 빼는 계산이 아닙니다.

Δ^(−g)=S−SgW−Wg,W−Wg>0,S=∑iwidi\widehat\Delta_{(-g)}=\frac{S-S_g}{W-W_g},\qquad W-W_g>0,\qquad S=\sum_iw_id_i

가상 두 묶음의 단위 비중 차이가 1과3이면 전체 평균은 2입니다. 첫 묶음을 빼면 3, 둘째를 빼면 1이므로 삭제 범위는 [1,3]입니다. 평가 가능한 묶음이 하나뿐이면 지운 뒤 질량이 없어 이 범위와 분산 대용값을 정의하지 않습니다. 전체 평균이 정의되는 것과 삭제 진단이 정의되는 것은 다릅니다.

실제 기본 와인은 1,614시험 행에 1,330개의 지문 묶음이 있습니다. 한 묶음 삭제 후 평균 차이의 범위는 약 −0.20647206부터 −0.20153295까지입니다. 이 고정된 시험 기록에서 원 묶음 하나를 빼도 차이의 음수 방향이 유지됩니다. 그렇다고 미래 위험 차이의 확률적 구간이나 통계적 유의성 구간이 되는 것은 아닙니다.

이 계산에서는 훈련 변환·다섯 후보의 계수·검증 선택을 다시 하지 않습니다. 삭제 대상은 고정 시험 평가 집합입니다. 훈련 표본을 다시 뽑고 선택도 새로 하는 중첩 재학습 실험이나 교차검증과 같다고 부르면 안 됩니다. 무엇을 고정했고 무엇을 바꾸었는지 적는 것이 민감도 분석의 핵심입니다.

A class average may depend strongly on one pupil. Here remove one complete evaluation group and recompute the average loss difference for frozen predictions. A large change motivates inspecting its inputs, outcome, errors and composition.

Subtract group mass and difference sum from their totals and renormalize by the remaining positive mass. Subtracting the group mean directly from the full mean is not the same calculation.

Δ^(−g)=S−SgW−Wg,W−Wg>0,S=∑iwidi\widehat\Delta_{(-g)}=\frac{S-S_g}{W-W_g},\qquad W-W_g>0,\qquad S=\sum_iw_id_i

Two unit-mass groups with differences one and three give full mean two and deletion estimates three and one. Their range is one to three. With only one evaluable group, deletion leaves no mass, so the range and variance proxy are undefined even if the full mean exists.

Factual wine has 1,614 test rows in 1,330 fingerprint groups. Its delete-group mean-difference range is approximately minus 0.20647206 to minus 0.20153295. The sign survives these deletions of fixed test records; this is not a probability interval or significance result for future risk.

Training transforms, fitted candidates and validation selection remain frozen. This is not training-sample resampling, nested refitting or cross-validation. State precisely what changes and what stays fixed.

대학원 연결Graduate bridge

jackknife 식과 추론에 필요한 조건The jackknife expression and its inference conditions

묶음별 삭제 값이 얼마나 퍼져 있는지 하나의 수로 적고 싶을 수 있습니다. 이 장은 삭제 값들의 평균을 중심으로 한 아래의 통상적 jackknife 모양 분산식을 계산합니다. 이름이 익숙하다고 곧바로 이 자료의 참 표본 분산을 추정한다고 단정하지 않습니다. 여기서는 먼저 고정 평가 집합의 대수적 진단값입니다.

Δ‾(−)=1G∑g=1GΔ^(−g),VJ=G−1G∑g=1G(Δ^(−g)−Δ‾(−))2,G≥2\overline\Delta_{(-)}=\frac1G\sum_{g=1}^G\widehat\Delta_{(-g)},\qquad V_J=\frac{G-1}{G}\sum_{g=1}^G\left(\widehat\Delta_{(-g)}-\overline\Delta_{(-)}\right)^2,\qquad G\geq2

가상 단위 질량 세 묶음의 차이가 1,2,3이면 전체 평균은 2입니다. 삭제 평균은 5/2,2,3/2이고 그 평균은 2입니다. 편차 제곱 합은 1/2이므로 V_J=(2/3)(1/2)=1/3입니다. 이 값의 단위는 손실 차이 단위의 제곱입니다. 원래 손실이 이미 제곱 점수라면 분산 대용값은 그 단위를 다시 제곱한 것입니다.

표본 추론으로 읽으려면 원 묶음들이 어떻게 독립적으로 관측되었는지, 묶음 크기와 비중이 적절한지, 통계량이 삭제에 대해 어떤 정규성을 갖는지 살펴야 합니다. 아주 큰 불균등 묶음이나 의존 구조에서는 이 식을 넣었다는 사실만으로 정당화되지 않습니다. 우리의 지문 묶음은 수집 과정의 독립성을 증명하지 않습니다.

모형과 선택을 고정했기 때문에 훈련·검증 변동의 불확실성도 이 수치에 자동 포함되지 않습니다. V_J에 제곱근을 취하고 1.96을 곱해 신뢰구간을 붙이는 동작은 추가 추론을 한 것입니다. 이 장의 표와 실습은 그런 자동 구간이나 p값을 제공하지 않고, 평균·삭제 범위·분산 대용값과 전제를 함께 읽게 합니다.

차이가 모두 정확히 0이면 두 개 이상 양의 묶음에서 V_J=0은 정의된 결과입니다. 매우 작은 양수 값이 화면에서 0처럼 보이는 수치 표현 문제와, 평가 집합이 없어 미정의인 문제도 구분합니다. 정확값 펼치기와 상태 표시가 이 차이를 확인하는 데 도움이 됩니다.

To summarize spread among deletion estimates, compute the conventional jackknife-shaped expression below. Its familiar name does not automatically make it a valid sampling-variance estimator here. Start by reading it as an algebraic diagnostic of fixed evaluation records.

Δ‾(−)=1G∑g=1GΔ^(−g),VJ=G−1G∑g=1G(Δ^(−g)−Δ‾(−))2,G≥2\overline\Delta_{(-)}=\frac1G\sum_{g=1}^G\widehat\Delta_{(-g)},\qquad V_J=\frac{G-1}{G}\sum_{g=1}^G\left(\widehat\Delta_{(-g)}-\overline\Delta_{(-)}\right)^2,\qquad G\geq2

Three constructed unit-mass group differences one, two and three give deletion estimates five-halves, two and three-halves. Their mean is two and squared deviations sum to one-half, so V_J is one-third. Its unit is the square of the loss-difference unit.

Sampling interpretation requires suitable independent groups, masses and deletion regularity. Large unequal groups or dependence cannot be justified by simply applying the formula. Our fingerprints do not establish collection-process independence.

Frozen models and selection also omit training/validation variation. Turning the square root of V_J into a 1.96 interval adds inference assumptions. The chapter therefore reports a mean, deletion range and variance proxy without automatic confidence intervals or p-values.

With at least two positive groups and identical zero differences, V_J zero is defined. Distinguish exact zero from a tiny positive displayed as zero and from an undefined empty evaluation. Expand exact values and read state labels when needed.

대학원 연결Graduate bridge

시험을 반복해서 고르면 생기는 낙관Optimism from repeatedly choosing on test results

모형이 두 개면 시험 점수가 낮은 쪽을 다시 고르고 싶어질 수 있습니다. 하지만 그렇게 고른 점수는 처음 약속한 최종 평가가 아닙니다. 여러 모형의 우연한 좋은 결과 중 가장 좋은 것을 골랐기 때문에 기대보다 낙관적인 수치를 보고할 수 있습니다. 시드·문턱·특징·지표를 시험 뒤에 바꾸는 것도 같은 종류의 선택입니다.

아주 작은 가상 확률 예를 보겠습니다. 새 결과 Y는 확률 1/2씩 0과1입니다. 후보는 언제나 0을 예측하는 함수와 언제나 1을 예측하는 함수입니다. 둘 다 미래 제곱 위험은 1/2입니다. 그러나 시험 한 행을 본 뒤 맞힌 후보를 고르면 그 시험의 최소 손실은 항상 0입니다. 미래 위험은 사라지지 않았는데 보고한 시험 손실만 완벽해집니다.

고정된 유한 후보들의 시험 위험 추정값이 각각 적절한 조건에서 불편향이라고 해도 최소값을 취하는 연산은 다음 부등식을 만듭니다. 각 후보를 고정해 평가한 조건과 최소값으로 다시 고르는 조건을 구분해야 합니다. 후보 수나 선택의 자유도가 많을수록 이 문제를 검토할 이유가 커집니다.

E ⁣[min⁡mR^m]≤min⁡mE[R^m],finite integrable risksE\!\left[\min_m\widehat R_m\right]\leq\min_mE[\widehat R_m],\qquad\text{finite integrable risks}

해결은 결과를 숨기는 것이 아니라 전체 선택 절차를 드러내는 것입니다. 시험을 이미 사용해 새 설계를 골랐다면 탐색 결과라고 밝히고 새로운 독립적 평가 자료나 적절한 중첩 평가 설계를 준비합니다. 단순히 같은 시험을 다른 이름으로 다시 부르는 것으로 독립성이 생기지 않습니다.

더 읽을 자료는 Cawley·Talbot의 모형 선택 과적합 논문입니다. 검증 기준 자체의 변동과 그 기준에 맞춘 선택도 과적합을 만들 수 있다는 질문을 읽어 보세요. 이 장의 고정 다섯 후보가 모든 탐색 편향을 없앤다는 주장은 아니며, 적어도 어떤 선택을 했는지 추적 가능하게 하는 출발점입니다.

After observing several test scores, choosing the lowest one reopens selection. Reporting the best accidental outcome can be optimistic. Post-test changes to seeds, thresholds, features and metrics are selection steps too.

In a constructed law, future Y is zero or one with equal probabilities. Two candidates always predict zero or always one. Each has future squared risk one-half. Selecting the candidate that matches a single observed test label makes reported test loss always zero, while future risk remains one-half.

Even when fixed-candidate estimates are unbiased under suitable assumptions, taking their minimum has the following inequality. Separate evaluation of frozen candidates from selection using their estimates.

E ⁣[min⁡mR^m]≤min⁡mE[R^m],finite integrable risksE\!\left[\min_m\widehat R_m\right]\leq\min_mE[\widehat R_m],\qquad\text{finite integrable risks}

Expose the full selection process. If the test informed a new design, label it exploratory and seek new independent evaluation data or a suitable nested design. Renaming the same test does not create independence.

Read Cawley and Talbot on model-selection overfitting for the role of variability in the selection criterion. Five frozen candidates do not eliminate every source of selection bias; they make the declared comparison traceable.

학부Undergraduate

재현·성능·적용 가능성은 세 가지다Reproduction, performance and applicability are distinct

계산이 다시 된다는 사실은 중요합니다. 같은 원파일에서 같은 역할·계수·예측·위험을 얻으면 결과의 숫자 경로를 확인할 수 있습니다. 그러나 그 숫자가 모집단의 진실이라는 결론이나 실제 운영이 안전하다는 결론이 자동으로 따라오지는 않습니다. 서로 다른 질문을 세 칸에 나누어 적어 보세요.

세 가지 질문과 필요한 근거
질문확인할 것그것만으로 보장하지 않는 것
계산 재현파일·계약·완전 코드·수치 대응대표성·측정 타당성
성능 평가미리 정한 집합·손실·선택 경계미래 분포·행동 효과
실제 적용입력 시점·비용·운영·변화 감시모든 상황에서의 무위험

정확 유리수 계산과 부동소수점 계산도 역할이 다릅니다. 정확한 입력 숫자의 유한 사칙연산은 분수로 보존할 수 있지만, 다른 언어의 수치 선형대수는 반올림을 누적할 수 있습니다. 같은 이론 절차를 구현했는지, 허용 오차가 어느 단위에서 정의되는지, 0·미정의·표시 한계를 구별했는지 확인합니다. 화면 마지막 자리가 같다는 확인만으로 전체 수치 경로가 증명되는 것은 아닙니다.

와인 원논문이 쓴 학습기나 분할과 이 장의 다섯 후보는 같지 않습니다. 원논문의 수치를 이 장의 재현 결과로 적지 않고, 이 장의 새 비교 결과를 원논문을 반박한 실험처럼 쓰지도 않습니다. 질문·학습 절차·평가 규칙이 다르면 어떤 차이를 검증하려는지 먼저 정해야 합니다.

적용을 검토하는 실무 메모에는 예측 입력이 실제로 제때 도착하는지, 빠진 고객에게 무엇을 할지, 어떤 오류의 비용이 큰지, 자료 수집이 바뀌면 누가 확인할지를 적습니다. 이런 운영 질문은 실제 자료의 분석과 연결되지만 그 자료에 없던 사실을 분석자가 임의로 완성해서는 안 됩니다.

Recomputing is important: the same files should produce the same roles, parameters, predictions and risks under the contract. That does not make the result a population truth or certify safe operation. Write three separate questions.

Three questions and their evidence
QuestionCheckNot guaranteed by that alone
Computational reproductionFiles, contract, complete code, numeric agreementRepresentativeness or valid measurement
Performance evaluationDeclared frame, loss, selection boundaryFuture distribution or action effects
Practical applicabilityTiming, costs, operations, change monitoringNo risk in every setting

Exact fractions preserve finite algebra on declared inputs, while floating-point linear algebra can accumulate rounding. Check theoretical procedure, tolerance units and zero/undefined/display states. Agreement in the last displayed digit is not proof of every numerical step.

The original wine paper and this chapter use different learners and evaluation designs. Neither copy its scores as our reproduced outputs nor present this comparison as a refutation of its experiment. Establish which procedural difference a comparison tests.

A practical memo addresses timely inputs, unserved customers, error costs and responsibility for changed collection. These connect analysis to operations without inventing facts absent from the source.

대학원 연결Graduate bridge

대학원 연결: 고정 함수의 조건부 위험Graduate bridge: risk conditional on a frozen function

후보를 고르는 과정이 복잡했더라도, 훈련·검증 결과를 고정한 뒤 남겨 둔 시험이 적절하게 독립 표집되었다면 선택된 함수의 위험을 평가하는 문제로 나눌 수 있습니다. 수학적 조건을 분명히 쓰는 것이 “시험을 나누었으니 객관적”이라는 구호보다 정확합니다.

D_tr와 D_val로 선택된 함수를 f_*라고 하겠습니다. 시험의 n개 행이 목표 P에서 독립·동일분포로 관측되고 이 두 자료 및 선택과 독립이며 손실의 기대값이 유한하다고 가정합니다. 이 절에서는 단위 비중을 씁니다. 그러면 각 시험 손실의 조건부 기대가 같은 R_P(f_*)이고 평균의 기대도 같습니다.

E ⁣[R^test(f∗)∣Dtr,Dval]=RP(f∗),RP(f)=EP[ℓ(Y,f(X))]E\!\left[\widehat R_{test}(f_*)\mid D_{tr},D_{val}\right]=R_P(f_*),\qquad R_P(f)=E_P[\ell(Y,f(X))]

이는 특정 선택 함수를 조건으로 한 해석입니다. 학습 자료를 다시 뽑고 모형 선택까지 반복하는 전체 알고리즘의 위험은 그 조건을 다시 평균내는 다른 대상입니다. 고정 시험 손실만 흔들어 보는 삭제 진단이 전체 재학습 불확실성을 자동 포함하지 않는 이유입니다.

같은 시험 행의 두 고정 함수 손실을 A_i,B_i라고 쓰면, 유한한 2차 모멘트와 IID 시험 쌍 아래 다음 분산식을 얻습니다. 같은 어려운 행에서 두 모형이 함께 틀리면 공분산이 양수여서 차이의 분산이 줄 수 있습니다. 공분산이 언제나 양수라는 가정이나 서로 다른 행의 점수를 같은 쌍처럼 다루는 것은 정당하지 않습니다.

Var⁡ ⁣(1n∑i(Ai−Bi))=Var⁡(Ai)+Var⁡(Bi)−2Cov⁡(Ai,Bi)n\operatorname{Var}\!\left(\frac1n\sum_i(A_i-B_i)\right)=\frac{\operatorname{Var}(A_i)+\operatorname{Var}(B_i)-2\operatorname{Cov}(A_i,B_i)}{n}

실제 와인·NLS·이탈의 결정적 묶음 분할만으로 위의 목표 표집 가정이 모두 확인되지는 않습니다. 원자료 범위와 미확인 의존을 보고하면서 계산 결과를 제한된 관측 비교로 읽습니다. 이론은 가정을 숨기기 위해서가 아니라 어떤 추가 근거가 있을 때 해석을 확장할 수 있는지 보여 주기 위해 씁니다.

Complex selection can be separated from evaluation if the held-out test is suitably independently sampled after freezing training and validation. Explicit mathematical conditions are more informative than the slogan that a split automatically makes evaluation objective.

Let f_* be selected using D_tr and D_val. Assume unit-weight test records are IID from target P, independent of those datasets and selection, with integrable loss. Every conditional test-loss expectation then equals R_P(f_*), and so does their average.

E ⁣[R^test(f∗)∣Dtr,Dval]=RP(f∗),RP(f)=EP[ℓ(Y,f(X))]E\!\left[\widehat R_{test}(f_*)\mid D_{tr},D_{val}\right]=R_P(f_*),\qquad R_P(f)=E_P[\ell(Y,f(X))]

This conditions on the selected function. Risk of the full algorithm under repeated training and selection averages over another layer of variation. Deleting frozen evaluation records does not automatically include that layer.

For two fixed losses A_i and B_i on the same IID test pairs, finite second moments give the variance identity below. Positive covariance from shared difficult records can reduce variance of the difference. Its sign is not universally positive, and different records are not automatically a valid pair.

Var⁡ ⁣(1n∑i(Ai−Bi))=Var⁡(Ai)+Var⁡(Bi)−2Cov⁡(Ai,Bi)n\operatorname{Var}\!\left(\frac1n\sum_i(A_i-B_i)\right)=\frac{\operatorname{Var}(A_i)+\operatorname{Var}(B_i)-2\operatorname{Cov}(A_i,B_i)}{n}

The factual deterministic group splits do not establish all these target-sampling assumptions. Report source scope and unknown dependence, then read the results as bounded observational comparisons. Theory identifies the additional evidence needed to extend interpretation rather than concealing those conditions.

학부Undergraduate

국가 맥락: 포르투갈 와인 기록 6,497행National-industry context: 6,497 Portuguese wine records

포르투갈 북부 Vinho Verde 와인 산업에서는 화학 검사와 시음 평가가 품질을 이해하는 서로 다른 정보를 제공합니다. 이 사례의 질문은 원 화학 정보에서 기록된 전문가 품질 점수를 얼마나 예측할 수 있는가입니다. 국가를 사례 맥락으로 소개하지만 분석 단위는 적포도주 1,599·백포도주 4,898개의 기록입니다. 여러 국가의 정책 효과를 비교한 자료가 아닙니다.

화학 변수 11개와 적포도주 지시자를 사용하고 품질 라벨은 지문·분할에서 제외합니다. 같은 종류와 원 화학 값이 모두 같은 행은 같은 묶음에 둡니다. 기본 시드와 공통 훈련 집합에서 상수·세 릿지·한 단계 나무를 모두 학습한 뒤 검증 MSE로 고릅니다. 이 규칙 아래 λ=1/100 릿지가 선택됩니다.

검증 MSE는 약 0.51648887, 시험 MSE는 약 0.56653931입니다. 시험 MAE는 약 0.58447543 품질 점수, R²는 약 0.26458007입니다. 이 수치들은 같은 것을 다른 배율로 반복한 값이 아닙니다. 각각 제곱 거리, 평균 절대 거리, 평가 집합 변동 대비 오차를 읽습니다. 상수의 시험 MSE 0.77056225와 같은 시험 행에서 비교하세요.

다음 핵심 표·원행 예시·원본 벡터는 이 장의 새 계산 결과입니다. 원 와인 논문의 표나 그림을 복사한 것으로 소개하지 않습니다. 모든 원변수·원행 번호와 완전한 선택 예측 장부를 내려받아 첫 행만이 아니라 중간·끝도 확인할 수 있습니다. 숫자의 정의는 간결한 표에서 읽고, 각 관측의 추적은 전체 장부에서 이어갑니다.

와인 실제 자료의 핵심 표와 원행

예정 역할과 완전 평가 가능 행
역할예정 원행완전 분석 행제외
훈련325532550
검증162816280
시험161416140
사전 지정 특징 · 원변수 전체는 다운로드에 보존
정확한 변수 이름뜻단위 범위
fixed acidity고정산도원 측정 척도
volatile acidity휘발산도원 측정 척도
citric acid구연산원 측정 척도
residual sugar잔당원 측정 척도
chlorides염화물원 측정 척도
free sulfur dioxide유리 이산화황원 측정 척도
total sulfur dioxide총 이산화황원 측정 척도
density밀도원 측정 척도
pHpH원 측정 척도
sulphates황산염원 측정 척도
alcohol알코올원 측정 척도
declaredRedWineIndicator파생 적포도주 지시자 1/0지시자
기본 다섯 후보 · 선택은 검증 MSE
후보훈련 행검증 MSE시험 MSE시험 MAE시험 R²
훈련 평균 상수32550.711772520.770562250.68799217-0.00026040375
릿지 λ=.0132550.516488870.566539310.584475430.26458007
릿지 λ=.132550.625669950.683376980.637128010.11291406
릿지 λ=132550.697456690.756125920.680224140.018479278
한 단계 나무32550.596960020.643117350.662499710.16517476
같은 시험 코호트의 선택 모형과 상수
코호트장부 ID행 수선택 MSE상수 MSE선택 MAE
적포도주red3840.416505130.678626510.52146181
백포도주white12300.613379250.799264140.60414798
원행 처음·중간·끝 10행 · 전체 장부 별도 제공
위치행 ID원 ID예정 역할분석 역할관측 Y상수 예측선택 예측
1wine-red-row:1—validationvalidation55.8251925.261384
2wine-red-row:2—validationvalidation55.8251925.210921
3wine-red-row:3—traintrain55.8251925.2936277
4wine-red-row:4—testtest65.8251925.6791136
3248wine-white-row:1649—validationvalidation55.8251925.8393681
3249wine-white-row:1650—traintrain45.8251925.6357404
3250wine-white-row:1651—traintrain75.8251926.3885089
6495wine-white-row:4896—testtest65.8251925.626143
6496wine-white-row:4897—validationvalidation75.8251926.3648952
6497wine-white-row:4898—traintrain65.8251926.2030974

전체 파일에서 정확값과 결측·역할을 확인하세요. 다음 그림은 이 장의 실제 계산이며 점이 겹칠 수 있습니다. 원본 확대는 각 벡터 링크에서 볼 수 있습니다.

포르투갈 와인 기록 · 실제값과 두 예측
포르투갈 와인 기록 · 실제값과 두 예측 · 같은 시험 원행만 비교 · 라벨 결측은 0점으로 그리지 않음 원본 SVG 확대 · PNG
포르투갈 와인 기록 · 같은 행의 손실 차이
포르투갈 와인 기록 · 같은 행의 손실 차이 · 음수는 선택 모형 손실이 더 작음 · 인과 효과·신뢰구간 아님 원본 SVG 확대 · PNG
포르투갈 와인 기록 · 사전 후보의 검증·시험 위험
포르투갈 와인 기록 · 사전 후보의 검증·시험 위험 · 검증이 후보를 고른 뒤 시험을 보고함 · 시험 재선택 아님 원본 SVG 확대 · PNG
포르투갈 와인 기록 · 두 코호트의 시험 위험
포르투갈 와인 기록 · 두 코호트의 시험 위험 · 각 코호트의 양의 완전 평가 집합 · 관측 집단 차이는 인과 설명 아님 원본 SVG 확대 · PNG

출처·원문: UCI Wine Quality · DOI10.24432/C56S3T · CC BY4.0, Native wine archive

In northern Portugal’s Vinho Verde industry, chemical tests and tasting assessments provide different quality information. Ask how well native chemistry predicts the recorded expert score. The national-industry context contains 1,599 red and 4,898 white wine records, not a multi-country policy experiment.

Use eleven chemical inputs plus a declared red indicator. Exclude quality from fingerprints and splitting; identical type/chemistry records remain grouped. Fit the constant, three ridge candidates and one-split tree on the shared training frame, then select by validation MSE. Ridge λ one-hundredth is selected.

Validation MSE is approximately 0.51648887 and test MSE 0.56653931. Test MAE is about 0.58447543 quality-score units and R-squared 0.26458007. These describe squared distance, absolute distance and error relative to evaluation variation. Compare with constant test MSE 0.77056225 on the same records.

The following core tables, row previews and original vectors come from this chapter’s new calculations, not copied paper figures. Full native fields and the complete selected-prediction ledger support checking first, middle and last records. Read definitions in the concise tables and trace observations in the complete ledger.

Wine: core results and original records

Planned roles and complete analysis rows
RolePlanned native rowsComplete analysis rowsExcluded
Train325532550
Validation162816280
Test161416140
Predeclared model inputs; all native variables retained in downloads
Exact input nameMeaningUnit scope
fixed acidityFixed acidityNative chemical measurement scale
volatile acidityVolatile acidityNative chemical measurement scale
citric acidCitric acidNative chemical measurement scale
residual sugarResidual sugarNative chemical measurement scale
chloridesChloridesNative chemical measurement scale
free sulfur dioxideFree sulfur dioxideNative chemical measurement scale
total sulfur dioxideTotal sulfur dioxideNative chemical measurement scale
densityDensityNative chemical measurement scale
pHpHNative chemical measurement scale
sulphatesSulphatesNative chemical measurement scale
alcoholAlcoholNative chemical measurement scale
declaredRedWineIndicatorDerived red-wine indicator 1/0indicator
Five default candidates; validation MSE selects
CandidateTraining rowsValidation MSETest MSETest MAETest R²
Training-mean constant32550.711772520.770562250.68799217-0.00026040375
Ridge λ=.0132550.516488870.566539310.584475430.26458007
Ridge λ=.132550.625669950.683376980.637128010.11291406
Ridge λ=132550.697456690.756125920.680224140.018479278
One-split stump32550.596960020.643117350.662499710.16517476
Selected and constant risks on the same test cohorts
CohortLedger IDRowsSelected MSEConstant MSESelected MAE
Red winered3840.416505130.678626510.52146181
White winewhite12300.613379250.799264140.60414798
Ten first/middle/last native records; complete ledger available
PositionRow IDOriginal IDPlanned roleAnalysis roleObserved YConstant predictionSelected prediction
1wine-red-row:1—validationvalidation55.8251925.261384
2wine-red-row:2—validationvalidation55.8251925.210921
3wine-red-row:3—traintrain55.8251925.2936277
4wine-red-row:4—testtest65.8251925.6791136
3248wine-white-row:1649—validationvalidation55.8251925.8393681
3249wine-white-row:1650—traintrain45.8251925.6357404
3250wine-white-row:1651—traintrain75.8251926.3885089
6495wine-white-row:4896—testtest65.8251925.626143
6496wine-white-row:4897—validationvalidation75.8251926.3648952
6497wine-white-row:4898—traintrain65.8251926.2030974

Inspect exact values, missingness and roles in the complete files. These are new factual calculations; points can overlap. Each vector link preserves original enlargement.

Portuguese wine records: observed versus predicted
Portuguese wine records: observed versus predicted · Same planned test records; missing labels are not invented zero points Original SVG zoom · PNG
Portuguese wine records: same-record loss differences
Portuguese wine records: same-record loss differences · Negative favors the selected model; not a causal effect or confidence interval Original SVG zoom · PNG
Portuguese wine records: validation and test risks
Portuguese wine records: validation and test risks · Validation selects first; test results report performance without reopening selection Original SVG zoom · PNG
Portuguese wine records: test risks within cohorts
Portuguese wine records: test risks within cohorts · Positive complete evaluation frames; cohort differences do not identify causes Original SVG zoom · PNG

Sources and originals: UCI Wine Quality · DOI10.24432/C56S3T · CC BY4.0, Native wine archive

학부Undergraduate

개인 사례: NLS 로그 임금과 603개의 결측 라벨Individual case: NLS log wages and 603 missing labels

이 사례는 원 남성 3,613명의 1976년 횡단면 기록에서 교육 연수와 나이로 원 lwage76를 예측합니다. 원변수 52개는 모두 보존하지만 기본 학습에 쓰는 X는 ed76와 age76 두 개입니다. 다른 열을 보고 몰래 바꾼 변수 목록이나 패널 시간 예측으로 설명하지 않습니다.

603개 라벨 결측을 남긴 상태에서 원 ID 전체에 역할을 먼저 배정합니다. 완전 훈련 1,520행·검증 745행·시험 745행을 사용하고, 예정된 역할과 제외 사유는 전체 3,613행 장부에 남깁니다. 결과가 없는 행의 예측을 볼 수 있어도 그 행의 오차를 관측한 것은 아닙니다.

검증이 고른 λ=1/100 릿지의 시험 MSE는 약 0.16116601, 훈련 평균 상수는 약 0.18945395입니다. 같은 745행의 차이는 약 −0.02828793 로그 점의 제곱입니다. 선택 모형의 시험 MAE는 약 0.32297796 로그 점입니다. 그 수치를 시간당 원화나 연간 소득의 평균 차이라고 바꾸어 읽지 않습니다.

교육 12년 이하와 초과의 진단도 제공합니다. 예측에 교육 정보가 도움 되었다는 관찰이 “교육을 추가하면 소득이 오른다”는 인과 효과를 식별하지는 않습니다. 원자료의 역사적 남성 표본·결측·단위 비중도 적용 범위에 남습니다. 예측 관계와 교육 정책 질문을 나누어 실무 메모를 작성하세요.

NLS 실제 자료의 핵심 표와 원행

예정 역할과 완전 평가 가능 행
역할예정 원행완전 분석 행제외
훈련18061520286
검증903745158
시험904745159
사전 지정 특징 · 원변수 전체는 다운로드에 보존
정확한 변수 이름뜻단위 범위
ed76교육 이수 연수년
age761976년 나이년
기본 다섯 후보 · 선택은 검증 MSE
후보훈련 행검증 MSE시험 MSE시험 MAE시험 R²
훈련 평균 상수15200.192708910.189453950.35209722-0.0014498111
릿지 λ=.0115200.158323080.161166010.322977960.14807964
릿지 λ=.115200.173487190.171874170.335252310.091476523
릿지 λ=115200.18889820.185865420.348708970.017519053
한 단계 나무15200.176605630.180934710.341309730.043582691
같은 시험 코호트의 선택 모형과 상수
코호트장부 ID행 수선택 MSE상수 MSE선택 MAE
교육 12년 이하schooling-at-most123610.167840470.184128650.33019634
교육 12년 초과schooling-over123840.154891330.194460280.31619194
원행 처음·중간·끝 10행 · 전체 장부 별도 제공
위치행 ID원 ID예정 역할분석 역할관측 Y상수 예측선택 예측
1nls-row:12validationvalidation6.30627536.25400266.049842
2nls-row:23traintrain6.17586736.25400266.1618711
3nls-row:34traintrain6.58063916.25400266.4423253
4nls-row:45testtest5.52146096.25400266.1234393
1806nls-row:18062572testexcluded—6.25400266.1618711
1807nls-row:18072574testexcluded—6.25400266.3556631
1808nls-row:18082575testtest6.14846836.25400266.2755333
3611nls-row:36115221traintrain6.56948146.25400266.3221306
3612nls-row:36125224trainexcluded—6.25400266.0482089
3613nls-row:36135225traintrain6.26339836.25400266.160238

전체 파일에서 정확값과 결측·역할을 확인하세요. 다음 그림은 이 장의 실제 계산이며 점이 겹칠 수 있습니다. 원본 확대는 각 벡터 링크에서 볼 수 있습니다.

NLS 개인 로그 임금 · 실제값과 두 예측
NLS 개인 로그 임금 · 실제값과 두 예측 · 같은 시험 원행만 비교 · 라벨 결측은 0점으로 그리지 않음 원본 SVG 확대 · PNG
NLS 개인 로그 임금 · 같은 행의 손실 차이
NLS 개인 로그 임금 · 같은 행의 손실 차이 · 음수는 선택 모형 손실이 더 작음 · 인과 효과·신뢰구간 아님 원본 SVG 확대 · PNG
NLS 개인 로그 임금 · 사전 후보의 검증·시험 위험
NLS 개인 로그 임금 · 사전 후보의 검증·시험 위험 · 검증이 후보를 고른 뒤 시험을 보고함 · 시험 재선택 아님 원본 SVG 확대 · PNG
NLS 개인 로그 임금 · 두 코호트의 시험 위험
NLS 개인 로그 임금 · 두 코호트의 시험 위험 · 각 코호트의 양의 완전 평가 집합 · 관측 집단 차이는 인과 설명 아님 원본 SVG 확대 · PNG

출처·원문: Card official datasets, Original codebook, Original SAS, Native NLS archive

Predict native lwage76 from schooling and age in the original 3,613-record male 1976 cross-section. Preserve all fifty-two native variables while using only ed76 and age76 as predeclared inputs. This is neither an undisclosed feature search nor panel forecasting.

Assign original-ID roles before excluding the 603 missing labels. The complete training, validation and test frames contain 1,520, 745 and 745 records. Every original planned role and exclusion stays in the full ledger. A prediction for a missing-label record is not an observed error.

Validation-selected ridge λ one-hundredth has test MSE about 0.16116601 versus the constant’s 0.18945395. Their same-record difference is approximately minus 0.02828793 squared log points. Selected MAE is 0.32297796 log points, not an hourly currency or annual earnings difference.

Diagnostics also distinguish schooling at most twelve from above twelve. Predictive value of schooling does not identify a causal effect of extra education. The historical male sample, missingness and unit analysis weights remain part of the scope. Separate prediction from education-policy questions in the memo.

NLS: core results and original records

Planned roles and complete analysis rows
RolePlanned native rowsComplete analysis rowsExcluded
Train18061520286
Validation903745158
Test904745159
Predeclared model inputs; all native variables retained in downloads
Exact input nameMeaningUnit scope
ed76Completed years of schoolingcompleted years of schooling
age76Age in 1976age in years
Five default candidates; validation MSE selects
CandidateTraining rowsValidation MSETest MSETest MAETest R²
Training-mean constant15200.192708910.189453950.35209722-0.0014498111
Ridge λ=.0115200.158323080.161166010.322977960.14807964
Ridge λ=.115200.173487190.171874170.335252310.091476523
Ridge λ=115200.18889820.185865420.348708970.017519053
One-split stump15200.176605630.180934710.341309730.043582691
Selected and constant risks on the same test cohorts
CohortLedger IDRowsSelected MSEConstant MSESelected MAE
Schooling at most 12schooling-at-most123610.167840470.184128650.33019634
Schooling above 12schooling-over123840.154891330.194460280.31619194
Ten first/middle/last native records; complete ledger available
PositionRow IDOriginal IDPlanned roleAnalysis roleObserved YConstant predictionSelected prediction
1nls-row:12validationvalidation6.30627536.25400266.049842
2nls-row:23traintrain6.17586736.25400266.1618711
3nls-row:34traintrain6.58063916.25400266.4423253
4nls-row:45testtest5.52146096.25400266.1234393
1806nls-row:18062572testexcluded—6.25400266.1618711
1807nls-row:18072574testexcluded—6.25400266.3556631
1808nls-row:18082575testtest6.14846836.25400266.2755333
3611nls-row:36115221traintrain6.56948146.25400266.3221306
3612nls-row:36125224trainexcluded—6.25400266.0482089
3613nls-row:36135225traintrain6.26339836.25400266.160238

Inspect exact values, missingness and roles in the complete files. These are new factual calculations; points can overlap. Each vector link preserves original enlargement.

NLS individual log wages: observed versus predicted
NLS individual log wages: observed versus predicted · Same planned test records; missing labels are not invented zero points Original SVG zoom · PNG
NLS individual log wages: same-record loss differences
NLS individual log wages: same-record loss differences · Negative favors the selected model; not a causal effect or confidence interval Original SVG zoom · PNG
NLS individual log wages: validation and test risks
NLS individual log wages: validation and test risks · Validation selects first; test results report performance without reopening selection Original SVG zoom · PNG
NLS individual log wages: test risks within cohorts
NLS individual log wages: test risks within cohorts · Positive complete evaluation frames; cohort differences do not identify causes Original SVG zoom · PNG

Sources and originals: Card official datasets, Original codebook, Original SAS, Native NLS archive

학부Undergraduate

기업 사례: 점수는 좋아졌지만 양성을 부르지 않았다Company case: better scores without positive classifications

통신 고객 3,150행에서 기본 설명변수는 통화 실패 수, 가입 기간, 통화 시간 합, 나이입니다. 원 설명변수 13개와 라벨을 모두 보존하고, 결과를 제외한 원 설명 정보의 동일 지문을 같은 역할에 둡니다. 공식 9개월 특징·12개월 말 라벨 설명을 따르지만 고객별 달력 날짜나 상담 개입 효과를 관측했다고 가정하지 않습니다.

훈련 1,593·검증 786·시험 771행에서 검증 MSE가 고른 후보는 λ=1/100 릿지입니다. 시험 Brier 손실은 약 0.12441445로 상수의 0.14213568보다 작고, AUC는 약 0.81541945입니다. 그러나 기본 문턱 0.5에서는 시험 점수가 모두 문턱보다 작아서 양성 예측을 한 명도 하지 않습니다. 아래 혼동표가 이 사실을 보여 줍니다.

실제 선택 이탈 모형 · 시험 771행 · 문턱 0.5
실제 라벨예측 이탈 1예측 잔류 0행 수
이탈 10 TP132 FN132
잔류 00 FP639 TN639
전체0771771

정확도는 639/771≈0.82879377이지만 이탈자 재현율은 0, 비이탈자 재현율은 1, 균형 정확도는 1/2입니다. 예측 양성이 없으므로 precision은 분모 0으로 미정의입니다. 실제 라벨에는 두 클래스가 있어 AUC는 정의됩니다. 따라서 높은 순위 지표와 높은 정확도가 모두 “이탈자를 찾는 행동”의 성공을 뜻하지 않습니다.

문턱을 낮추어 더 많은 고객에게 연락하도록 설계할 수는 있습니다. 그러나 비용과 보정·접촉 효과, 허용 연락량을 정해 검증해야 할 새 정책입니다. 시험을 보고 가장 좋아 보이는 문턱으로 갈아 끼운 수치를 원래 0.5 비교처럼 보고하지 않습니다. 특히 이탈을 잘 예측한 고객이 쿠폰에 가장 잘 반응하는 고객이라는 보장은 없습니다.

이 사례의 실무 가치는 예쁜 단일 점수보다 이 차이를 드러내는 데 있습니다. 점수의 거리 정확도, 순위 능력, 고정 문턱 분류, 실제 유지 행동이라는 네 층을 나누어 보고하세요.

이탈 실제 자료의 핵심 표와 원행

예정 역할과 완전 평가 가능 행
역할예정 원행완전 분석 행제외
훈련159315930
검증7867860
시험7717710
사전 지정 특징 · 원변수 전체는 다운로드에 보존
정확한 변수 이름뜻단위 범위
Call Failure통화 실패 수통화 실패 횟수
Subscription Length가입 기간가입 개월
Seconds of Use총 통화 시간총 통화 초
Age나이 원기록값원 기록 단위
기본 다섯 후보 · 선택은 검증 MSE
후보훈련 행검증 MSE시험 MSE시험 MAE시험 R²
훈련 평균 상수15930.12499150.142135680.27358018-0.0016986502
릿지 λ=.0115930.11116870.124414450.252652360.12319142
릿지 λ=.115930.117879780.133716290.262689870.057636853
릿지 λ=115930.12370220.140658930.271896850.0087087289
한 단계 나무15930.111257980.13001090.246381230.083750511
같은 시험 코호트의 선택 모형과 상수
코호트장부 ID행 수선택 MSE상수 MSE선택 MAE
종량제pay-as-you-go7050.132440210.151219460.2619122
계약제contractual660.0386847760.0451044180.15374048
선택 이탈 모형의 점수와 문턱 진단
진단값분모·조건
Brier · 한 성분0.12441445같은 771행
AUROC0.81541945양성 132·음성 639
정확도0.82879377771
양성 재현율0132
음성 재현율1639
균형 정확도0.5두 클래스 재현율 평균
Precision미정의예측 양성 질량 0
원행 처음·중간·끝 10행 · 전체 장부 별도 제공
위치행 ID원 ID예정 역할분석 역할관측 Y상수 예측선택 예측
1customer-row:1—testtest00.15568110.15439771
2customer-row:2—traintrain00.15568110.21310406
3customer-row:3—traintrain00.15568110.21569101
4customer-row:4—traintrain00.15568110.1638868
1575customer-row:1575—testtest10.15568110.1198194
1576customer-row:1576—traintrain00.15568110.17871387
1577customer-row:1577—traintrain10.15568110.17209552
3148customer-row:3148—traintrain00.15568110.22878297
3149customer-row:3149—traintrain00.15568110.1618894
3150customer-row:3150—traintrain10.15568110.24248756

전체 파일에서 정확값과 결측·역할을 확인하세요. 다음 그림은 이 장의 실제 계산이며 점이 겹칠 수 있습니다. 원본 확대는 각 벡터 링크에서 볼 수 있습니다.

통신 고객 이탈 · 실제값과 두 예측
통신 고객 이탈 · 실제값과 두 예측 · 같은 시험 원행만 비교 · 라벨 결측은 0점으로 그리지 않음 원본 SVG 확대 · PNG
통신 고객 이탈 · 같은 행의 손실 차이
통신 고객 이탈 · 같은 행의 손실 차이 · 음수는 선택 모형 손실이 더 작음 · 인과 효과·신뢰구간 아님 원본 SVG 확대 · PNG
통신 고객 이탈 · 사전 후보의 검증·시험 위험
통신 고객 이탈 · 사전 후보의 검증·시험 위험 · 검증이 후보를 고른 뒤 시험을 보고함 · 시험 재선택 아님 원본 SVG 확대 · PNG
통신 고객 이탈 · 두 코호트의 시험 위험
통신 고객 이탈 · 두 코호트의 시험 위험 · 각 코호트의 양의 완전 평가 집합 · 관측 집단 차이는 인과 설명 아님 원본 SVG 확대 · PNG

출처·원문: UCI Iranian Churn · DOI10.24432/C5JW3Z · CC BY4.0, Native churn archive

The 3,150 telecom records use four default inputs: call failures, subscription length, seconds of use and age. Preserve all thirteen native predictors and the label, keeping identical outcome-free native fingerprints together. Documented timing does not supply individual calendar dates or observed retention-intervention effects.

Training, validation and test contain 1,593, 786 and 771 records. Validation selects ridge λ one-hundredth. Test Brier is about 0.12441445 versus the constant’s 0.14213568, and AUC about 0.81541945. Yet every test score is below the fixed 0.5 threshold, so it predicts no positives.

Factual selected churn model: 771 test records, threshold 0.5
Observed labelPredicted churn 1Predicted stay 0Records
Churn 10 TP132 FN132
Stay 00 FP639 TN639
Total0771771

Accuracy is 639/771, about 0.82879377, but positive recall is zero, negative recall one and balanced accuracy one-half. Precision is undefined without predicted positives. AUC remains defined because both observed classes exist. Ranking quality and high accuracy do not establish successful detection at the fixed threshold.

Lowering the threshold to contact more customers defines a new policy needing costs, calibration, response effects and capacity evaluation. A post-test threshold search must not be reported as the original half-threshold comparison. Customers likely to leave need not be those most responsive to coupons.

The practical lesson lies in this distinction, not a single attractive score. Report numeric score error, ranking, fixed-threshold classification and actual retention actions as four separate layers.

Churn: core results and original records

Planned roles and complete analysis rows
RolePlanned native rowsComplete analysis rowsExcluded
Train159315930
Validation7867860
Test7717710
Predeclared model inputs; all native variables retained in downloads
Exact input nameMeaningUnit scope
Call FailureCall failurescount of call failures
Subscription LengthSubscription lengthsubscription months
Seconds of UseSeconds of usetotal call seconds
AgeNative Age valuenative Age value
Five default candidates; validation MSE selects
CandidateTraining rowsValidation MSETest MSETest MAETest R²
Training-mean constant15930.12499150.142135680.27358018-0.0016986502
Ridge λ=.0115930.11116870.124414450.252652360.12319142
Ridge λ=.115930.117879780.133716290.262689870.057636853
Ridge λ=115930.12370220.140658930.271896850.0087087289
One-split stump15930.111257980.13001090.246381230.083750511
Selected and constant risks on the same test cohorts
CohortLedger IDRowsSelected MSEConstant MSESelected MAE
Pay-as-you-gopay-as-you-go7050.132440210.151219460.2619122
Contractualcontractual660.0386847760.0451044180.15374048
Selected churn scores and threshold diagnostics
DiagnosticValueDenominator or condition
One-component Brier0.12441445Same 771 records
AUROC0.81541945Positive 132; negative 639
Accuracy0.82879377771
Positive recall0132
Negative recall1639
Balanced accuracy0.5Mean of both class recalls
PrecisionUndefinedPredicted positive mass 0
Ten first/middle/last native records; complete ledger available
PositionRow IDOriginal IDPlanned roleAnalysis roleObserved YConstant predictionSelected prediction
1customer-row:1—testtest00.15568110.15439771
2customer-row:2—traintrain00.15568110.21310406
3customer-row:3—traintrain00.15568110.21569101
4customer-row:4—traintrain00.15568110.1638868
1575customer-row:1575—testtest10.15568110.1198194
1576customer-row:1576—traintrain00.15568110.17871387
1577customer-row:1577—traintrain10.15568110.17209552
3148customer-row:3148—traintrain00.15568110.22878297
3149customer-row:3149—traintrain00.15568110.1618894
3150customer-row:3150—traintrain10.15568110.24248756

Inspect exact values, missingness and roles in the complete files. These are new factual calculations; points can overlap. Each vector link preserves original enlargement.

Telecom churn: observed versus predicted
Telecom churn: observed versus predicted · Same planned test records; missing labels are not invented zero points Original SVG zoom · PNG
Telecom churn: same-record loss differences
Telecom churn: same-record loss differences · Negative favors the selected model; not a causal effect or confidence interval Original SVG zoom · PNG
Telecom churn: validation and test risks
Telecom churn: validation and test risks · Validation selects first; test results report performance without reopening selection Original SVG zoom · PNG
Telecom churn: test risks within cohorts
Telecom churn: test risks within cohorts · Positive complete evaluation frames; cohort differences do not identify causes Original SVG zoom · PNG

Sources and originals: UCI Iranian Churn · DOI10.24432/C5JW3Z · CC BY4.0, Native churn archive

학부Undergraduate

원행·원변수·선택 장부를 따라가기Trace native rows, variables and selected predictions

완전한 자료를 제공한다는 말이 본문에 수만 행을 한꺼번에 펼친다는 뜻일 필요는 없습니다. 핵심 표에는 정의·분모·주요 비교를 두고, 원행 장부에는 모든 행의 원 ID·코호트·예정 역할·실제 역할·Y·상수 예측·선택 예측과 원 예측을 보존합니다. 작은 화면에서 읽을 표와 전체 기록을 추적할 파일은 서로 돕는 역할입니다.

전체 원행 수는 6,497+3,613+3,150=13,260입니다. 와인에서는 종류와 원행 번호를, NLS에서는 원 개인 ID와 원행 번호를 함께 읽습니다. 이탈의 기술적 행 ID는 검증된 고객 고유 ID라고 부르지 않습니다. 같은 숫자 1이 서로 다른 자료에 있어도 자료 이름과 전체 ID를 함께 써야 혼동하지 않습니다.

완전 예측 장부에는 라벨 결측과 예측 결측을 빈 문자열로 보존하고 별도 상태를 붙입니다. 결측을 0으로 채운 뒤 색만 연하게 표시한 것이 아닙니다. 그림에서 점이 없으면 장부에서 왜 빠졌는지 확인하세요. 특히 NLS 예정 시험 904행에는 관측 오차를 계산하지 못하는 159행도 있습니다.

확인 실습은 첫·중간·마지막 원행을 골라 원파일의 결과와 장부 Y를 비교하는 데서 시작합니다. 그 행의 예정 역할과 사용 여부, 같은 X에서 만든 선택 예측, 쌍별 손실까지 추적합니다. 원파일과 분석 파일의 단위·열 이름을 함부로 바꾸지 않는 것이 이 추적의 전제입니다.

원자료 파일과 문서, 이 장에서 새로 만든 CSV, 완전한 Python·R 코드를 함께 제공합니다. 원자료를 새로 내려받아야 할 때에는 공식 출처와 버전을 확인하고, 다른 바이트를 같은 자료라고 조용히 바꾸지 않습니다. 바뀐 파일은 새 입력 계약과 비교 범위를 필요로 합니다.

Complete data need not mean expanding tens of thousands of rows simultaneously in the text. Core tables explain definitions, denominators and key comparisons; full ledgers retain every native ID, cohort, planned/actual role, label, baseline and selected/raw prediction.

There are 13,260 native records across the three cases. Wine retains type and source row; NLS retains individual ID and source row. Technical churn row IDs are not authenticated customer identities. Include dataset and full ID because row one can occur in several sources.

Ledgers preserve missing labels and predictions as empty values with separate states, not pale-colored zeros. When a plot omits a point, inspect its exclusion reason. The 904 planned NLS test records include 159 without an observed evaluable label.

Check first, middle and last records against native values, then follow roles, predictions and paired losses. Stable source names and units make that trace possible.

Factual files and documentation accompany new CSVs and complete Python/R code. If obtaining a new source version, verify its official origin and bytes. Changed files need a new input contract rather than silently replacing a supposedly identical dataset.

대학원 실무Graduate practice

실제 다섯 후보를 계산하는 실습Run the five-candidate factual comparison

자료를 하나 선택하고 기본 시드·평균 검증 기준으로 계산해 보세요. 실습은 그 자료의 모든 원행과 미리 정한 특징·후보를 사용합니다. 표에 먼저 보이는 일부 행이 학습에 쓴 전부라는 뜻은 아닙니다. 계산 중에는 취소할 수 있고, 다른 입력으로 바꾸었다면 그 입력으로 다시 계산해야 합니다. 언어를 바꾸거나 이미 구한 표를 읽는 일은 새로운 모형 실험이 아닙니다.

세 자료에서 기본 선택 ID는 모두 ridge:1/100이지만 위험 단위·분모·질문의 범위는 다릅니다. 같은 이름의 후보가 골라졌다고 세 분야의 성능을 같은 MSE 척도로 순위 매기지 않습니다. 훈련 역할 수, 검증 기준, 선택 후보, 시험 위험, 기준선 차이의 순서로 결과를 읽으세요.

그다음 기준을 worst-cohort로 바꾸는 별도 실험을 선언합니다. 이 기준은 각 후보의 필수 코호트 검증 MSE 중 가장 큰 값을 줄입니다. 결과가 같아도 기준은 달라진 것입니다. 시험에서 더 좋아 보였다는 이유로 두 기준 중 하나를 몰래 “원래 기준”으로 정하지 않습니다.

원행 장부와 정확값은 필요할 때 펼칠 수 있습니다. 화면의 짧은 값은 읽기 위한 근삿값이고, 0·작은 비영·표시 범위 초과·미정의는 서로 다른 상태입니다. 전체 결과와 코드는 완전 파일로 내려받아 재현할 수 있습니다. 긴 결과는 페이지로 나누어 읽어도 원본 값과 전체 행 수가 줄어드는 것은 아닙니다.

Select one dataset and compute with the default seed and mean-validation criterion. The lab uses its complete native rows, declared inputs and five candidates. A short preview is not a training subsample. Computation can be cancelled; changed inputs require a new run. Language changes and reading cached tables are not new model experiments.

All three default selections have ID ridge:1/100, but targets, units and denominators differ. Read training counts, validation criterion, chosen candidate, test risk and baseline difference in that order. Do not rank disciplines by raw MSE.

Then declare a separate worst-cohort experiment. It minimizes each candidate’s largest required-cohort validation MSE. Even unchanged selections follow a different criterion. Do not retroactively call whichever criterion looks better on test the original plan.

Expand row ledgers and exact values when useful. Short displays are approximations; zero, tiny nonzero, finite display overflow and undefined are distinct states. Complete results and code remain downloadable. Paginating a long result changes its view, not the original values or record count.

학부Undergraduate

입력 사본으로 정보 경계를 확인하기Check the information boundary with an input copy

검산은 같은 숫자를 다시 출력하는 것보다 강한 질문을 할 수 있습니다. “시험 라벨만 바뀌면 학습이 그대로인가”, “교육 행의 순서를 바꾸어도 원 ID의 역할을 추적하는가” 같은 정보 흐름을 확인해 보세요. 변경한 부분과 그대로 두는 부분을 먼저 적어야 결과를 해석할 수 있습니다.

원 공개 파일을 덮어쓰는 대신 S16의 작은 역할 고정 입력 사본을 사용합니다. 훈련 두 행·검증 한 행·시험 한 행을 명시하고, 시험 Y만 바꿉니다. 훈련 변환·계수·검증 선택은 유지되고 시험 보고만 바뀌어야 합니다. 학습 실습과 선택 실습의 입력을 함께 보존하면 그 경계를 검토할 수 있습니다.

원자료 재현 코드의 파일 해시는 다른 원본을 조용히 읽지 않도록 확인하는 입력 계약입니다. 원 CSV 값을 바꿔 실험하고 싶다면 변경 사본·변수·분할·새 계약을 별도로 정해야 합니다. 원파일 해시가 달라졌다는 거절을 없애려고 몰래 검사를 지우는 것과, 새로운 공개 실험의 입력을 명시하는 것은 다릅니다.

실제 시험 라벨을 여러 번 보며 특징을 바꾸고 “여전히 검증 선택을 했다”고만 쓰는 것도 불충분합니다. 검증 선택 바깥의 설계 선택까지 전체 과정에 포함해야 합니다. 최종 비교 보고서에는 재현할 실험의 버전과 탐색 후 남겨 둔 평가가 무엇인지 적습니다.

Verification can ask stronger questions than printing the same number twice: whether changing only test labels leaves fitting unchanged, or whether IDs remain traceable under a reordered input copy. Specify the changed and frozen components first.

Use section sixteen’s small frozen-role input copy rather than overwriting factual files. Retain two training rows, one validation row and one test row, then change only test Y. Training transforms, coefficients and validation selection should stay fixed while test reports change.

Source-code hash checks enforce a declared factual input contract. A modified native CSV needs a separate documented copy and experiment contract. Silently removing checks to conceal changed bytes is not the same as specifying a new experiment.

Repeatedly inspecting factual test labels while adjusting features is also a selection process, even if each run contains an inner validation choice. Record the experiment version and what evaluation remained after exploration.

학부Undergraduate

핵심 표·웹 그래프·원본 벡터를 연결하기Connect core tables, web charts and original vectors

표는 숫자와 분모를 확인하기 좋고, 그림은 구조를 발견하기 좋습니다. 실제값 대 예측 산점도의 가로축은 관측 Y, 세로축은 선택·상수 예측입니다. 두 축이 모두 원 관측값이라고 읽으면 안 됩니다. 로그 임금의 가로축도 달력 연도가 아니라 관측 로그 임금입니다.

쌍별 손실 차이 그림의 가로축은 원행 순서입니다. 시계열 추세나 정책 시행 시점이 아닙니다. 음수 점은 선택 모형의 손실이 더 작았다는 뜻이고, 양수 점은 상수가 그 행에서 더 좋았다는 뜻입니다. 한 점의 높이는 예측 오차 비교이지 해당 개인·와인·고객에 대한 개입 효과가 아닙니다.

후보 위험 그림은 다섯 위치에 후보를 놓고 검증과 시험 MSE를 나란히 그립니다. 코호트 그림은 선택 후보와 상수의 같은 코호트 시험 위험을 비교합니다. 축 범위가 자동으로 정해진 점 그림이므로 점 사이의 절대 차이는 축 숫자와 수치표에서 확인하세요. 막대 높이를 0부터 비교하는 그림으로 바꾸어 읽지 않습니다.

웹에서는 작은 화면에 맞춘 축과 글자로 핵심을 읽고, 원본 확대는 이 장의 계산에서 만든 전체 벡터 그림을 확인하는 데 씁니다. 원본 SVG·PNG와 완전한 그림 좌표 CSV를 함께 제공합니다. 원논문에서 제공된 그림이라는 뜻은 아닙니다. 결측 점은 0에 놓지 않고 장부에 남기며, 관측과 예측의 자료 종류도 구분합니다.

Tables identify values and denominators; plots reveal structure. In observed-versus-predicted scatterplots, horizontal values are observed Y and vertical values are selected/constant predictions. Both axes are not factual observations. NLS horizontal values are native log wages, not calendar years.

The paired-loss horizontal axis is original source order, not a time trend or policy date. Negative points favor the selected model on that record; positive points favor the constant. These are predictive-error differences, not individual intervention effects.

Candidate-risk plots position the five candidates and compare validation/test MSE. Cohort plots compare selected and constant test risks within groups. Point-plot axes may be automatically ranged: read numeric ticks and tables rather than interpreting them as zero-based bars.

Responsive web charts support direct small-screen reading; original enlargement preserves the complete vectors created by this chapter’s calculations. SVG, PNG and full coordinate CSV are available. They are not original-paper figures. Missing points remain in the ledger without invented zeros, and observed versus predicted values remain distinct.

학부Undergraduate

실무 메모: 관측하지 않은 비용은 쓰지 않는다A practical memo must not invent unobserved costs

와인 사례의 보고서를 “예측 오차가 줄었으니 시음 인력 20% 감축”으로 끝내면 안 됩니다. 원자료에 시음 비용·대체 가능성·제품 의사결정의 손실이 없기 때문입니다. 적절한 결론은 주어진 점수 예측 비교가 기준선보다 낮은 시험 손실을 보였고, 실제 시음 업무에 연결하려면 추가 측정과 설계가 필요하다는 범위입니다.

NLS에서도 낮은 로그 임금 MSE를 교육 투자 수익률로 바꾸지 않습니다. 이탈에서도 낮은 Brier를 쿠폰의 매출 효과로 바꾸지 않습니다. 예측 가능한 기록의 특성과 실제 행동으로 바꿀 수 있는 결과를 구별하는 것은 경제·경영 분석에서도 중요합니다.

메모를 쓸 때 첫 문장은 관측 단위·결과·분할·선택 규칙으로 시작하세요. 둘째 문장은 기준선과 선택 모형의 같은 시험 위험·행 수·단위입니다. 셋째에는 결측과 코호트 차이, 분류의 한계를 적습니다. 마지막에는 어떤 추가 자료가 있어야 어떤 결정을 평가할 수 있는지 구체적으로 씁니다.

이탈 실무라면 기본 0.5 문턱에서 TP=0임을 먼저 밝혀야 합니다. 이후 검증에서 문턱과 연락량을 정할지, 확률 보정을 평가할지, 접촉의 실제 효과를 실험할지 분리해 제안할 수 있습니다. 이들은 지금 자료에 이미 들어 있는 결과가 아니라 다음 단계에서 검증할 질문입니다.

Do not turn reduced wine prediction error into a claim of twenty-percent tasting-staff savings. Tasting costs, substitutability and decision losses are unobserved. The supported result is lower test loss under a specified score-prediction comparison, with additional measurement needed for workflow decisions.

Likewise, lower NLS log-wage MSE is not an education investment return, and lower churn Brier is not a coupon revenue effect. Distinguish predictable recorded characteristics from outcomes changed by an action.

Start the memo with units, target, split and selection. Then state same-test baseline and selected risks, counts and units. Follow with missingness, cohort diagnostics and classification limitations. Finish by identifying the additional data needed for a concrete decision.

For churn, disclose TP zero at the half-threshold. Separately propose validation-based thresholds/contact capacity, calibration assessment or an experiment measuring actual contact effects. These are questions for subsequent evidence, not results already observed in the source.

학부Undergraduate

출처에서 완전한 코드까지 재현하기Reproduce from factual inputs to complete code

재현 실습은 결과 표를 읽어 다시 저장하는 일이 아닙니다. 원 숫자 파일을 읽어 묶음·역할·변환·다섯 모형·검증 선택·시험 평가를 새로 계산하는 일입니다. 먼저 네 원자료 CSV와 원 설명 문서를 확보하고, Python 또는 R 코드 전체를 읽어 어떤 파일을 여는지 확인하세요. 이미 계산된 모형이나 정답 CSV를 입력으로 삼지 않습니다.

Python은 표준 라이브러리로 실행하고 R은 SHA-256 파일 확인을 지원하는 R 4.5 이상 기본 환경을 사용합니다. 아래는 코드와 원자료를 같은 폴더에 둔 실행 예입니다. 출력 폴더는 새롭거나 비어 있어야 합니다. 이전 결과를 보존하고 다른 실행과 구분하기 위한 규칙입니다.

python reproduce-wine-churn-comparison.py --source-dir . --output-dir run-python
Rscript reproduce-wine-churn-comparison.R --source-dir . --output-dir run-r

코드는 원행 전체의 역할과 선택·상수 예측, 후보별 파라미터, 역할·코호트별 지표, 같은 시험 행의 쌍별 손실, 묶음 삭제, 그림 좌표의 일곱 CSV를 만듭니다. 핵심 표와 숫자가 맞는지만 보지 말고 원행 수·예정 역할·제외 행과 분모도 함께 확인합니다. 각 CSV의 행은 어떤 단위를 한 번 센 것인지 헤더에서 읽어야 합니다.

완전한 예측 장부는 모든 원행의 선택·기준선 예측을 보존합니다. 불필요하게 모든 후보·모든 조합의 전행 표를 본문에 펼치지는 않습니다. 다른 후보의 개별 예측은 코드의 후보 학습 결과에서 재계산할 수 있고, 공개 표에는 그 다섯 후보의 파라미터와 평가 진단을 제공합니다. 정보를 숨기는 것과 읽을 순서를 정하는 것은 다릅니다.

처음 재현할 때에는 기본 시드와 평균 검증 기준을 유지하세요. 그다음 별도 출력 폴더에서 하나의 변경만 실험합니다. 파일·규칙·출력 버전을 함께 보존해야 두 결과의 차이를 설명할 수 있습니다.

Reproduction recalculates groups, roles, transforms, five models, validation selection and test reports from native numeric files. Obtain four factual CSVs and source documentation, then inspect complete Python or R code to identify its file reads. Precomputed models or answer CSVs are not inputs.

Python uses its standard library; R requires version 4.5 or later for the base file-hash check. With code and native inputs together, run the commands below into separate new or empty directories.

python reproduce-wine-churn-comparison.py --source-dir . --output-dir run-python
Rscript reproduce-wine-churn-comparison.R --source-dir . --output-dir run-r

Seven CSVs retain complete selected/baseline predictions, model parameters, role/cohort metrics, same-test paired losses, group deletions, selection and chart values. Check counts, planned roles, exclusions and denominators as well as displayed scores. Each table has its own record unit.

Every original record remains in the selected/baseline ledger. The text avoids expanding all candidate-by-record combinations; candidate parameters and diagnostics are available, and other predictions can be recalculated from the complete code. Organizing reading order is not discarding source observations.

Begin with the default seed and mean criterion, then change one declared component into another output directory. Retain file, procedure and output versions to explain the difference.

대학원 연결Graduate bridge

Python 정확 분수와 R 근삿값 비교하기Compare Python exact fractions with R approximations

파일에 적힌 0.1을 정확히 1/10이라고 정하면 유한한 사칙연산은 분수로 계산할 수 있습니다. Python 코드는 이 의미의 정확값을 보존합니다. 반면 R의 기본 선형대수는 이진 부동소수점으로 계산하므로 같은 이론 식에서도 마지막 자리가 조금 다를 수 있습니다. 두 방식을 같은 “정확함”이라고 부르지 않습니다.

R의 원 지문 숫자 정규화는 실제 원파일의 작은 십진 정수·분모 범위를 확인한 뒤 정수로 기약화합니다. 미래의 더 긴 원 토큰이 안전 범위를 넘으면 거절합니다. 그러나 회귀·위험 계산은 수치 근사이며, 나무 문턱 손실 동률에도 명시한 근사 허용 오차를 씁니다. 임의로 아주 가까운 가상 동률의 정확한 분기를 인증하는 코드가 아닙니다.

수치 대응을 확인할 때에는 실제 코드 경로와 역할·행 ID·선택·누락 여부 같은 이산 결과를 먼저 맞춥니다. 연속 수치에는 절대 차이만 아니라 단위에 맞춘 척도를 정할 수 있습니다. 이 장의 대응 예는 아래 상대 혼합 척도 2×10⁻¹⁰를 사용합니다. 이것은 검사 규칙이지 엄밀한 반올림 오차 상한의 수학적 증명은 아닙니다.

scaledError⁡(a,b)=∣a−b∣max⁡(1,∣a∣),scaledError⁡(a,b)≤2×10−10\operatorname{scaledError}(a,b)=\frac{|a-b|}{\max(1,|a|)},\qquad \operatorname{scaledError}(a,b)\leq2\times10^{-10}

표시 0만으로 정확한 0을 판정하지 마세요. 아주 작은 비영 분수는 화면 숫자에서 0으로 반올림될 수 있습니다. 반대로 유한한 정확 분수가 화면 숫자 범위를 넘을 수도 있습니다. 정확값과 0·비영·미정의 상태를 구분하고, R의 빈 정확값 열을 정확한 0이라고 읽지 않습니다.

같은 이론·같은 자료라도 다른 알고리즘이나 라이브러리 기본값 때문에 차이가 날 수 있습니다. 허용 오차를 늘리기 전에 목적함수 정규화, 훈련 변환, 특징 순서, 동률, 결측·비중과 평가 집합을 확인하세요. 의미 차이를 숫자 반올림 문제로 숨기지 않는 순서입니다.

Interpreting decimal token 0.1 as exact one-tenth allows finite algebra with fractions; Python retains that meaning. Base R linear algebra uses binary floating-point, so last digits may differ under the same theoretical formula. These are different arithmetic guarantees.

R canonicalizes the actual small native fingerprint integers and denominators with explicit range checks. It rejects unsupported future tokens. Fits and risks remain approximate, including a declared numerical stump-tie tolerance. It does not certify exact branches for arbitrary near-tie teaching inputs.

Compare discrete IDs, roles, selections and missing states first. Then specify a scale for continuous discrepancies. Our numeric comparison uses the mixed relative scale below. It is a checking convention rather than a proved bound on every rounding error.

scaledError⁡(a,b)=∣a−b∣max⁡(1,∣a∣),scaledError⁡(a,b)≤2×10−10\operatorname{scaledError}(a,b)=\frac{|a-b|}{\max(1,|a|)},\qquad \operatorname{scaledError}(a,b)\leq2\times10^{-10}

A displayed zero can represent a tiny nonzero fraction, and an exact finite fraction can overflow its displayed numeric range. Keep exact values and defined/zero/nonzero states distinct. Empty R exact-value columns do not mean exact zero.

Before enlarging a tolerance, check objective normalization, transforms, feature order, ties, missingness, weights and evaluation frames. Do not disguise a different procedure as harmless rounding.

학부Undergraduate

입력·결측·동률의 계약을 읽기Read the input, missingness and tie contracts

실습의 여섯 함수는 각기 다른 질문을 받습니다. 분할은 묶음과 시드, 학습은 X·Y·역할과 후보 규칙, 평가는 라벨·예측·손실, 선택은 병렬 후보 예측과 검증 기준, 쌍별 비교는 같은 행의 두 예측, 실제 자료 비교는 자료 종류와 정한 선택 기준을 받습니다. 입력의 모양이 같아 보여도 역할을 바꾸어 보내면 다른 계산입니다.

여섯 실습의 입력과 출력
함수핵심 입력주요 읽을 결과
split고유 행 ID·묶음·시드원 묶음 순위와 예정 역할
fitX·Y·비중·역할·방법·lambda훈련 변환·모형·모든 질의 예측
evaluateY·점수·역할·문턱위험·분류·코호트·미정의
selectY·후보별 예측·검증 기준공통 집합·검증 선택
paired같은 행 A·B예측손실 차이·원 묶음 삭제
realdatacountry/person/company·시드·기준실제 전체 자료의 다섯 후보 비교

결측은 JSON의 null, 0은 관측한 숫자 0입니다. 비중 0은 관측값을 버렸다는 뜻이 아니라 그 위험 합에 기여하지 않겠다는 선언입니다. 범위를 벗어난 이진 라벨이나 음의 비중은 비활성 행이라고 조용히 통과시키지 않습니다. 입력 형식이 잘못된 것과 분석에 쓰지 않는 것은 다릅니다.

일반 학습 입력은 특징 길이가 같고, 행 ID는 고유하며 앞뒤 공백이 없는 인쇄 가능한 ASCII 문자열이어야 합니다. 실제 원 라벨을 읽는 행 ID·변수 식별자와 설명용 한국어 제목을 구분하세요. 숫자 1과 문자열 “1”을 몰래 같은 ID로 강제 변환하지 않습니다. 작은 예제에서 누락된 필수 키가 0으로 채워지지도 않습니다.

정확 동률은 선택 후보 선언 순서, 나무는 특징 순서 다음 작은 문턱을 유지합니다. 이 계약이 있어야 다른 언어·화면에서도 같은 의미의 실험인지 확인할 수 있습니다. 일부 중간값이 미정의면 사유를 읽고, 결과 표를 완성하려고 임의의 숫자를 넣지 마세요.

The six functions answer distinct questions: groups and seed for splitting; X/Y, roles and model rules for training; labels and predictions for evaluation; parallel candidate predictions for selection; two same-record predictions for paired comparison; and kind/seed/criterion for factual comparison.

The six labs and their contracts
FunctionKey inputsOutputs to read
splitUnique row IDs, groups, seedGroup ranks and planned roles
fitX, Y, weights, roles, method, lambdaTransforms, model, all query predictions
evaluateY, scores, role, thresholdRisks, classification, cohorts, undefined states
selectY, candidate predictions, criterionCommon frame and validation selection
pairedSame-record A/B predictionsLoss differences and group deletions
realdatacountry/person/company, seed, criterionFive candidates on complete factual sources

JSON null denotes missingness; zero is an observed number. Weight zero declares no contribution to risk, not source-record deletion. Invalid binary labels and negative weights are not silently accepted on inactive records. Invalid input differs from a valid excluded analysis row.

Generic fit inputs require equal feature lengths and unique trimmed printable ASCII string IDs. Separate computational identifiers from Korean explanatory titles. Numeric one and string one are not silently coerced into the same identity; absent required keys are not zero-filled.

Exact selection ties keep declaration order; tree ties keep feature order then the smaller threshold. These contracts preserve experiment meaning across implementations. Read undefined reasons rather than filling intermediate states with arbitrary numbers.

학부Undergraduate

Breiman·Cortez에게서 어떤 질문을 배울까Questions to learn from Breiman and Cortez

Leo Breiman은 확률론과 통계 계산을 연구했고 CART의 공동 저자이며 랜덤 포리스트와 연결되는 학자입니다. 버클리의 공식 자료는 그가 예측과 계산 방법에 관심을 두었음을 보여 줍니다. 여기서 배울 질문은 “모형을 가정했으니 충분한가, 새로운 관측의 예측도 평가했는가”입니다. 이것이 내용 지식이나 인과 식별을 모두 불필요하게 만든다는 뜻은 아닙니다.

Cortez·Cerdeira·Almeida·Matos·Reis의 2009년 와인 연구는 화학 검사와 시음 점수를 연결하고 여러 회귀 접근과 변수·모형 선택을 다룹니다. 원 연구의 연구 질문을 읽고, 왜 원자료의 척도·비교 절차가 필요한지 확인하세요. 그 연구의 SVM 결과를 이 장의 릿지 결과라고 바꾸거나, 데이터셋 이름이 같다고 평가가 동일했다고 가정하지 않습니다.

두 연구 계열을 읽는 가치중립적 자세는 특정 기법을 미리 우승시키지 않는 것입니다. 선형 모형은 목적과 전제가 맞을 때 해석과 계산에 장점이 있고, 더 유연한 모형은 다른 형태의 관계를 포착할 수 있습니다. 비교가 답할 질문과 검증 자료의 경계를 먼저 정하고 결과를 읽습니다.

읽기 활동으로 원 연구에서 예측 대상·입력·모형 선택·평가를 각각 한 문장으로 적어 보세요. 그다음 이 장의 다섯 후보 비교와 같은 부분·다른 부분을 표로 만듭니다. “논문에서 어떤 기법이 좋았다”를 외우는 대신, 그 결론이 어떤 실험을 조건으로 하는지 설명하는 훈련입니다.

Leo Breiman worked on probability and computational statistics, coauthored CART and is associated with random forests. His official Berkeley material documents that computational and predictive focus. A useful question is whether model assumptions were complemented by evaluation on new observations. This does not make substantive knowledge or causal identification unnecessary.

Cortez, Cerdeira, Almeida, Matos and Reis’s 2009 wine study links chemistry with tasting scores and considers regression approaches with variable/model selection. Read the original study for its question and protocol. Its SVM results are not our ridge results, and a shared dataset name does not make evaluation designs identical.

A neutral reading does not preselect a winning technique. Linear models can aid interpretation and computation under suitable aims and assumptions; flexible models can capture other relationships. Define the question and information boundaries before interpreting comparative results.

Summarize each paper’s target, inputs, selection and evaluation in one sentence apiece, then compare them with this chapter. Explain the experiment conditioning a conclusion instead of memorizing that a named technique won.

학부Undergraduate

본문 영상: 교차검증과 남겨 둔 평가In-page video: cross-validation and held-out evaluation

다음은 StatQuest의 공식 영상 목록에 연결된 Josh Starmer의 Machine Learning Fundamentals: Cross Validation입니다. 본문 안에서 재생하면서 훈련에 쓴 정보와 평가에 남긴 정보를 구분하는 설명을 따라가 보세요. 정밀한 특정 시각을 외우기보다 분할의 목적을 자기 말로 정리하는 것이 목표입니다.

보기 전 질문은 세 가지입니다. 같은 자료로 배우고 채점하면 왜 낙관할 수 있을까요? 후보를 고르는 역할은 어디에 있을까요? 모형을 고른 뒤 마지막 평가를 다시 고르는 데 쓰면 무엇이 달라질까요? 영상을 멈추고 작은 표를 직접 나누어 보세요.

영상에서 다루는 교차검증과 이 장의 훈련·검증·시험 세 역할 기본 비교는 같은 절차라고 단순히 합치지 않습니다. 교차검증에서는 여러 훈련·평가 나눔을 반복할 수 있고, 그 안에서 전처리와 모형 선택도 적절히 다시 학습해야 합니다. 이 장의 실제 기본 수치는 명시한 한 번의 묶음 보존 분할 결과입니다.

본 뒤에는 S30의 두 상수·시험 한 행 예제를 다시 풀어 보세요. 영상이 직관을 주고, 손계산이 그 직관의 정보 흐름을 확인하고, 실제 원행 비교가 파일에서의 적용을 보여 줍니다. 출처와 다른 자료는 제작자의 공식 목록에서 확인할 수 있습니다.

This is Josh Starmer’s Machine Learning Fundamentals: Cross Validation, linked from StatQuest’s official index. Play it in the page and follow the separation of learning from evaluation. The goal is explaining the purpose of a split, not memorizing unsupported precise timestamps.

Before viewing, ask why learning and grading on the same data can be optimistic, where candidate selection occurs, and what changes when final evaluation is reused for selection. Pause and divide a small table yourself.

Cross-validation and our default train/validation/test comparison are related ideas, not identical procedures. Cross-validation repeats training/evaluation divisions and must appropriately refit preprocessing and selection within them. Our factual scores use one explicitly declared group-preserving split.

After viewing, revisit section thirty’s two constants and one test-label example. Video supplies intuition, hand calculation checks information flow and native-record reproduction checks application. The creator’s official index provides attribution and related material.

학부Undergraduate

원자료·논문·공식 문서를 읽는 순서A reading route through sources, papers and documentation

읽을 자료의 역할도 구분합니다. 원 데이터 문서는 열과 측정·단위·누락·범위를 확인하는 출처입니다. 연구 논문은 그 자료로 어떤 질문과 실험을 했는지 보여 줍니다. 소프트웨어 문서는 특정 구현의 사용 규칙을 알려 줍니다. 하나를 다른 것의 대용으로 쓰면 열의 뜻이나 평가 설계를 놓칠 수 있습니다.

읽기 활동 · 모든 읽기가 원 실험의 재현을 뜻하지는 않음
자료먼저 확인할 것짧은 산출물
UCI Wine Quality·원 names관측 단위·품질 정의·원변수표본과 척도 한 문단
Card NLS·코드북·SASlwage76·ed76·age76·원 ID열과 결측 대응표
UCI Iranian Churn9개월·12개월·원 코드 범위예측 시점과 미확인 사항
Cawley·Talbot 2010모형 선택 기준의 변동검증과 최종 평가 그림
공식 전처리·누출 문서fit과 transform의 정보 경계훈련 전용 변환 절차

와인 출처와 이탈 출처를 원파일과 함께 읽습니다. 이탈의 문서 코드 범위 0–9와 실제 Charge Amount 값 10이 일곱 행 있는 차이도 그대로 기록합니다. 원자료의 차이를 보았다고 분석자가 알아서 9로 고치지 않습니다.

Card의 공식 자료 목록과 보존된 코드북·SAS는 NLS 열 의미를 읽는 연결점입니다. 같은 이름의 변수가 다른 가공 데이터셋에도 있다고 원파일과 같은 단위·절사 규칙이라고 추정하지 마세요.

Cawley·Talbot은 선택 기준에 맞추는 과정도 평가를 낙관하게 할 수 있다는 질문을 제공합니다. 공식 구현 안내는 훈련에서 배운 변환을 검증·시험에 적용하는 경계를 확인하는 보조 읽기입니다. 이 문서의 예제 수치를 이 장의 실제 자료 결과로 옮겨 적지는 않습니다.

Different readings play different roles. Dataset documentation defines fields and measurement scope. A research paper states its question and experiment. Software documentation describes a particular implementation. Replacing one with another can conceal target or protocol differences.

Reading activities, not claims of replicating every original experiment
SourceCheck firstShort output
UCI Wine Quality and native namesUnits, quality definition, original fieldsOne paragraph on sample and scale
Card NLS, codebook and SASlwage76, ed76, age76, original IDVariable/missingness mapping
UCI Iranian ChurnNine/twelve months and code rangesTiming and unknowns
Cawley and Talbot 2010Variation in selection criteriaSelection/evaluation diagram
Official preprocessing guidanceFit/transform information boundariesTraining-only transform procedure

Read the wine and churn sources with their native files. Preserve the discrepancy between documented charge codes zero to nine and seven actual Charge Amount values ten; do not silently recode them to nine.

Card’s official dataset listing and the retained codebook/SAS connect NLS variable meanings to original records. Similar variable names in another processed dataset do not establish identical units or trimming.

Cawley and Talbot motivate scrutiny of selection-induced optimism. Official implementation guidance supplements the training-only transformation boundary. Its illustrative scores are not factual results from this chapter.

대학원 연결Graduate bridge

종합 실습: 같은 기준으로 비교 보고서 쓰기Capstone: write a comparison under common rules

세 실제 자료 중 하나를 고르고 계산 전에 질문과 주요 손실을 한 문단으로 적습니다. 관측 단위와 설명변수·결과의 단위, 예정 훈련·검증·시험, 후보 다섯 개, 평균 또는 최악 코호트 기준, 동률 규칙을 기록하세요. 예상과 실제 결과가 달라도 시험을 본 뒤 설명을 유리하게 고치지 않습니다.

다음으로 원자료에서 원행 하나, 중간 하나, 마지막 하나를 골라 전체 장부와 대응합니다. 가상 예제 한 개를 손으로 계산해 모형이나 평가 함수와 맞춥니다. 실제 전체 계산을 실행한 뒤 같은 평가 집합에서 상수와 선택 후보의 위험 차이를 적습니다. 코호트와 결측·한 클래스·예측 양성 없음 상태도 보고합니다.

그림은 적어도 실제값 대 예측과 쌍별 손실 차이를 읽습니다. 어떤 점이 관측, 어떤 점이 예측인지, 원행 순서를 시간으로 읽지 않았는지 확인하세요. 주요 수치의 원 정확값과 R 근사 대응, 원 SVG와 CSV까지 추적하는 경로를 하나 이상 보여 줍니다.

마지막 한 문단은 결정과 한계를 나누어 씁니다. 지금 기록에서 확인한 예측 비교, 확인하지 않은 미래·원인·비용, 다음에 수집할 자료를 각각 적습니다. “더 많은 데이터가 필요하다”로 끝내기보다 어떤 ID·시점·개입·비용이 어느 질문을 풀지 구체적으로 씁니다.

대학원 확장에서는 선택된 함수를 고정한 조건부 위험과 전체 학습·선택을 반복하는 알고리즘 위험을 나누어 설계합니다. 삭제 진단에 어떤 의존·비중·정규성 조건이 빠져 있는지 검토하고, 별도 평가 설계를 제안합니다. 계산량을 늘리는 것보다 비교의 대상과 근거를 정확히 적는 것이 평가의 중심입니다.

Choose one factual dataset and write the question and primary loss before computing. Record units, inputs, target, planned roles, five candidates, mean or worst-cohort criterion and ties. Do not alter the stated aim merely because test results differ from expectations.

Trace a first, middle and final native record into the ledger. Solve one constructed example by hand, then run the full factual calculation. Report selected-versus-constant risk on the same frame and disclose cohort, missingness, single-class and no-predicted-positive states.

Read at least observed-versus-predicted and paired-loss plots. Identify observed and fitted values, and avoid treating source order as time. Demonstrate a path from a main result to its exact value, R approximation, original SVG and source CSV.

Finish with separate supported comparison, unverified future/causal/cost claims and specific additional evidence needed. Name the IDs, times, interventions or costs that would answer the next question instead of requesting more data vaguely.

For graduate extension, distinguish risk conditional on a frozen selected function from repeated-algorithm risk. Identify missing dependence, weighting and regularity conditions for deletion inference and propose a suitable evaluation design. The key is a precise comparison target and evidence, not raw computational volume.

학부Undergraduate

다음 단계: 입력 계약·지연 라벨·모니터링Next: input contracts, delayed labels and monitoring

정적 비교를 실제 서비스로 옮길 때에는 예측을 만든 시점에 어떤 입력을 읽었는지 남겨야 합니다. 나중에 결과가 도착하면 그 예측 ID와 연결해 평가합니다. 라벨이 아직 없는데 정확도를 0이나 완벽으로 기록하면 운영 상태와 성능을 혼동합니다.

와인 기록의 sourceRow, NLS 원 개인 ID, 이탈의 기술적 행 ID는 각각 무엇을 확인하는지 이미 구분했습니다. 서비스에서 필요한 실제 대상 ID·예측 시각·입력 버전·결과 시각이 이 공개 파일에 모두 있는 것은 아닙니다. 없는 날짜를 원행 순서로 대신해 실제 달력 성능이라고 부르지 않습니다.

다음 장에서는 이런 입력 계약과 배포·지연 라벨·모니터링을 다룹니다. 실제 관측한 원행을 쓰는 부분과 가상으로 지정한 도착 시점·배치 규칙을 구분하는 원칙은 이어집니다. 수집 방법이 바뀌거나 예측이 행동을 바꾸면 이전의 단순 비교와 평가 집합도 달라질 수 있습니다.

이 장을 마치며 할 수 있어야 하는 일은 원자료의 단위와 숫자를 보존하고, 같은 경계의 비교를 새로 계산하고, 지표가 잘 보이는 면과 못 보는 면을 설명하는 것입니다. 그것이 충분한 설명 없이 한 점수로 모형을 우승시키는 것보다 실제 업무에 가까운 출발점입니다.

A service must record which inputs were available when each prediction was made. When outcomes arrive later, join them to the prediction ID for evaluation. No available label means pending evaluation, not zero accuracy or perfection.

Source rows, NLS IDs and technical churn IDs establish different links. The public files do not provide every operational entity ID, prediction time, input version and outcome time. Source order cannot replace missing timestamps in a claim about calendar performance.

The next chapter addresses input contracts, deployment, delayed labels and monitoring. Continue separating factual source records from explicitly constructed arrival or batch schedules. Changed collection or actions influenced by predictions can also change the evaluation frame.

You should now preserve source units and values, recalculate a comparison with common boundaries, and explain both what each metric reveals and what it cannot establish. That is a practical foundation for using models responsibly in real work.

영상·학자·함께 읽기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.

모형 선택의 과적합과 평가 편향Overfitting model selection and evaluation bias

Cawley and Talbot, JMLR2010 primary abstract

후보 선택에도 표본 변동이 있음을 읽습니다.Read how variation in a selection criterion can affect evaluation.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 후보를 여러 개 비교해 고른 검증 점수는 새 시험 점수와 같다고 보장되나요?Does a validation score used to choose among candidates guarantee the same score on a fresh test set?

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

아닙니다. 선택 기준도 표본에 따라 흔들립니다. 검증으로 선택한 뒤, 미리 분리해 둔 시험 집합을 한 번 평가하세요.No. The selection criterion also varies across samples. Select on validation, then evaluate on the previously separated test set.

훈련 전용 전처리와 정보 누출Train-only preprocessing and leakage

Official scikit-learn documentation

훈련에서 배운 변환을 검증·시험에 적용하는 경계를 확인합니다.Check the boundary between fitting transformations and applying them.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 전체 자료에서 먼저 평균과 범위를 계산해도 되나요?May we compute means and ranges on the complete dataset before splitting?

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

이 장의 비교에서는 안 됩니다. 훈련 집합에서 변환을 학습하고 같은 변환을 검증·시험에 적용합니다.Not in this chapter’s comparison. Fit transformations on training records and apply the same transformation to validation and test records.

와인 원자료의 관측·척도Wine observations and scales

UCI Wine Quality, DOI10.24432/C56S3T

화학 입력과 관능 점수의 정의를 원 파일과 대조합니다.Match chemical inputs and sensory targets to original files.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 와인 품질 점수는 가격이나 국가 전체의 평균을 뜻하나요?Does the wine quality score measure price or a national population mean?

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

아닙니다. 원자료의 관능 평가 점수입니다. 나라 사례라는 학습 분류가 국가 대표성을 만들어 주지는 않습니다.No. It is the native sensory quality score. Using the data in a country case does not make the sample nationally representative.

고객 이탈 원변수와 계획 간격Native churn variables and planning gap

UCI Iranian Churn, DOI10.24432/C5JW3Z

첫9개월 입력·12개월 말 라벨·원 단위를 확인합니다.Check nine-month inputs, end-of-year labels and native units.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 고객의 실제 사건 시각을 모두 관측했다고 말할 수 있나요?Can we claim that every customer event timestamp was observed?

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

아닙니다. 원자료 설명의 입력 집계 기간과 라벨 시점을 구별하고, 없는 실제 시각이나 원인 효과를 추정했다고 주장하지 않습니다.No. Distinguish the documented input aggregation period from the label endpoint; do not claim unobserved event timestamps or identified causal effects.

기계학습 기초: 교차검증Machine Learning Fundamentals: Cross Validation

StatQuest / Josh Starmer

본문에서 교차검증의 역할을 확인합니다.Review the role of cross-validation in the in-page player.

본문에서 영상 재생Play the video in the chapter

보고 읽은 뒤 답하기Respond after watching/reading 교차검증은 시험 집합을 반복해 확인하는 절차인가요?Is cross-validation a procedure for repeatedly inspecting the test set?

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

아닙니다. 훈련·검증 안에서 후보를 비교하고, 최종 시험 집합은 선택 과정에서 분리합니다.No. Compare candidates within the training/validation process and keep the final test set separate from selection.

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

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

1. 다른 결과의 MSE를 나눌 수 있을까Can MSEs for different targets rank models?

와인 MSE 0.6, 로그 임금 MSE 0.16, 이탈 Brier 0.12가 나왔습니다. 세 모형을 우수한 순으로 정렬할 수 있나요? 각 수치의 단위를 적으세요.

Wine MSE is 0.6, log-wage MSE is 0.16 and churn Brier loss is 0.12. Can these rank the three models? State the scales.

풀이와 확인할 이유Solution and explanation

그 수치만으로 공통 순위를 만들 수 없습니다. 와인은 품질 점수의 제곱, 임금은 로그 임금 차이의 제곱, 이탈은 0/1 결과에 대한 확률 점수의 제곱입니다. 목표의 분산과 기준선도 다릅니다. 각 자료 안에서 같은 시험 집합·손실·분모를 고정해 기준선과 비교하고, 적용 목적의 비용을 별도로 정해야 합니다.

No common ranking follows. These are squared quality-score units, squared log-wage differences and squared probability errors for a binary outcome. Target variation and baselines differ too. Compare with a declared baseline within each task under the same test frame and loss, then assess application-specific costs separately.

2. 원변수와 파생 지시자의 수Count native variables and a derived indicator

적포도주 1,599행·백포도주 4,898행에 원변수 12개씩 있습니다. 화학 변수는 11개이며 품질이 나머지 하나입니다. 전체 행 수, 원자료 필드 수, 적포도주 지시자를 더한 모형 설명변수 수를 구하세요.

Red and white files have 1,599 and 4,898 rows, each with twelve native variables: eleven chemical inputs plus quality. Find total records, native fields and model-input count after adding a red-wine indicator.

풀이와 확인할 이유Solution and explanation

전체는 1,599+4,898=6,497행입니다. 원 필드는 6,497×12=77,964개입니다. 모형의 설명변수는 화학 변수 11개+파생 지시자 1개=12개입니다. 결과인 품질은 X의 개수에 넣지 않습니다. 파일 추적용 원행 번호나 종류 열을 CSV에 붙여도 그것을 원변수나 새 관측으로 세지 않습니다.

There are 6,497 records and 77,964 native fields. The model has twelve inputs: eleven chemical variables and one derived indicator. Quality is the target, not an input. Added source-row or type columns improve provenance but are not extra native variables or observations.

3. 중앙값과 순서 척도Median ratings and an ordinal scale

가상의 전문가 평가가 4, 5, 9입니다. 중앙값과 평균을 구하세요. 공개 품질 5점을 7점으로 예측한 제곱 손실 4를 곧바로 소비자 효용 손실 4라고 해석해도 될까요?

Constructed expert ratings are four, five and nine. Find their median and mean. May squared prediction loss four for predicting quality seven instead of five be called utility loss four?

풀이와 확인할 이유Solution and explanation

정렬한 가운데 값인 중앙값은 5이고 평균은 (4+5+9)/3=6입니다. 제곱 손실은 (7−5)²=4로 맞지만 효용 단위는 관측하지 않았으므로 효용 손실 4라는 해석은 안 됩니다. 같은 간격의 숫자 손실을 쓰기로 한 비교 규칙과 실제 선호의 간격은 다릅니다. 전문가의 개별 원평가도 이 가상 숫자에서 실제 자료로 둔갑하지 않습니다.

The median is five and the mean is six. Squared numeric loss is indeed four, but no utility scale was observed. A declared numeric comparison convention does not validate equal preference spacing. These teaching ratings also do not become factual individual assessor responses.

4. 이탈 시점을 과장하지 않기Do not invent a churn timeline

문서는 처음 9개월 특징과 12개월 말 라벨을 설명합니다. 파일에는 고객별 날짜가 없습니다. 이 자료를 섞어 분할한 결과를 “2025년 훈련·2026년 미래 예측 검증”이라고 써도 되나요? 확인 가능한 시간 주장을 적으세요.

Documentation describes first-nine-month attributes and end-of-month-twelve labels, but no customer dates are provided. Can a shuffled split be called training in 2025 and prospective testing in 2026? State the supportable timing claim.

풀이와 확인할 이유Solution and explanation

그렇게 쓸 수 없습니다. 실제 연도를 복원할 날짜가 없고 분할도 달력 순서가 아닙니다. 문서에 따른 특징 집계·라벨 간격을 밝히고, 이 장은 원 기록을 묶음 보존 방식으로 나눈 재현 가능한 비교라고 써야 합니다. 미래 달력 시기나 실제 유지 개입의 효과를 관측했다는 주장은 별도 자료가 필요합니다.

No. Individual calendar years were not recovered, and the split is not chronological. Report the documented attribute/label timing and describe the actual group-preserving computational comparison. Prospective calendar performance and effects of retention interventions require additional evidence.

5. 결측이 있는 시험의 분모Find the test denominator with missing labels

NLS 예정 분할은 훈련 1,806·검증 903·시험 904행입니다. 평가 가능한 행은 각각 1,520·745·745행입니다. 역할별 제외 수와 전체 제외 수를 구하고, 시험 손실 합의 분모를 말하세요.

Planned NLS roles contain 1,806 training, 903 validation and 904 test records. Complete counts are 1,520, 745 and 745. Find exclusions by role and the denominator for test risk.

풀이와 확인할 이유Solution and explanation

훈련 제외는 286, 검증 제외는 158, 시험 제외는 159이고 합은 603입니다. 실제 시험 평균 손실은 단위 비중을 쓰므로 745행 손실 합을 745로 나눕니다. 904로 나누면 결측 159행의 손실을 0으로 간주한 셈이 됩니다. 603행은 원자료와 예정 역할 장부에 계속 남기고 제외 사유를 기록합니다.

Exclusions are 286, 158 and 159, totaling 603. Unit-weight test risk divides the loss sum for 745 complete records by 745. Dividing by 904 silently assigns zero loss to missing-label records. Preserve all 603 excluded source records and their planned roles in the ledger.

6. 공통 집합과 예측 가능 비율Common-frame risk and coverage

Y=(1,3), A=(2,2), B=(1,결측)입니다. A의 전체 MSE, B의 관측 가능한 MSE, 공통 집합의 두 MSE와 공통 집합의 원행 대비 비율을 구하세요.

Outcomes are (one, three), A predicts (two, two), and B predicts (one, missing). Find A’s full MSE, B’s evaluable MSE, both common-frame risks and common-frame coverage.

풀이와 확인할 이유Solution and explanation

A의 전체 MSE는 (1+1)/2=1입니다. B의 평가 가능 첫 행 MSE는 0입니다. 공통 집합은 첫 행만 포함하므로 A는 1, B는 0이고 포함 비율은 1/2입니다. B가 두 행 전체에서 MSE 0을 얻었다고 쓰면 안 됩니다. 공통 집합에서 더 좋다는 결론과 전체 행에서 우수하다는 결론을 구별합니다.

A’s full MSE is one. B’s evaluable first-record MSE is zero. On the common first record, risks are one and zero, with coverage one-half. B has not achieved zero MSE on both records. Restricted-frame superiority differs from full-frame superiority.

7. 상수 평균의 손계산Calculate the constant baseline

가상 훈련 결과가 1과 5, 비중은 모두 1입니다. 상수 2·3의 MSE를 비교하고 최적 상수가 3인 이유를 설명하세요. 시험 결과 999가 드러났을 때 상수를 바꿔야 하나요?

Constructed training outcomes are one and five with unit weights. Compare constants two and three, explain the optimal constant and decide whether a later test outcome of 999 changes it.

풀이와 확인할 이유Solution and explanation

c=2의 MSE는 (1+9)/2=5이고 c=3의 MSE는 (4+4)/2=4입니다. 평균 3에서의 손실에 (c−3)²가 더해지는 분해로 모든 실수 상수 가운데 3이 최적임을 알 수 있습니다. 시험 결과는 학습된 기준선을 바꾸지 않습니다. 시험을 넣어 평균을 다시 구하면 시험을 학습에 쓴 새 절차가 됩니다.

The MSEs are five for constant two and four for constant three. The decomposition adds (c−3) squared to the minimum risk, proving three is optimal among real constants. A test label does not update the frozen baseline. Including it defines a new procedure trained on test information.

8. 로그 단위와 원 임금의 차이Log units and wage levels

실제 로그 임금보다 예측이 0.1 높습니다. 절대 오차와 제곱 오차를 구하세요. 이 차이를 시급 0.1원으로 읽거나, exp(예측 로그 임금)을 곧바로 평균 시급이라고 해도 될까요?

A prediction exceeds an observed log wage by 0.1. Find absolute and squared errors. Is that a wage difference of 0.1 currency units, and is the exponentiated mean log prediction automatically a mean wage?

풀이와 확인할 이유Solution and explanation

절대 오차는 0.1 로그 점이고 제곱 오차는 0.01 로그 점의 제곱입니다. 원 임금 차이 0.1원이 아닙니다. 두 로그 값의 차이를 지수화하면 비율 exp(0.1)이지만, 조건부 평균 로그를 지수화한 것과 조건부 평균 임금은 일반적으로 같지 않습니다. 오차 분포와 재변환을 추가로 다루어야 합니다.

Absolute error is 0.1 log points and squared error is 0.01 squared log points, not a wage-level difference of 0.1. Exponentiating a log difference gives ratio exp(0.1), but exponentiating a conditional mean log value generally does not give a conditional mean wage. Error-distribution and retransformation issues remain.

9. 묶음은 무엇을 보장하는가What does a fingerprint group establish?

서로 다른 원행 번호의 두 와인이 종류와 화학 변수 11개가 완전히 같지만 품질 라벨은 다릅니다. 결과를 제외한 특징 지문으로 분할하면 같은 역할인가요? 같은 병을 측정했다고 확정할 수 있나요?

Two wine rows have identical type and eleven chemical predictors but different quality labels. Under an outcome-free predictor fingerprint, do they share a split? Does that prove the same bottle was measured?

풀이와 확인할 이유Solution and explanation

지문에 라벨을 넣지 않으므로 두 행은 같은 묶음이고 같은 예정 역할을 받습니다. 품질이 다르다고 훈련과 시험에 따로 흩어지지 않습니다. 그러나 물리적 병 ID가 없으므로 같은 병이라는 확정은 안 됩니다. 보장하는 것은 이 계산 규칙 아래 완전히 같은 설명 정보가 역할 경계를 넘지 않는다는 범위입니다.

The labels are excluded from the fingerprint, so both rows share a group and planned role. Different quality labels do not separate them across train and test. Without authenticated bottle IDs, physical identity is unproved. The guarantee is limited to keeping identical predictor information within one computational role.

10. 재현성과 미래 성능Reproduction is not a future guarantee

같은 원파일·분할·코드로 같은 시험 MSE를 다시 얻었습니다. 이것만으로 새로운 나라의 소비자 선호나 내년 고객 이탈에도 같은 MSE가 나온다고 할 수 있나요? 비교 보고서에 더 필요한 세 가지를 적으세요.

The same files, split and code reproduce the same test MSE. Does that guarantee equal error for another country’s preferences or next year’s customers? Name three further reporting needs.

풀이와 확인할 이유Solution and explanation

계산 재현은 확인했지만 모집단·시기 이동의 성능은 확인하지 않았습니다. 예를 들어 관측 단위와 표본·시간 범위, 사용한 결과·손실과 단위, 공통 평가 집합·제외 사유·분모를 기록해야 합니다. 실제 적용에는 입력 시점·분포 변화·행동 비용과 효과도 별도 평가합니다. 같은 파일의 동일 숫자와 다른 환경의 유효성을 구분하는 것이 핵심입니다.

This establishes computational repetition, not transport across populations or time. Report, for example, units and sampling/time scope; target, loss and units; and common evaluation frame, exclusions and denominator. Deployment additionally needs input timing, distribution change and action costs/effects. Identical numbers on identical files do not validate a different setting.

11. 분할의 첫 두 교환The first two deterministic swaps

묶음을 A,B,C로 정렬하고 시드 0에서 시작합니다. j=2일 때 다음 상태는 1,013,904,223이고 j=1일 때는 1,196,435,762입니다. i=state mod(j+1)로 교환한 뒤 기본 역할 패턴을 적용하세요.

Sorted groups are A, B, C and seed is zero. Updated states are 1,013,904,223 for j=2 and 1,196,435,762 for j=1. Swap with state modulo (j+1), then apply the default role pattern.

풀이와 확인할 이유Solution and explanation

첫 인덱스는 1,013,904,223 mod3=1이므로 B와 C를 바꾸어 A,C,B가 됩니다. 다음은 1,196,435,762 mod2=0이므로 첫 두 원소를 바꾸어 C,A,B입니다. 순위 0·1·2에 시험·검증·훈련을 대응하면 C는 시험, A는 검증, B는 훈련입니다. 이는 지정한 세 묶음의 계산 결과이며 균일 무작위 순열의 증명이 아닙니다.

The first index is one, giving A, C, B. The second is zero, giving C, A, B. Ranks zero, one and two assign test, validation and train, respectively. This computes the declared finite schedule; it does not prove uniform random permutation sampling.

12. 묶음 수와 행 수Groups and rows need not split equally

같은 묶음 G에 10행, H에 1행이 있습니다. G가 훈련, H가 시험에 배정됐습니다. 묶음의 훈련 비율과 행의 훈련 비율을 구하세요. 행 수를 반씩 맞추려고 G를 잘라도 될까요?

Group G has ten rows and H has one. G is assigned train and H test. Find the training fractions of groups and rows. May G be split to force equal row counts?

풀이와 확인할 이유Solution and explanation

묶음 기준 훈련 비율은 1/2이고 행 기준은 10/11입니다. 같은 묶음을 유지한다는 설계에서는 G를 잘라 배정하면 안 됩니다. 불균형한 역할별 행 수를 보고하고, 다른 분할 설계가 필요하면 미리 새 규칙을 선언해야 합니다.

The group fraction is one-half; the row fraction is ten-elevenths. Splitting G violates the declared group-preserving design. Report the imbalance or specify a different design in advance.

13. 라벨 없이 같은 지문 만들기Outcome-free canonical fingerprints

두 행의 특징이 각각 문자열 0.10과 1/10이고 다른 특징은 같습니다. 라벨은 0과 1입니다. 정확 숫자 표준화 후 특징만 지문에 넣으면 같은 묶음인가요? 원 문자열은 버려도 되나요?

Two otherwise equal rows record a predictor as strings 0.10 and 1/10, with labels zero and one. Are their canonical predictor-only fingerprints equal? May the original tokens be discarded?

풀이와 확인할 이유Solution and explanation

두 값은 기약 유리수 1/10으로 같고 라벨은 지문에서 제외하므로 같은 묶음입니다. 그러나 원 토큰은 측정·추적 기록이므로 원자료에 보존합니다. 같은 수로 계산한다는 선택과 원래 표기를 없애는 것은 다른 작업입니다.

Both canonical values equal one-tenth and labels are excluded, so the fingerprints match. Preserve original tokens for provenance and measurement interpretation. Numeric canonicalization is not permission to erase the factual record.

14. 훈련 눈금으로 시험 변환하기Apply a frozen training scale

훈련 X가 0,2이고 시험 X가 100입니다. 훈련 평균·범위·두 훈련 z·시험 z를 구하세요. 시험 X를 1,000으로 바꾸면 무엇이 바뀌나요?

Training X values are zero and two; test X is one hundred. Find the training mean, range and all transformed values. What changes if test X becomes one thousand?

풀이와 확인할 이유Solution and explanation

훈련 평균은 1, 범위는 2, 훈련 z는 −1/2와 1/2, 시험 z는 99/2입니다. 시험 X가 1,000이면 시험 z만 999/2로 바뀌고 훈련 평균·범위·훈련 z는 그대로입니다. 고정한 분할에서 시험을 포함해 변환을 다시 학습하지 않습니다.

Mean is one, range two, training z values minus and plus one-half, and test z is 99/2. Replacing the held-out X by one thousand gives test z 999/2 while training coordinates remain unchanged. Do not refit the transform on test rows.

15. 릿지 1의 두 예측Two ridge predictions at lambda one

가상 훈련 X=(0,2),Y=(1,5),비중 1입니다. 범위 변환 후 절편 3·λ=1의 기울기 4/5를 써 두 예측, MSE, 평균 SSE/2+λθ₁²/2 목적값을 구하세요.

For constructed unit-weight training X=(zero,two), Y=(one,five), the scaled intercept is three and the slope at lambda one is four-fifths. Find predictions, MSE and the declared objective.

풀이와 확인할 이유Solution and explanation

예측은 3±(4/5)(1/2), 즉 13/5와 17/5입니다. 오차는 ±8/5이므로 MSE=64/25입니다. 목적값은 MSE/2+(4/5)²/2=32/25+8/25=8/5입니다. MSE와 벌점 포함 목적값은 서로 다른 수치이며 목적값을 시험 위험이라고 부르지 않습니다.

Predictions are thirteen-fifths and seventeen-fifths. Errors have magnitude eight-fifths, so MSE is 64/25. The objective is half that plus half the squared slope: 32/25+8/25=8/5. Penalized training objective and unpenalized test risk are distinct quantities.

16. 원계수와 변환 계수Transform a slope back to original units

z=(x−1)/2, 예측=3+(4/5)z입니다. 원 x의 절편과 기울기로 다시 적으세요. 변환 계수 4/5를 원 x의 한 단위당 변화로 바로 읽어도 되나요?

With z=(x−1)/2, prediction is three plus four-fifths times z. Express it in raw x coordinates. Is four-fifths the change per original x unit?

풀이와 확인할 이유Solution and explanation

전개하면 3+(2/5)(x−1)=13/5+(2/5)x입니다. 원 x의 기울기는 2/5이고 절편은 13/5입니다. 변환 계수 4/5는 z 한 단위, 여기서는 원 x 두 단위에 대응합니다. 단위를 변환한 뒤 계수 해석도 같은 변환을 거쳐야 합니다.

Expansion gives thirteen-fifths plus two-fifths times x. Raw slope is two-fifths and raw intercept thirteen-fifths. Four-fifths refers to one z unit, equivalent here to two original x units. Interpret coefficients in the coordinates actually fitted.

17. 나무 문턱의 동률A tree-threshold tie

최소 잎 행 수 1, X=(0,1,2),Y=(0,1,0)입니다. 문턱 1/2·3/2의 잎 평균과 SSE를 구하고 선언한 동률 규칙으로 고르세요.

With minimum leaf rows one, X=(zero,one,two), Y=(zero,one,zero), calculate leaf means and SSE at thresholds one-half and three-halves and apply the declared tie rule.

풀이와 확인할 이유Solution and explanation

문턱 1/2에서는 왼쪽 평균 0, 오른쪽 평균 1/2이고 SSE는 0+1/4+1/4=1/2입니다. 문턱 3/2에서는 왼쪽 평균 1/2, 오른쪽 평균 0으로 SSE가 역시 1/2입니다. 같은 특징의 작은 문턱을 유지하므로 1/2을 고릅니다. 실제 기본 최소 잎 5를 그대로 쓰면 이 세 행으로는 나눌 수 없습니다.

At one-half, leaf means are zero and one-half, yielding SSE one-half. At three-halves, they are one-half and zero, with the same SSE. Keep the smaller threshold. Under the factual default minimum leaf size five, these three teaching rows cannot split.

18. 벌점 정규화 맞추기Match penalty normalization

훈련 비중 합이 W=100, 이 장의 λ=1/10입니다. 같은 변환·절편 규칙에서 합 SSE+α||θ||²를 쓰는 코드의 α를 구하세요.

Training weight sums to one hundred and this chapter uses lambda one-tenth. With identical coordinates and intercept treatment, what alpha matches a sum-SSE plus alpha slope-norm-squared objective?

풀이와 확인할 이유Solution and explanation

평균 기준 목적함수에 2W를 곱하면 합 SSE+Wλ||θ||²이므로 α=100×1/10=10입니다. λ=0.1을 그대로 α=0.1로 복사하면 다른 벌점 세기가 됩니다. 동일 모형인지 확인할 때는 이름보다 전체 목적함수와 변환을 비교합니다.

Multiplication by positive 2W gives alpha=W times lambda, equal to ten. Copying 0.1 directly into alpha instead specifies a different penalty. Compare full objectives and transforms rather than parameter names.

19. 평균과 최악 집단의 선택Mean versus worst-cohort selection

검증 G,H의 비중은 9,1이고 Y=0입니다. A 예측 1,3과 B 예측 2,2 중 평균 MSE와 최악 코호트 MSE가 고르는 후보를 계산하세요. H에 평가 가능한 라벨이 없다면 최악 기준은?

Validation cohorts G and H have weights nine and one and outcome zero. A predicts one and three; B predicts two and two. Compute mean and worst-cohort selections. What if H has no evaluable label?

풀이와 확인할 이유Solution and explanation

평균 위험은 A=9/5, B=4이므로 A입니다. 최악 코호트 위험은 A=9, B=4이므로 B입니다. 필수 H위험이 없으면 최악 기준은 미정의이며 H를 0위험으로 채워 선택하지 않습니다. 평균 기준과 최악 기준은 목표가 다른 미리 선언한 두 비교입니다.

Mean risks select A: nine-fifths versus four. Worst-cohort risks select B: nine versus four. If required cohort H has no risk, the worst-cohort criterion is undefined; do not fill H with zero. The two predeclared rules address different objectives.

20. 시험 라벨 변경 확인A held-out-label invariance check

훈련 (0,1),(2,5),검증 (1,3),시험 (1,999)의 역할을 고정합니다. 시험 Y만 −999로 바꿉니다. 훈련 변환·계수·검증 선택·시험 손실 중 그대로여야 할 것과 달라질 수 있는 것을 나누세요.

Freeze training pairs (zero,one),(two,five), validation (one,three) and test (one,999). Change only test Y to minus 999. Which of transforms, coefficients, validation selection and test loss should stay fixed?

풀이와 확인할 이유Solution and explanation

훈련 변환·계수·나무 문턱과 잎 평균·검증 위험과 선택 후보는 그대로여야 합니다. 이 예에서는 검증 위험이 같은 후보 중 선언 첫 상수 모형을 골라, 선택 모형과 상수 기준선의 시험 예측이 모두 3입니다. 각 시험 제곱 손실은 992,016에서 1,004,004로 달라지지만 두 손실의 쌍별 차이는 0으로 유지됩니다. 일반적으로 서로 다른 두 예측을 비교하면 시험 라벨에 따라 그 차이도 달라질 수 있습니다. 시험 라벨을 쓰는 평가의 변화와 훈련·선택의 변화를 구분하세요. 시험 손실이 바뀌었다고 전부 누출이라고 부르거나, 선택 후보까지 바뀐 것을 정상 보고라고 부르면 안 됩니다.

Training transforms, coefficients, tree thresholds/means and validation selection must remain fixed. Here the first declared constant wins the validation tie, and both the selected model and constant baseline predict three. Each squared loss changes from 992,016 to 1,004,004, but their paired difference remains zero. In general, different predictions can produce a difference that changes with the test label. Separate such evaluation changes from changes in training or selection. Not every changed report is leakage, but changed training or selection would violate the frozen-role procedure.

21. 비중이 있는 오차Weighted prediction errors

Y=(1,3),예측=(2,1),비중=(1,3)입니다. 총 비중·MSE·MAE를 구하세요. 비중을 10배 하면 평균 위험이 바뀌나요?

Outcomes are (one,three), predictions (two,one), weights (one,three). Find mass, MSE and MAE, then rescale weights by ten.

풀이와 확인할 이유Solution and explanation

총 비중은 4입니다. 가중 SSE는 1×1+3×4=13이므로 MSE=13/4입니다. 가중 절대 오차 합은 1+6=7이므로 MAE=7/4입니다. 비중을 10배 하면 분자와 분모가 모두 10배여서 두 평균은 같습니다. 행 수는 2이고 총 비중은 4라는 서로 다른 정보를 함께 보고합니다.

Mass is four. Weighted SSE thirteen gives MSE 13/4; absolute-error sum seven gives MAE 7/4. Scaling weights by ten preserves both means. Record count two and mass four are different reported quantities.

22. 손실 규칙에 따른 후보 변경A changed loss changes selection

두 행의 오차가 A=(0,3), B=(2,2)입니다. 단위 비중 검증에서 MSE 선택과 MAE 선택을 구하세요. 시험을 본 뒤 더 유리한 지표만 보고해도 되나요?

Candidate errors on two unit-weight validation rows are A=(zero,three), B=(two,two). Select under MSE and MAE. May the favorable metric be chosen after test inspection?

풀이와 확인할 이유Solution and explanation

MSE는 A=9/2, B=4이므로 B를 고릅니다. MAE는 A=3/2, B=2이므로 A를 고릅니다. 어느 지표가 주요 선택 기준인지 미리 정하고 보조 지표도 함께 보고해야 합니다. 시험 뒤 유리한 지표만 남기면 원래 비교의 선택 경계를 바꿉니다.

MSE selects B, four versus nine-halves. MAE selects A, three-halves versus two. Predeclare the primary criterion and report auxiliaries. Choosing only the favorable metric after testing changes the comparison boundary.

23. 완벽한데 R²는 없는 경우Perfect predictions with undefined R-squared

실제 Y=(2,2), 예측=(2,2)입니다. MSE와 R²를 구하세요. R² 미정의를 1로 채워도 되나요?

Observed Y and predictions both equal (two,two). Find MSE and R-squared. May undefined R-squared be filled with one?

풀이와 확인할 이유Solution and explanation

MSE=0입니다. 평가 평균 2에서 SST=0이고 SSE=0이므로 R²의 비율은 0/0으로 미정의입니다. 완벽한 제곱 예측이라는 사실은 MSE로 보고할 수 있으나 이 장의 R² 정의에 임의로 1을 채우지 않습니다. 지표마다 정의 조건이 다릅니다.

MSE is zero. SST and SSE are both zero, making the R-squared ratio undefined. Report perfect squared prediction through MSE while preserving the declared R-squared state rather than inserting one.

24. 음수 R²의 해석Interpret a negative R-squared

Y=(0,2),예측=(4,4)입니다. SST·SSE·R²를 구하고 음수 결과를 해석하세요.

Outcomes are (zero,two) and predictions (four,four). Find SST, SSE and R-squared and interpret its sign.

풀이와 확인할 이유Solution and explanation

평가 평균은 1, SST=1+1=2, SSE=16+4=20이므로 R²=1−20/2=−9입니다. 모형 오차 합이 평가 평균 상수의 오차 합보다 열 배라는 뜻입니다. 음수 확률이나 “정확도 −900%”가 아니며, 0으로 잘라 숨기지 않습니다.

Evaluation mean is one, SST two and SSE twenty, so R-squared is minus nine. Model SSE is ten times evaluation-mean baseline SSE. This is not a negative probability or negative classification accuracy; retain the value.

25. 순서와 간격의 차이Order is not spacing

실제→예측이 5→6과 6→7인 가상 두 행입니다. 원 제곱 손실과 점수·예측을 모두 제곱 재표기한 뒤의 손실을 구하세요.

Constructed observed-to-predicted pairs are five-to-six and six-to-seven. Find squared losses before and after squaring both score labels and predictions.

풀이와 확인할 이유Solution and explanation

원 손실은 두 행 모두 1입니다. 재표기 뒤 차이는 36−25=11과 49−36=13으로 손실 121과 169입니다. 순서는 유지되어도 숫자 위험의 간격 가중이 바뀝니다. 이것은 고정 예측의 재표기 예이며 새 타깃으로 재학습한 모형의 실제 성능을 측정한 것은 아닙니다.

Original losses are both one. Recoded gaps eleven and thirteen yield 121 and 169. Order is preserved while numeric-risk spacing changes. This recodes fixed teaching predictions, not an observed refitted-model experiment.

26. 동률 점수의 Brier와 분류Brier and classification for tied scores

Y=(0,1),두 점수 p=(1/2,1/2)입니다. Brier, 고정 문턱 1/2의 두 라벨·정확도, AUC를 구하세요.

Y is (zero,one) and both scores are one-half. Find Brier loss, labels and accuracy at the inclusive half-threshold, and AUC.

풀이와 확인할 이유Solution and explanation

Brier는 (1/4+1/4)/2=1/4입니다. 문턱 이상을 1로 정하므로 예측 라벨은 1,1이고 정확도는 1/2입니다. 양성·음성 점수가 같은 한 쌍에는 절반을 주므로 AUC=1/2입니다. 이 세 수치가 같거나 다르다는 이유만으로 점수가 모집단에서 보정되었다고 확정할 수는 없습니다.

Brier is one-quarter. Inclusive thresholding predicts one for both, giving accuracy one-half. The positive-negative score tie earns half credit, so AUC is one-half. These sample diagnostics do not certify population calibration.

27. 행 수와 비중 혼동표Confusion counts versus masses

네 가상 행 (Y,p,w)은 (1,0.9,2),(1,0.2,1),(0,0.8,3),(0,0.1,4)입니다. 문턱 0.5에서 가중 TP·FN·FP·TN, 정확도·양성 재현율·음성 재현율·균형 정확도를 구하세요.

Four constructed (Y,p,w) rows are (one,0.9,two),(one,0.2,one),(zero,0.8,three),(zero,0.1,four). At threshold 0.5, find weighted confusion masses, accuracy, recalls and balanced accuracy.

풀이와 확인할 이유Solution and explanation

각 행은 TP,FN,FP,TN에 하나씩 들어가므로 행 수는 각 1입니다. 가중 질량은 TP=2,FN=1,FP=3,TN=4, 합 10입니다. 정확도=(2+4)/10=3/5, TPR=2/3, TNR=4/7, 균형 정확도=(2/3+4/7)/2=13/21입니다. 행 수 4를 가중 비율의 분모로 쓰면 다른 잘못된 계산이 됩니다.

Each confusion cell contains one record. Its weighted masses are TP two, FN one, FP three and TN four, totaling ten. Accuracy is three-fifths, TPR two-thirds, TNR four-sevenths and balanced accuracy thirteen-twenty-firsts. Do not divide weighted masses by the record count four.

28. 가정한 비용의 문턱A threshold under hypothetical costs

보정된 이탈 확률이라는 추가 가정 아래 거짓양성 비용 1, 거짓음성 비용 4만 비교합니다. 양성 행동의 기대 손실이 작아지는 문턱을 구하세요. 이 비용이 실제 이란 자료에 관측됐나요?

Assume calibrated churn probabilities and compare only false-positive cost one with false-negative cost four. Derive the positive-action threshold. Are these costs factual observations in the Iranian source?

풀이와 확인할 이유Solution and explanation

양성 기대 손실은 1−p, 음성은 4p입니다. p>1/5이면 양성의 기대 손실이 엄밀히 작고, p=1/5에서는 두 행동의 기대 손실이 같습니다. 동률에서 양성을 고르는 규칙을 정하면 양성을 선택하는 범위는 p≥1/5입니다. 비용은 가상으로 정했고 보정도 추가 가정입니다. 원자료가 이 비용이나 개입 효과를 관측한 것은 아니므로 실제 최적 유지 정책이라는 결론은 안 됩니다.

Expected losses are one minus p and four p. Positive action has strictly lower expected loss above one-fifth; at one-fifth both actions have equal expected loss. Choosing positive action on this tie gives the inclusive threshold p at least one-fifth. Costs are hypothetical and calibration is an added assumption. The source observes neither these costs nor intervention effects, so no optimal retention policy is identified.

29. 동률을 포함한 가중 AUCWeighted AUC with a tie

양성 p=4/5의 비중은 2, 음성 p=3/10·4/5의 비중은 각각 1입니다. 쌍의 총 질량과 가중 AUC를 구하세요. 음성 두 행을 모두 제외하면 무엇이 되나요?

A positive score four-fifths has weight two; negative scores three-tenths and four-fifths have weight one each. Find pair mass and AUC. What if both negative records are excluded?

풀이와 확인할 이유Solution and explanation

양성 질량 2×음성 질량 2로 쌍 분모는 4입니다. 승리 쌍 기여는 2, 동률 절반 기여는 1이므로 AUC=3/4입니다. 음성이 없어지면 쌍 분모가 0이 되어 AUC는 미정의입니다. 실제 오류가 없었다는 뜻으로 1을 쓰거나 무작위라며 1/2을 채우지 않습니다.

Pair mass is four. Winning contribution two plus tie credit one gives three-quarters. Excluding all negatives removes the pair denominator, leaving AUC undefined rather than one or an automatically assigned one-half.

30. 공통 평가 가능한 행 찾기Identify the common evaluable records

네 검증 행의 Y=(0,1,결측,0),비중=(1,1,1,0)입니다. A 예측=(0,1,0,0),B 예측=(0,결측,0,0)일 때 공통 평가 행과 두 위험, 정확한 동률의 선택을 구하세요.

Four validation rows have Y=(zero,one,missing,zero), weights (one,one,one,zero). A predicts (zero,one,zero,zero), B predicts (zero,missing,zero,zero). Find the common frame, risks and exact-tie selection.

풀이와 확인할 이유Solution and explanation

첫 행만 공통 집합에 들어갑니다. 둘째는 B예측 결측, 셋째는 Y결측, 넷째는 비중 0입니다. 공통 비중은 1이고 두 MSE는 모두 0이므로 선언 순서가 A,B면 A를 고릅니다. 원행 4, 양의 라벨 관측 행 2, 공통 평가 행 1의 분모를 구별하고, 이 결과를 네 행 전체에서 두 모형이 완벽했다는 뜻으로 읽지 않습니다.

Only the first row is common: the second lacks B’s prediction, the third a label, and the fourth positive weight. Both risks are zero with mass one, so declaration order A then B selects A. Distinguish four native rows, two positive-weight labeled rows and one common evaluable row. Neither model has demonstrated perfection on all four records.

31. 와인 종류를 합친 위험Combine the wine-type risks

실제 선택 와인 모형의 시험 MSE는 적포도주 약 0.41650513,백포도주 약 0.61337925이고 행 수는 384·1,230입니다. 반올림 수치로 전체 MSE를 계산하고 단순 평균과 다른 이유를 말하세요.

Selected wine test MSEs are approximately 0.41650513 for 384 red records and 0.61337925 for 1,230 white records. Combine the rounded values and explain why the simple average differs.

풀이와 확인할 이유Solution and explanation

전체는 (384×0.41650513+1,230×0.61337925)/1,614≈0.56653931입니다. 단순 평균 약 0.51494219는 두 종류에 절반씩 가중한 별도 목표입니다. 원래 위험은 모든 시험 원행을 단위 비중으로 보았으므로 행 수 비중을 써야 합니다. 입력 수치가 반올림되어 마지막 자리는 정확값과 조금 다를 수 있습니다.

The row-weighted result is approximately 0.56653931. The simple average, about 0.51494219, gives equal type weights and answers a different question. The baseline weights each test record equally. Rounded inputs can cause last-digit differences.

32. 평균 개선과 개별 악화An average gain can include a worse record

가상 Y=(0,0),A=(1,1),B=(2,0)입니다. 각 제곱 손실 차이 A−B와 평균을 구하세요. A가 모든 행에서 더 좋은가요?

For constructed Y=(zero,zero), A=(one,one), B=(two,zero), find per-record squared-loss differences A minus B and their mean. Is A better everywhere?

풀이와 확인할 이유Solution and explanation

차이는 1−4=−3과 1−0=1, 평균은 −1입니다. A는 평균적으로 손실이 작지만 둘째 행에서는 더 큽니다. 이 비교는 같은 라벨에 대한 두 예측 오차이지 개입이 결과를 바꾼 인과 효과가 아닙니다.

Differences are minus three and one, averaging minus one. A wins on average but loses on the second record. These compare predictive errors against the same label, not causal intervention effects.

33. 가중 평균과 묶음 평균A row-weighted and an equal-group mean

두 묶음의 차이가 1,3이고 질량이 1,3입니다. 기본 비중 평균과 두 묶음 평균의 단순 평균을 구하세요.

Two groups have differences one and three and masses one and three. Find the original weighted mean and the equal-group average.

풀이와 확인할 이유Solution and explanation

기본 비중 평균은 (1×1+3×3)/4=5/2입니다. 묶음별 평균을 반씩 보면 (1+3)/2=2입니다. 다른 대상의 가중 평균이므로 둘이 다를 수 있습니다. 묶음으로 삭제한다는 이유만으로 원래 목표도 묶음 동일 비중으로 바뀌지 않습니다.

The original weighted mean is five-halves; the equal-group average is two. They weight different targets. Group deletion does not silently redefine the original row-weighted estimand as an equal-group mean.

34. 큰 묶음을 빼면 분모도 달라진다Deleting a large group changes the denominator

G의 질량 9·차이 평균 1,H의 질량 1·차이 평균 9입니다. 전체 차이, 두 삭제 값, 삭제 범위와 G=2의 분산 대용값을 구하세요.

Group G has mass nine and mean difference one; H has mass one and mean difference nine. Find the full difference, two deletion values, range and two-group variance proxy.

풀이와 확인할 이유Solution and explanation

전체 합 S=9+9=18,W=10이므로 차이는 9/5입니다. G삭제 후에는 (18−9)/(10−9)=9, H삭제 후에는 (18−9)/(10−1)=1입니다. 범위는 [1,9], 삭제 평균은 5, 분산 대용값은 (1/2)((9−5)²+(1−5)²)=16입니다. 이 불균등 질량의 대수적 대용값에 별도 가정 없이 신뢰구간 해석을 붙이지 않습니다.

Full difference is eighteen over ten, or nine-fifths. Deletion values are nine and one, range one to nine. Their mean five gives variance proxy sixteen. Unequal masses make it especially important not to attach automatic sampling-interval interpretation.

35. 세 묶음 jackknife 식The three-group jackknife expression

단위 질량의 세 묶음 차이가 1,2,3입니다. 전체 평균, 삭제 평균 세 개와 V_J를 계산하세요.

Three unit-mass groups have differences one, two and three. Calculate the full mean, deletion values and V_J.

풀이와 확인할 이유Solution and explanation

전체 평균은 2입니다. 삭제 값은 (2+3)/2=5/2,(1+3)/2=2,(1+2)/2=3/2입니다. 이들의 평균은 2이고 편차 제곱 합은 1/2이므로 V_J=(2/3)(1/2)=1/3입니다. 손실 차이의 제곱 단위를 가지며, 이 계산만으로 95% 신뢰구간을 얻은 것은 아닙니다.

The full mean is two and deletion values are five-halves, two and three-halves. Their centered squared deviations sum to one-half, giving V_J one-third. Its units are squared loss-difference units; this alone is not a 95 percent interval.

36. 묶음이 하나만 남으면Only one paired group

양의 시험 행이 여러 개지만 모두 원 묶음 G 하나에 속합니다. 평균 차이는 계산할 수 있습니다. 삭제 범위와 분산 대용값도 0으로 적어야 하나요?

Several positive-weight test records all belong to one original group G. The mean difference exists. Should the deletion range and variance proxy be recorded as zero?

풀이와 확인할 이유Solution and explanation

아닙니다. G를 지우면 남은 질량이 0이므로 삭제 평균 자체가 미정의입니다. 적어도 두 평가 묶음이 필요한 범위와 분산 대용값도 미정의로 남깁니다. 전체 평균의 존재와 삭제 진단의 존재는 다른 조건입니다.

No. Deleting G leaves zero mass, so its deletion mean is undefined. The range and proxy requiring at least two evaluable groups remain undefined too. Existence of the full mean does not establish existence of a deletion diagnostic.

37. 정확한 0과 평가 불가Exact zero versus unavailable evaluation

서로 다른 양의 두 묶음에서 A와 B의 예측이 각각 완전히 같습니다. 평균 차이와 V_J는 무엇인가요? 모든 라벨이 결측인 경우와 비교하세요.

In two distinct positive groups, A and B make identical predictions. What are the mean difference and V_J? Contrast all labels being missing.

풀이와 확인할 이유Solution and explanation

관측 가능한 두 묶음의 손실 차이가 모두 정확히 0이므로 평균 차이와 V_J는 정의된 0입니다. 라벨이 모두 없으면 손실 차이를 평가할 양의 집합이 없어 평균과 진단은 미정의입니다. 0이 나왔다는 사실도 같은 미래 위험이나 인과적 동등성을 보장하지 않습니다.

Observed loss differences are exactly zero, so both the mean and V_J are defined zeros. Missing every label leaves no evaluable mass, making them undefined. Even defined sample zeros do not guarantee equal future risk or causal equivalence.

38. 시험 한 행에서 고른 완벽한 후보A perfect score selected on one test label

가상 Y가 0과1을 같은 확률로 갖고 후보는 상수 0과1입니다. 시험 한 행을 본 뒤 맞힌 후보를 고르면 보고한 시험 손실과 독립적인 새 Y에 대한 제곱 위험은?

Y is zero or one equally often and candidates always predict zero or one. Select the candidate matching a single test label. What are the reported test loss and risk on an independent new Y?

풀이와 확인할 이유Solution and explanation

보고한 시험 손실은 항상 0입니다. 그러나 선택 후 어느 상수가 남아도 독립 새 Y는 절반 확률로 반대이므로 미래 제곱 위험은 1/2입니다. 시험 라벨을 후보 선택에 사용한 낙관을 보여 줍니다. 이름만 바꾼 같은 시험에서 다시 점수를 내도 새 독립 검증이 되지 않습니다.

Reported loss is always zero. Either selected constant still misses an independent new outcome with probability one-half, giving future squared risk one-half. Test-driven selection creates the optimism; renaming that test does not create independent validation.

39. 같은 숫자의 의미를 제한하기Bound the meaning of reproduced numbers

원파일 해시와 모든 계산값을 다른 컴퓨터에서 재현했습니다. 이것이 표본 대표성, 전문가 점수의 경제적 가치, 미래 시기 성능을 확인했다는 뜻인가요?

File hashes and all calculations reproduce on another computer. Does that establish sample representativeness, economic value of expert scores or future-period performance?

풀이와 확인할 이유Solution and explanation

아닙니다. 같은 입력 계약의 계산 재현을 확인한 것입니다. 대표성은 표집·대상 모집단, 경제적 가치는 측정·선호·가격 자료, 미래 성능은 시기 이동과 적절한 새 평가 근거가 필요합니다. 계산 재현을 낮게 보는 것이 아니라 그 근거가 지지하는 주장을 정확히 제한하는 것입니다.

No. This verifies computation under the same input contract. Representativeness needs sampling and target-population evidence; economic value needs measurement and preference/price information; future performance needs appropriate temporal evaluation. Value reproduction while limiting its claim correctly.

40. 무엇에 조건부인 위험인가What is the evaluated risk conditional on?

선택 함수 f_*를 훈련·검증 자료로 고정했습니다. 독립적인 IID 시험·유한 손실 기대 가정 아래 조건부 평균 시험 위험이 추정하는 대상을 쓰고, 훈련·선택을 반복한 알고리즘 위험과 구별하세요.

Freeze f_* using training and validation. Under independent IID test sampling and integrable loss, state the target of conditional mean test risk and distinguish the risk of a repeatedly trained/selected algorithm.

풀이와 확인할 이유Solution and explanation

조건부 기대는 R_P(f_*)입니다. 즉 지금 고정한 함수가 목표 P의 새 관측에서 갖는 위험입니다. 훈련·검증 표본을 다시 뽑는 알고리즘 위험은 선택 함수 자체의 변동까지 평균낸 E[R_P(f_*(D_tr,D_val))]라는 다른 대상입니다. 고정 시험 묶음 삭제가 그 전체 변동을 자동 포함하지 않습니다. 실제 자료에서 IID·목표 P를 확인하지 못했다면 가정과 제한을 함께 적어야 합니다.

The conditional expectation is R_P(f_*), the target-population risk of the presently frozen function. Repeated-algorithm risk averages R_P(f_*(D_tr,D_val)) over training and selection variation. Frozen-test group deletion does not automatically include that layer. Where IID sampling or target P is unverified, state the assumptions and limitation.

41. 실제 와인 검증의 선택Selection from factual wine validation risks

검증 MSE가 상수 0.71177252,릿지 .01은 0.51648887,.1은 0.62566995,1은 0.69745669,나무는 0.59696002입니다. 어떤 후보를 고르나요? 고른 후보의 시험 MSE가 0.56653931인 것은 모순인가요?

Factual validation MSEs are 0.71177252, 0.51648887, 0.62566995, 0.69745669 and 0.59696002 for constant, three ridge penalties and stump. Select a candidate. Is its test MSE 0.56653931 contradictory?

풀이와 확인할 이유Solution and explanation

검증 최소인 λ=.01 릿지를 고릅니다. 검증과 시험은 서로 다른 관측 집합이므로 시험 MSE가 검증과 같아야 할 이유는 없습니다. 선택에 시험을 쓰지 않고 그 차이를 보고합니다. 이 값은 반올림이며 원 정확값·분할 계약은 함께 보존합니다.

Select ridge λ=.01. Validation and test are different records, so their risks need not match. Report the discrepancy without reopening selection. Displayed values are rounded; exact results and the split contract remain available.

42. NLS 결측 행의 예측Predictions for NLS missing-label records

NLS 예정 시험 904행 중 159행의 Y가 결측이지만 X는 완전합니다. 그 159행에 예측을 내는 것과 실제 시험 MSE의 분모에 넣는 것을 구분하세요.

Of 904 planned NLS test rows, 159 lack Y but have complete X. Distinguish predicting these rows from including them in empirical test MSE.

풀이와 확인할 이유Solution and explanation

고정 모형은 X로 예측할 수 있으므로 159행의 예측을 원행 장부에 남길 수 있습니다. 그러나 Y가 없어 오차를 계산할 수 없으므로 관측 시험 MSE는 완전한 745행으로 나눕니다. 예측을 제공했다는 사실을 정답이나 손실을 관측했다는 사실로 바꾸지 않습니다.

A frozen model may predict from complete X and retain those predictions. Missing Y prevents observed error calculation, so empirical test MSE uses 745 complete rows. Prediction availability is not observation of correctness or loss.

43. 좋은 AUC와 0인 재현율A defined AUC with zero positive recall

실제 이탈 시험에서 TP=0,FP=0,TN=639,FN=132입니다. 정확도·양성 재현율·균형 정확도·precision 상태를 구하세요. AUC가 약 .8154라는 결과와 양립하나요?

Factual churn test counts are TP zero, FP zero, TN 639 and FN 132. Find accuracy, positive recall, balanced accuracy and precision status. Can AUC still be about .8154?

풀이와 확인할 이유Solution and explanation

정확도는 639/771≈.82879, 양성 재현율 0, 음성 재현율 1이므로 균형 정확도 .5입니다. 예측 양성 질량 0으로 precision은 미정의입니다. 두 실제 클래스의 점수 순위는 모두 .5 아래에서도 다를 수 있어 AUC≈.8154와 양립합니다. 다만 혼동표만으로 그 AUC값을 계산할 수는 없고 원 점수 순위가 필요합니다.

Accuracy is about .82879, positive recall zero and negative recall one, giving balanced accuracy .5. Precision is undefined without predicted positives. Scores below .5 can still rank observed positives above negatives, so AUC .8154 is compatible. The confusion table alone cannot calculate that AUC; full scores are needed.

44. 13,260의 관측 단위The units behind 13,260 records

세 사례의 원행 수를 더하면 13,260입니다. 이를 “13,260개 국가·개인·기업의 독립 표본”이라고 하나의 모집단에 합쳐 써도 되나요?

The three cases total 13,260 native records. May these be pooled as one population of 13,260 independent countries, people and companies?

풀이와 확인할 이유Solution and explanation

그렇게 쓰면 관측 단위와 독립성을 모두 과장합니다. 와인은 포르투갈 산업 맥락의 와인 기록, NLS는 원 개인 기록, 이탈은 고객 기록입니다. 결과·단위·표집 범위가 다르고 행 주소가 독립성을 보장하지 않습니다. 합계는 제공한 원기록 수의 합이며 하나의 공통 위험을 계산할 모집단이 아닙니다.

No. Wine records, NLS individuals and customer records have different targets, units and sampling scopes. File addresses do not establish independence. The total counts supplied records, not one population for pooling risks.

45. 같은 후보 ID의 다른 손실The same candidate ID has different risk scales

세 자료의 기본 선택 ID가 모두 ridge:1/100입니다. 시험 MSE .5665·.1612·.1244를 보고 이탈 모형이 가장 우수하다고 결론내릴 수 있나요?

All three defaults select ridge:1/100. Do test MSEs .5665, .1612 and .1244 establish churn as the best model?

풀이와 확인할 이유Solution and explanation

아닙니다. 같은 후보 이름이어도 목표·변환·설명변수·단위·평가 집합이 다릅니다. 각 자료 안에서 상수 대비 차이와 코호트·분류 진단을 읽습니다. 서로 다른 문제의 원 MSE를 하나의 공통 성능 척도처럼 순위 매기지 않습니다.

No. The name does not align targets, transforms, inputs, units or evaluation populations. Read baseline differences and cohort/classification diagnostics within each task rather than ranking raw cross-task MSEs.

46. 실제 한 단계 나무의 문턱 읽기Read a factual one-split threshold

실제 와인 나무는 원 alcohol 열 문턱 217/20으로 나누고, 왼쪽 평균 11619/2089·오른쪽 3671/583을 씁니다. 모든 X가 완전한 가상 질의의 alcohol=11이면 어느 예측인가요? 원 학습 행 수 2089·1166을 더해 확인하세요.

The factual wine stump splits native alcohol at 217/20, with means 11619/2089 left and 3671/583 right. For a constructed complete-X query with alcohol eleven, which prediction applies? Check training counts 2089 and 1166.

풀이와 확인할 이유Solution and explanation

217/20=10.85이고 11은 그보다 크므로 오른쪽 예측 3671/583입니다. 다른 특징은 이 나무의 분기를 바꾸지 않지만 공통 입력 계약의 완전성은 필요합니다. 학습 행 수는 2089+1166=3255로 기본 훈련 집합과 같습니다. 이것은 나무 후보의 계산이며 검증 최종 선택은 릿지라는 점도 구분합니다.

Eleven exceeds 10.85, so use the right mean 3671/583. Other features do not change this stump branch but remain required by the common complete-input contract. Leaf counts sum to 3,255 training rows. This evaluates a candidate stump; the validation-selected final candidate is ridge.

47. 원행 번호와 개인 IDSource row versus individual ID

NLS 첫 원행의 보존된 개인 ID가 2이고 분석 행 ID는 nls-row:1입니다. 두 표기가 다른 이유와 원자료 연결에 필요한 정보를 적으세요.

The first NLS source row has preserved original person ID two and analytical row ID nls-row:1. Explain the difference and what is needed to trace it.

풀이와 확인할 이유Solution and explanation

원행 번호 1은 파일 내 위치이고 ID 2는 원 개인 식별자입니다. 둘이 같아야 할 이유가 없습니다. 자료 이름·원행 번호·원 ID·열 이름과 값의 연결을 보존해야 합니다. nls-row:1을 ID 1인 다른 사람으로 바꾸거나 원 ID를 순서대로 다시 매기면 원자료 추적이 깨질 수 있습니다.

One is a file position; two is the native individual identifier. They need not match. Preserve dataset, row, original ID and variable/value links. Renumbering original IDs can break traceability.

48. 이탈 실무 메모의 첫 한계The first limitation in a churn memo

Brier가 낮아졌고 AUC≈.8154입니다. 기본 문턱의 TP=0을 생략하고 “이탈자를 찾아 유지 활동에 즉시 적용”이라고 썼습니다. 어떤 사실과 다음 질문을 추가해야 하나요?

A memo cites lower Brier and AUC .8154 but omits TP zero and recommends immediate retention action. What facts and follow-up questions are needed?

풀이와 확인할 이유Solution and explanation

기본 .5 문턱에서 양성 예측 0·실제 이탈 132·재현율 0·precision 미정의를 밝혀야 합니다. 검증에서 문턱·연락량을 정하는 절차, 확률 보정 확인, 연락 비용과 실제 개입 효과를 별도 질문으로 제안합니다. 예측 순위 개선을 유지 개입의 인과 성공으로 바꾸지 않습니다.

Disclose no positive predictions, 132 actual departures, zero recall and undefined precision at the default threshold. Separately ask about validation-based thresholds/capacity, calibration, contact costs and intervention effects. Ranking improvement is not causal retention success.

49. 그림의 원행 순서는 시간인가Is source order a time axis?

쌍별 손실 차이 그림에서 뒤쪽 원행의 오차가 커 보입니다. 가로축은 원행 순서인데 “시간이 흐르며 모형이 악화했다”고 써도 되나요?

Later plotted source records appear to have larger loss differences. The horizontal axis is source order. May this be called deterioration over time?

풀이와 확인할 이유Solution and explanation

안 됩니다. 원행 순서는 달력 시간이 아니며 실제 관측 날짜도 없는 자료가 있습니다. 뒤쪽 코호트 구성·기록 정렬의 차이 등을 확인할 수는 있지만 시간 추세를 관측했다고 말할 근거가 아닙니다. 원행·코호트·실제 날짜가 있으면 그 정의를 따로 연결해야 합니다.

No. Source order is not calendar time, and some sources provide no individual dates. Inspect composition and record ordering, but do not infer a temporal trend without an actual timestamp link.

50. 원본 벡터가 뜻하는 것What original vector means here

이 장의 SVG와 좌표 CSV를 내려받았습니다. 이를 “원 와인 논문 그림의 완전 복원”이라고 소개해도 되나요? 올바른 자료 종류를 쓰세요.

You download this chapter’s SVG and coordinate CSV. May they be described as a full restoration of an original wine-paper figure? State what they are.

풀이와 확인할 이유Solution and explanation

그렇게 소개하지 않습니다. 원자료를 사용해 이 장의 분할·다섯 후보·검증 선택으로 새로 계산한 그림의 원본 벡터와 좌표입니다. 원논문의 학습기·평가 설계·그림과는 구별합니다. 관측 Y와 계산 예측을 섞지 않고, 결측은 0점으로 만들어 그리지 않습니다.

They are original vectors and coordinates of new calculations under this chapter’s split, candidates and selection, not restored paper figures. Distinguish the paper’s procedures, factual observations, fitted predictions and missing data.

51. 정답을 입력으로 읽지 않는 재현Reproduction without reading the answer

완전 재현 코드의 새 폴더에는 네 원 CSV와 코드만 있습니다. 이미 계산된 계수·그림·정답 CSV가 없습니다. 코드에서 무엇을 확인하면 원자료에서 새로 계산했다고 볼 근거가 되나요?

A fresh directory contains four native CSVs and code, without fitted parameters, plots or answer CSVs. What should be inspected in the program?

풀이와 확인할 이유Solution and explanation

여는 파일 목록이 원 입력뿐인지, 원 숫자로 묶음·역할·훈련 변환·계수와 나무·검증 선택·시험 위험을 계산하는지 확인합니다. 원행 수와 제외 상태가 보존되는지도 봅니다. 같은 결과 파일을 읽어 다른 이름으로 저장한 것은 학습과 평가를 재현한 것이 아닙니다. 코드 경로·입력 해시·실제 출력 모두를 연결해야 합니다.

Inspect file reads and recalculation of groups, roles, transformations, models, selection and test metrics from native numbers, including counts and exclusions. Renaming an answer file is not reproducing learning and evaluation. Link code path, input hashes and actual outputs.

52. 정확한 십진수와 이진 근사Exact decimal meaning versus binary approximation

입력 0.1과 0.2를 정확한 십진 유리수로 해석한 합은? 이진 부동소수점의 표시가 마지막 자리에서 다를 때 바로 다른 모형이라고 결론 내릴 수 있나요?

What is the sum when 0.1 and 0.2 mean exact decimal rationals? Does a last-digit floating-point difference immediately imply a different model?

풀이와 확인할 이유Solution and explanation

정확값은 1/10+1/5=3/10입니다. 이진 표현의 마지막 자리 차이만으로 다른 모형이라고 결론내리지는 않습니다. 먼저 이론 절차·역할·동률·정규화를 맞추고 선언한 수치 척도로 비교합니다. 반대로 큰 의미 차이를 반올림이라고 임의로 덮어서도 안 됩니다.

The exact sum is three-tenths. A last-digit binary difference alone does not establish a different model. Align procedure, roles, ties and normalization, then use a declared numeric check. Do not excuse substantive differences as rounding either.

53. 단위를 반영한 대응 척도A scaled numeric comparison

기준 a=100,근사 b=100+10⁻⁸입니다. |a−b|/max(1,|a|)를 계산해 2×10⁻¹⁰ 규칙에 맞는지 확인하세요. 이것이 모든 연산의 엄밀 오차 상한인가요?

Reference a is one hundred and b is one hundred plus 10 to the minus eight. Compute scaled error and compare with 2 times 10 to the minus ten. Is it a rigorous bound for every operation?

풀이와 확인할 이유Solution and explanation

척도는 10⁻⁸/100=10⁻¹⁰로 기준 안입니다. 이는 두 결과의 대응을 확인하는 선언한 규칙입니다. 그 자체가 선형대수의 모든 반올림·조건수에 대한 엄밀 오차 상한을 증명하지는 않습니다. 이산적인 선택이나 ID가 틀렸다면 수치 허용 오차로 통과시킬 수도 없습니다.

Scaled error is 10 to the minus ten, within the threshold. This is a declared comparison rule, not a proof covering conditioning and every rounding step. Wrong IDs or discrete selections cannot be accepted through a numeric tolerance.

54. 표시 동률과 정확 동률Displayed ties versus exact ties

후보 A의 위험은 13/100, B는 13000000000001/100000000000000입니다. 화면 소수 둘째 자리에서는 둘 다 0.13입니다. 정확한 최소와 동률 여부를 말하세요.

A has risk 13/100 and B 13000000000001/100000000000000. Both display 0.13 to two decimals. State the exact minimum and whether a tie exists.

풀이와 확인할 이유Solution and explanation

A는 정확히 0.13이고 B는 0.13000000000001이므로 A가 작고 정확한 동률은 아닙니다. 선언 순서 규칙은 정확히 같을 때 적용합니다. R의 근사 동률 허용 규칙은 이런 임의의 가까운 가상 입력에서 정확 분기를 인증하는 것이 아니므로 그 산술 계약도 구분합니다.

A is exactly 0.13 and B slightly larger, so A wins without an exact tie. Declaration-order tie handling applies to equal values. R’s explicitly approximate tie rule does not certify exact branches for arbitrary near-tie teaching inputs.

55. 같은 데이터셋의 다른 연구Different studies on one named dataset

원 와인 연구에서 SVM이 좋은 성능을 보였다는 글과 이 장의 λ=.01 릿지 선택을 읽었습니다. 두 결론이 모순이라고 바로 말할 수 있나요?

The original wine study reports promising SVM performance, while this chapter selects ridge λ=.01. Are those conclusions immediately contradictory?

풀이와 확인할 이유Solution and explanation

그렇게 말할 수 없습니다. 후보 목록, 특징·변수 선택, 분할과 평가 목표가 다를 수 있습니다. 이 장의 선택은 미리 정한 다섯 후보 안에서 해당 검증 규칙의 결과입니다. 원 논문과 동일 실험을 재현했다는 주장도, 원 논문의 모든 기법을 이겼다는 주장도 아닙니다.

No. Candidate sets, variable selection, splits and evaluation aims may differ. Our selection is within five predeclared candidates under this validation rule, not a replication of every original experiment or victory over all its methods.

56. 영상의 교차검증과 실제 기본 분할Cross-validation versus the factual default split

영상은 교차검증을 설명하고 이 장의 실제 기본 수치는 한 번의 훈련·검증·시험 분할입니다. 영상 제목을 근거로 실제 수치를 “k겹 교차검증 평균”이라고 써도 되나요?

The video explains cross-validation, but factual default scores use one train/validation/test split. May the scores be called k-fold cross-validation means because of the video?

풀이와 확인할 이유Solution and explanation

안 됩니다. 읽기·영상의 개념 설명과 실제 실행한 평가 절차를 구분해야 합니다. 여러 겹에서 전처리·학습·선택을 다시 수행한 별도 평가가 없다면 그 평균이라고 부르지 않습니다. 실제 수치에는 실제 분할과 분모를 적습니다.

No. Educational context differs from the procedure actually run. Without separately refitted preprocessing, learning and selection over folds, these are not fold averages. Report the actual split and denominator.

57. 유효하지 않은 값을 숨기지 않기Do not hide invalid inputs in inactive rows

일반 이진 평가 입력에 Y=1/2인 행이 있고 비중은 0입니다. 결과가 없는 행이 아니라 범위를 벗어난 라벨입니다. 비중 0이니 조용히 허용해야 하나요?

A generic binary-evaluation row has Y one-half and weight zero. This is an out-of-range label rather than missingness. Should zero weight silently authorize it?

풀이와 확인할 이유Solution and explanation

아닙니다. 이진 라벨 계약은 정확히 0또는 1, 또는 명시한 결측입니다. 잘못된 형식을 비활성 여부 때문에 숨기지 않고 거절합니다. 유효한 행의 분석 기여를 0으로 하는 것과 입력의 의미가 잘못된 것은 다른 상태입니다.

No. Binary labels must be exactly zero or one, or explicit missingness. Reject invalid meaning rather than hiding it behind inactivity. Valid zero contribution differs from invalid input.

58. 점수·분류·행동의 세 문장Three sentences on scores, classes and actions

실제 이탈 기본 결과를 점수 성능, 고정 문턱 분류, 실제 유지 행동의 세 문장으로 요약하세요.

Summarize factual default churn results in three sentences: score performance, fixed-threshold classification and actual retention action.

풀이와 확인할 이유Solution and explanation

점수는 상수보다 낮은 시험 Brier와 약 .8154의 AUC를 보였습니다. 그러나 문턱 .5에서 양성을 예측하지 않아 실제 이탈 132명을 모두 음성으로 분류했습니다. 연락·쿠폰의 비용과 효과는 관측하지 않았으므로 실제 유지 정책의 성과는 이 자료로 확정하지 않습니다.

Scores have lower test Brier than the constant and AUC about .8154. At threshold .5, no positive predictions are made and all 132 observed departures are classified negative. Contact/coupon costs and effects are unobserved, so retention-policy performance is not established.

59. 종합 보고서의 최소 근거Minimum evidence in a capstone report

보고서가 “모형 정확도 좋음” 한 줄뿐입니다. 이 장의 한 실제 사례를 골라 반드시 붙일 근거 다섯 가지와 분산 대용값을 읽는 한계를 적으세요.

A report says only model accuracy is good. Choose one factual case, name five essential evidence items and state a limitation of the variance proxy.

풀이와 확인할 이유Solution and explanation

관측 단위·결과 단위, 원자료·결측·분모, 분할과 훈련 전용 변환, 검증 선택 기준·후보·동률, 같은 시험 행의 기준선 대비 위험과 코호트 진단을 포함합니다. 원행·코드·표·그림 좌표의 재현 연결도 제시합니다. 분산 대용값은 고정한 선택·예측의 삭제 진단이며 적절한 독립 묶음·비중·정규성 가정이나 전체 재학습 불확실성을 자동 제공하지 않습니다.

Include units and target, sources/missingness/denominators, split and train-only transforms, candidates/validation criterion/ties, and same-test baseline risks with cohort diagnostics. Link records, code, tables and coordinates. The proxy concerns frozen predictions and selection; it does not supply suitable independent-group assumptions or full retraining uncertainty automatically.

60. 다음 단계에 없는 날짜 만들지 않기Do not invent missing operational dates

실제 고객별 달력 날짜가 없는 파일을 원행 1은 1월,2는 2월이라고 붙여 실제 미래 성능 감시라고 부르려 합니다. 무엇을 고쳐야 하나요?

A file lacks customer calendar dates. Someone labels source row one January and row two February and calls the result factual future monitoring. What needs correction?

풀이와 확인할 이유Solution and explanation

원행 순서는 실제 날짜가 아닙니다. 그런 배치는 명시한 가상 도착 시나리오로만 설명하고 실제 관측 시각으로 주장하지 않습니다. 실제 모니터링에는 대상·예측 ID, 입력 버전·가용 시각, 결과 시각과 라벨 도착 상태가 필요합니다. 실제 원기록과 가상 운영 규칙을 구분해야 다음 장에서도 해석이 유지됩니다.

Source order is not time. Label such a construction as a hypothetical arrival scenario, not observed dates. Factual monitoring requires entity/prediction IDs, input versions/availability times, outcome times and label-arrival states. Keep native records separate from constructed operational schedules.

자료와 출처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