훈련·검증·시험·그룹·시간 분할Training, validation, test, group and time splits
새 대상의 질문에 맞추어 원행·그룹·시간과 선택을 보존하기Preserve records, groups, time and selection for the stated new target
실습 6종 · 풀이 포함 연습문제 60개6 labs · 60 exercises with solutions
기초Foundations
1. 연습에서 잘한 것과 처음 보는 문제를 구별한다1. Separate practice success from performance on unseen problems
풀이를 외운 연습 문제에서 만점을 받았다고 처음 보는 시험에서도 만점을 받는 것은 아닙니다. 예측 규칙을 만드는 데 쓴 정답에서 좋은 점수를 얻는 일과, 규칙을 고른 뒤 별도로 남긴 정답에서 평가하는 일도 구별해야 합니다. DATA10에서 계산한 손실에 이제 자료의 역할을 붙입니다.
훈련 자료는 규칙의 수치를 맞추는 데, 검증 자료는 후보나 설정을 고르는 데, 시험 자료는 정한 선택을 평가하는 데 씁니다. 세 이름을 붙였다는 사실만으로 새 대상 성과가 보장되지는 않습니다. 누가 반복됐고 어떤 시점의 정보를 썼는지까지 봅니다.
이 장의 분할은 원행을 삭제하는 자료 정리와 다릅니다. 모든 행의 원키와 역할을 남기며, 명시한 시간 간격으로 제외한 행도 별도 역할로 보존합니다. 실제 이미 존재하던 자료를 지금 나누는 학습 실험과 과거에 실제로 시행한 전향적 실험도 구별합니다.
A perfect score on memorized practice questions does not guarantee a perfect score on unseen questions. Likewise, distinguish loss on outcomes used to fit a prediction rule from loss on separately retained outcomes examined after choosing the rule. Add data roles to the losses calculated in DATA10.
Training data fit a rule’s quantities, validation data select candidates or settings, and test data evaluate the chosen procedure. Naming three files does not guarantee new-target performance. Repeated units and information timing still matter.
Partitioning differs from deleting records during cleaning. Preserve original keys and roles, including a separate excluded-gap role when declared. A learning exercise partitioning existing outcomes now also differs from a prospective experiment actually carried out in the past.
기초Foundations
2. 먼저 새로 맞힐 대상의 단위를 적는다2. First state the unit of the new prediction target
같은 사람이 쓴 새 숫자를 맞힐까요, 처음 보는 사람이 쓴 숫자를 맞힐까요? 같은 제품의 다른 측정값을 맞힐까요, 새 제품을 맞힐까요? 내년 분기를 맞히는 문제와 지금까지 관측한 분기 중 한 행을 임의로 가리는 문제도 다릅니다.
관측 행은 목표 단위와 같지 않을 수 있습니다. 손글씨 이미지 한 행이 사람 한 명은 아니며, 품목 기록 한 행이 확인된 독립 제품 하나도 아닙니다. 새 대상의 단위·정보 시점·평가 손실을 정한 뒤 그 질문과 맞는 분할을 선택합니다.
이 장의 실제 사례는 시간순 국가 분기, 제공자가 나눈 손글씨 파일, 와인의 동일 입력 패턴 묶음을 봅니다. 원자료가 알려 주지 않는 작성자 ID나 제품 ID를 만들어 넣지 않습니다.
Are we predicting another image from a familiar writer or an image from a new writer? Another measurement of a familiar product or a new product? Forecasting next year differs from hiding an arbitrary row among periods already observed.
A row need not be the target unit. One handwriting image is not one person, and one product record is not a verified independent product. Specify the new unit, information cutoff and loss before choosing a matching partition.
The actual cases use chronological country quarters, source-provided handwriting files and identical-input wine groups. Do not invent writer or product IDs absent from the source.
기초Foundations
3. 작은 열두 행에 역할을 붙여 본다3. Assign roles to twelve small records
먼저 원키 1~10을 순서대로 놓습니다. 훈련 비율 3/5는 10×3/5=6행, 검증 비율 1/5는 10×1/5=2행입니다. 남은 10−6−2=2행을 시험에 보냅니다. 원키는 배정 뒤에도 그대로 남습니다.
설명용 10행의 6·2·2 배정
원키
이번 역할
1
훈련
2
훈련
3
훈련
4
훈련
5
훈련
6
훈련
7
검증
8
검증
9
시험
10
시험
설명용 원행 키를 1부터 12까지 붙입니다. 훈련 비율 3/5, 검증 비율 1/5를 선택하고 각 개수의 소수 부분을 버리며 남은 행은 시험으로 둡니다. 훈련 7행, 검증 2행, 시험 3행입니다. 60%·20%·20%라는 비율 선택과 실제 정수 개수는 완전히 같지 않을 수 있습니다.
nT=⌊12⋅3/5⌋=7nV=⌊12⋅1/5⌋=2nE=12−7−2=3
T는 훈련, V는 검증, E는 시험을 나타냅니다. 여기서는 한 원행이 정확히 한 역할만 갖습니다. 어떤 키를 먼저 배정하는지는 뒤 순서 규칙으로 정하며, 개수만 맞췄다는 사실과 독립 표집은 다른 조건입니다.
Start with source keys one through ten in order. Training fraction 3/5 gives 10×3/5=6 rows; validation fraction 1/5 gives two. The remaining 10−6−2=2 rows are test. Original keys stay attached after assignment.
A toy ten-row assignment with counts 6, 2, 2
Source key
Assigned role
1
Training
2
Training
3
Training
4
Training
5
Training
6
Training
7
Validation
8
Validation
9
Test
10
Test
Give twelve toy records source keys one through twelve. Choose training fraction 3/5 and validation fraction 1/5, floor each count and assign the remainder to test. The resulting counts are seven, two and three. Chosen percentages need not equal the realized fractions of a small integer sample.
nT=⌊12⋅3/5⌋=7nV=⌊12⋅1/5⌋=2nE=12−7−2=3
T, V and E denote training, validation and test. Every source row has exactly one role here. A separate ordering rule determines which keys enter first. Matching counts does not establish independent sampling.
기초Foundations
4. 역할을 바꾸어도 원행 키를 보존한다4. Preserve source keys when roles change
분할 뒤 훈련 파일의 첫 행을 “원행 1”이라고 새로 부르면 추적이 끊깁니다. 원자료 키와 분할 안의 표시 순서를 따로 둡니다. 원행 8이 훈련 목록의 첫 행일 수 있고, 검증 목록에서는 그 원행을 다시 사용하지 않습니다.
파일 둘이 각각 1부터 행 번호를 붙였다면 파일 이름도 키에 포함합니다. 실제 손글씨의 optdigits.tra 원행 1과 optdigits.tes 원행 1은 다른 기록입니다. 이 파일·원행 조합은 작성자의 신원이 아니라 원기록 위치를 추적하는 키입니다.
실습의 일반 원위치는 1부터 표시합니다. 후보·fold의 내부 인덱스가 0부터 시작하는 반환값에는 그 약속을 따로 적고, 화면 표시 번호와 원자료 키를 혼동하지 않습니다.
Calling the first row of a split file “original row one” breaks traceability. Keep its source key separate from its displayed position inside a partition. Source row eight may appear first in training and must not also be reused as validation.
If two files number their rows independently, include the filename in the key. Original row one of optdigits.tra differs from original row one of optdigits.tes. That composite key identifies a source record, not a writer.
General source positions in the lab are displayed from one. Candidate and fold indices returned from zero are explicitly labeled as such. Do not confuse an interface position with a source key.
기초Foundations
5. 겹침 없음과 빠짐 없음을 각각 확인한다5. Check disjointness and completeness separately
원행 키 집합을 I, 훈련·검증·시험 집합을 T, V, E라고 합시다. 이번 세 역할 분할은 쌍별 교집합이 비고 합집합이 I여야 합니다. 개수 합이 n이라는 조건만으로는 충분하지 않습니다. 한 키를 두 번 넣고 다른 키를 빠뜨려도 개수는 같을 수 있습니다.
T∩V=T∩E=V∩E=∅T∪V∪E=I∣T∣+∣V∣+∣E∣=∣I∣
I={1, 2, 3}에서 T={1, 2}, V={2}, E가 빈집합이면 개수 합은 3이지만 키 2가 겹치고 3은 빠집니다. 실제 검사에서는 키의 교집합과 합집합을 직접 비교합니다. 시간 간격으로 제외하는 뒤 실습에서는 별도 gap 집합까지 합집합에 포함합니다.
Let I contain all source keys, with role sets T, V and E. A complete three-role partition has empty pairwise intersections and union I. Counts adding to n alone are insufficient: repeating one key while omitting another can preserve the count.
T∩V=T∩E=V∩E=∅T∪V∪E=I∣T∣+∣V∣+∣E∣=∣I∣
For I={1, 2, 3}, sets T={1, 2}, V={2} and empty E have total count three but overlap at two and omit three. Compare actual key intersections and unions. The later temporal lab also includes its explicitly excluded gap set in the full union.
기초Foundations
6. 정수 반올림과 빈 역할을 숨기지 않는다6. Keep integer rounding and empty roles visible
일반 n≥0, 훈련 비율 a≥0, 검증 비율 b≥0, a+b≤1에서 n_T=⌊na⌋, n_V=⌊nb⌋, n_E=n−n_T−n_V로 정합니다. 마지막 잔여를 시험에 두는 이 규칙은 세 개수를 서로 독립적으로 반올림하는 규칙과 다릅니다.
n=1, a=3/5, b=1/5이면 훈련 0·검증 0·시험 1입니다. 훈련 없는 자료에서 적합된 평균을 임의로 0으로 만들지 않습니다. 검증이 비었다면 후보 선택 손실도 미정의입니다. 분할 개수가 정의되는 것과 다음 분석이 가능한 것은 다릅니다.
n=0에서는 모든 역할이 비어 있습니다. “평균 손실 0”을 얻은 완벽한 시험이 아닙니다. 자료 수와 정의 상태를 함께 보고, 필요한 비어 있지 않은 역할을 얻으려면 사전에 설계를 바꿔야 합니다.
For integer n≥0 and fractions a, b≥0 with a+b≤1, define n_T=floor(na), n_V=floor(nb) and n_E=n−n_T−n_V. Assigning the remainder to test differs from independently rounding three counts.
At n=1, a=3/5 and b=1/5, the counts are zero training, zero validation and one test. An absent training mean is not filled with zero, and empty validation does not yield a candidate-selection loss. Defined partition counts do not make every downstream analysis defined.
At n=0 every role is empty; this is not a perfect test with zero mean loss. Report counts and definition states. Design nonempty required roles before drawing conclusions.
기초Foundations
7. 재현 가능한 순서와 무작위 표집을 구별한다7. Distinguish reproducible ordering from random sampling
이 장의 설명용 배정은 두 순서를 선택할 수 있습니다. source는 원행 키 순서이고, modular는 아래 정수 값을 먼저 비교한 뒤 동률이면 원키를 비교합니다. offset은 0부터 1,000,002까지의 선언한 순서 이동값입니다.
h(i)=(104729i+offset)mod1000003
이 식과 입력을 공개하면 같은 순서를 재현할 수 있습니다. 그러나 이 결정적 식이 원행을 독립 확률표집했다거나 seed 하나가 독립성을 보장한다는 뜻은 아닙니다. offset을 여러 번 바꾸어 가장 좋은 시험 점수만 고르면 시험 선택을 수행한 것입니다.
계수와 바닥 함수는 실제 와인 사례의 선언한 기본 배정 규칙과 맞춥니다. 그 규칙이 최선이라 주장하지 않습니다. 계산기는 n≤10,000의 정수 위치를 지원하며, 설명용 그룹·손실 입력 목록은 별도 길이·문자 예산을 둡니다.
Choose source-key order or modular order. The latter compares the integer below, breaking ties by the source key. Offset is a declared ordering parameter from zero through 1,000,002.
h(i)=(104729i+offset)mod1000003
Publishing the formula and inputs reproduces the order. It does not establish independent probability sampling, and a seed-like parameter does not guarantee independence. Trying many offsets and reporting only the best test score uses the test for selection.
The coefficients and floor convention match the actual wine case’s declared default rule, without claiming it is universally best. Integer-position calculations support n≤10,000; toy group/loss lists have their own length and character budgets.
기초Foundations
8. 실습 A · 원위치·개수·순서를 바꾼다8. Lab A · change source positions, counts and ordering
원행 수·두 비율·배정 순서·offset을 바꾸어 보세요. 정확한 바닥 개수와 각 원키의 역할, 전체 보존·역할별 겹침 검사를 읽습니다. n=12의 7/2/3과 n=1의 빈 훈련·검증을 직접 확인합니다.
색이 고르게 섞여 보이는 그림과 통계적 독립성은 같은 주장이 아닙니다. 원키로 되돌아가 배정 규칙을 설명할 수 있는지 확인하고, 비율 합이 1을 넘는 오류 뒤 이전 표가 지워지는지도 봅니다. 브라우저 조절은 JavaScript 계산이며 실제 Python/R 실행은 뒤의 고정 기록과 구별합니다.
Change source count, two fractions, ordering and offset. Read exact floor counts, each source key’s role, completeness and overlap checks. Verify the 7/2/3 allocation for n=12 and empty training/validation for n=1.
A visually mixed color pattern is not statistical independence. Trace assignments back to keys and the stated rule. If fractions sum above one, verify that the previous result is cleared. Live controls calculate in JavaScript; actual Python/R executions are separate fixed records.
기초Foundations
9. 행을 나누어도 같은 단위가 양쪽에 있을 수 있다9. Disjoint rows can still contain the same underlying unit
네 행의 그룹이 A, A, B, B라고 합시다. 첫 배정에서는 A의 두 행이 훈련·검증으로 갈라지고 B도 훈련·시험으로 갈라집니다. 둘째 배정은 A를 모두 훈련, B를 모두 시험에 보내 같은 그룹이 역할을 건너지 않게 합니다.
같은 네 원행을 유지한 작은 대조
원키
그룹
행별 배정
그룹째 배정
1
A
훈련
훈련
2
A
검증
훈련
3
B
훈련
시험
4
B
시험
시험
둘째 배정에는 검증이 없습니다. 그룹 겹침을 없앤 것과 세 역할의 크기가 충분한 것은 따로 확인해야 합니다.
가정 작성자 A가 쓴 이미지 두 장을 원행 1·2에, 작성자 B의 두 장을 3·4에 두었다고 합시다. 훈련에 1·3, 검증에 2·4를 넣으면 행 키는 겹치지 않지만 두 작성자가 모두 양쪽에 있습니다. 새 작성자 성능을 묻는 평가와 맞지 않습니다.
행 교집합과 그룹 교집합은 별도로 계산해야 합니다. 실제 데이터에서 그룹 ID가 없으면 이 검사를 했다고 주장하지 않습니다. 제공자가 작성자를 분리했다고 설명한 원 분할과, 파일 안에서 우리가 새로 만든 행 분할의 근거도 다를 수 있습니다.
Consider four group labels A, A, B, B. One row assignment separates A across training/validation and B across training/test. Another sends all A rows to training and all B rows to test, preventing those groups from crossing roles.
Two assignments preserving the same four source rows
Source key
Group
Row assignment
Whole-group assignment
1
A
Training
Training
2
A
Validation
Training
3
B
Training
Test
4
B
Test
Test
The second assignment has no validation set. Zero group overlap and sufficient role sizes are separate questions.
Suppose toy writer A produced image rows one and two, and writer B rows three and four. Training rows one/three and validation rows two/four are disjoint, yet both writers occur on both sides. That does not match evaluation on new writers.
Calculate row overlap and group overlap separately. Without group IDs, do not claim to have audited the second. Provider-reported writer separation for supplied files also differs from evidence about a new internal row partition.
기초Foundations
10. 그룹 비율과 행 비율은 다르다10. Group fractions and row fractions differ
설명용 그룹 A에 4행, B에 1행, C에 1행, D에 2행이 있다고 합시다. 그룹 4개 중 2개를 훈련에 넣어도 어떤 그룹을 골랐느냐에 따라 훈련 행 수가 달라집니다. A·D면 6행, B·C면 2행입니다. 그룹 수의 절반이 행 수의 절반을 뜻하지 않습니다.
그룹을 쪼개지 않기 위해 그룹 개수를 기준으로 바닥 비율을 적용하고 그 그룹의 모든 행을 함께 배정합니다. 실제로 나온 그룹 수와 행 수를 모두 보고합니다. 행 비율을 정확히 맞추겠다고 한 그룹을 나누면 앞의 설계 조건을 바꾼 것입니다.
Suppose toy group A has four rows, B one, C one and D two. Putting two of the four groups into training gives six rows for A/D but only two for B/C. Half the groups need not mean half the rows.
Apply floor fractions to group counts, then move all rows in each group together. Report realized group and row counts. Splitting a group merely to hit an exact row fraction changes the declared design.
기초Foundations
11. 같은 그룹은 같은 역할이라는 조건을 확인한다11. Verify that one group always receives one role
각 원행 i의 선언한 그룹을 g(i)라 쓰고, 그룹에서 역할로 가는 함수 A를 정합니다. 행의 역할은 A(g(i))입니다. 같은 그룹을 가진 두 행의 역할이 같으므로 그룹이 훈련·검증·시험 사이에 갈라지지 않습니다.
g(i)=g(j)⟹A(g(i))=A(g(j))
이는 선택한 그룹 키의 문자열 동등성에 대한 계산 보장입니다. 그 키가 실제 사람·가계·제품·병원을 정확히 나타내는지, 서로 다른 그룹이 통계적으로 독립인지까지 증명한 것은 아닙니다. 둘은 다른 근거를 요구합니다.
Let g(i) be the declared group of source row i and let A map each group to a role. Assign row i to A(g(i)). Two rows from the same group therefore receive the same role and cannot cross training, validation and test.
g(i)=g(j)⟹A(g(i))=A(g(j))
This guarantees equality of roles for the chosen string keys. It does not prove that keys correctly identify people, households, products or hospitals, or that different groups are statistically independent. Those require separate evidence.
기초Foundations
12. 행 평균과 그룹 평균의 평가 표적을 나눈다12. Separate row-weighted and group-weighted evaluation targets
가용 그룹이 G≥1개이고 그룹 g에 n_g≥1개의 가용 평가 손실이 있다고 합시다. 그 그룹 평균 손실을 L_g라 두면, 모든 행을 같은 무게로 평균한 값과 모든 그룹을 같은 무게로 평균한 값은 다음과 같습니다.
Lrow=∑gng∑gngLgLgroup=G1g∑Lg
가정 A의 4행 평균이 0, B의 1행 평균이 10이면 행 평균은 2, 그룹 평균은 5입니다. 어느 쪽이 계산 오류인 것이 아니라 목표 가중치가 다릅니다. 빈 평가 그룹은 0손실로 채우지 않고 해당 표적과 가용 분모를 다시 명시해야 합니다.
Suppose G≥1 available groups each contain n_g≥1 available evaluation losses, with group mean L_g. Equal weighting of rows and equal weighting of groups give the following two targets.
Lrow=∑gng∑gngLgLgroup=G1g∑Lg
If group A has four rows averaging zero and B has one row averaging ten, the row mean is two and group mean five. Different weights answer different questions. Do not fill an empty evaluation group with zero loss; state the target and available denominator again.
기초Foundations
13. 같은 입력 패턴은 확인된 제품 ID가 아니다13. An identical input pattern is not a verified product ID
실제 레드 와인 원자료 1,599행에는 11개 이화학 입력과 품질 점수가 있습니다. 이번 그룹 설계는 정답인 품질 점수를 빼고 11개 입력 수치가 모두 같은 행을 묶습니다. 정확한 수치 동등성을 비교하여 1,359개 입력 패턴을 얻고 원행은 모두 보존합니다.
같은 패턴이 같은 실물 제품·측정 반복·입력 실수라는 사실은 식별자 없이 확정하지 못합니다. 이 장은 동일 입력이 여러 역할에 흩어지는 것을 막는 보수적 설계 선택으로만 해석합니다. 원행을 중복이라 단정해 삭제하지 않습니다.
분할을 설계하기 위해 전체 입력의 패턴 키를 확인했다는 사실도 공개합니다. 이는 훈련 규칙의 계수를 시험 정답으로 적합하는 일과 다릅니다. 다음 DATA12의 훈련 전용 전처리와 연결할 때 무엇을 설계 단계에 보고 무엇을 적합에 썼는지 구체적으로 구별합니다.
The actual red-wine file has 1,599 rows, eleven physicochemical inputs and a quality score. This design groups rows whose eleven numerical inputs all match, excluding the quality target. Exact numeric equality gives 1,359 input patterns while retaining every source row.
Without identifying information, identical patterns do not establish the same physical product, repeated measurement or input error. Interpret this as a conservative choice preventing identical inputs from crossing roles, rather than a justification for deleting presumed duplicates.
Disclose that complete input-pattern keys were inspected to design the partition. That differs from fitting coefficients using test outcomes. When connecting to training-only preprocessing in DATA12, specify what was inspected for design and what entered fitting.
기초Foundations
14. 그룹을 만들 때 정답을 섞지 않은 이유를 설명한다14. Explain why targets were excluded from pattern grouping
두 행의 11개 입력이 같아도 품질 점수가 다를 수 있습니다. 입력 패턴 중복을 막으려는 그룹 키에 품질을 추가하면 같은 입력·다른 정답 행이 다른 그룹으로 갈라져 원래 목적을 놓칠 수 있습니다. 이번 계약은 정답을 그룹 정의에 쓰지 않습니다.
정답 코드는 순서형 점수이며, 이후 숫자로 평균하거나 제곱손실을 선택하는 해석도 별도로 밝혀야 합니다. 같은 패턴의 서로 다른 정답을 하나로 바꾸거나 다수결로 덮어쓰지 않습니다. 측정·평가 차이를 보존한 채 배정 조건을 검사합니다.
Two rows can share all eleven inputs yet have different quality labels. Adding the target to a key intended to prevent input-pattern overlap can split those rows into different groups and defeat the original aim. This contract excludes quality from group definition.
Quality is ordinal, so numerical means or squared losses need their own interpretation. Do not replace differing targets within a pattern by one value or an unannounced majority vote. Retain measurement/evaluation differences while auditing assignments.
기초Foundations
15. 그룹이 없는 상태를 아는 상태로 바꾸지 않는다15. Do not turn unknown group identity into known identity
실제 손글씨 파일은 이미지별 작성자 ID를 제공하지 않습니다. 파일 이름과 원행으로 행은 추적할 수 있어도 새 내부 분할의 작성자 겹침은 검사할 수 없습니다. 서로 다른 작성자였다고 제공자가 설명한 원 훈련·시험 파일의 메타데이터와 이 한계를 함께 보고합니다.
설명용 그룹 실습에서 빈 문자열이나 null 그룹 키를 거부하는 이유도 여기에 있습니다. 모든 미확인 행을 같은 작성자라는 “unknown” 그룹으로 조용히 합치거나, 각각 다른 작성자라고 자동 가정하지 않습니다. 별도 설계를 선언하기 전에는 둘 다 자료가 알려 준 사실이 아닙니다.
그룹이 전혀 겹치지 않아도 시간 변화·모집 범위·공통 환경의 의존성이 사라진다는 뜻은 아닙니다. 키 검사 결과는 그 키와 그 분할에 관한 결과입니다.
The actual handwriting files lack per-image writer IDs. Filename and source row trace records but cannot audit writer overlap in a new internal split. Report that limit alongside the provider’s statement that the supplied training/test files came from different writer sets.
This also explains rejecting blank or null toy group keys. Do not silently merge every unidentified row into one “unknown writer” group, or automatically treat them all as different writers. Either choice needs a separately declared design rather than an invented data fact.
Even zero group overlap does not remove time shifts, recruitment differences or shared environmental dependence. A key audit describes those keys and that partition.
기초Foundations
16. 실습 B · 같은 그룹을 통째로 옮긴다16. Lab B · move complete groups together
같은 그룹 문자열이 반복되는 설명용 목록을 넣고 두 비율·offset을 바꿉니다. 전체 그룹 수와 각 역할의 그룹 수·행 수, 그룹별 원키 목록, 역할 사이 그룹 교집합을 확인하세요. 비율은 행 수가 아닌 그룹 수에 적용됩니다.
기본 예제는 그룹 4개라 검증 그룹 수의 바닥값이 0입니다. 빈 검증을 숨기지 말고 비율이나 그룹 목록을 바꾸어 비교하세요. 그룹 하나의 행 수를 늘려 그룹 수는 같아도 행 비율이 바뀌는 것도 확인합니다. 실제 원자료를 수정하는 기능이 아니라 선언한 설명용 배정을 계산하는 실습입니다.
Enter repeated toy group strings and change fractions or offset. Inspect total groups, role-specific group/row counts, source keys per group and cross-role group intersections. Fractions apply to group counts rather than row counts.
The default four-group example floors the validation-group count to zero. Keep that empty role visible and compare another fraction or group list. Increasing one group’s rows can alter row fractions while keeping group counts fixed. These controls calculate a declared toy assignment; they do not modify original source files.
기초Foundations
17. 시간순으로 정렬해도 미래 정보는 남을 수 있다17. Chronological rows can still contain future information
내년을 예측하려면 올해 말까지 알 수 있던 입력만 사용해야 합니다. 행의 날짜를 정렬한 뒤 앞부분을 훈련으로 두는 것은 출발점입니다. 그러나 그 행의 입력값이 나중에 확정된 연간 합계이거나 다음 달 행동까지 포함한다면 날짜 순서만으로 정보 유출이 사라지지 않습니다.
예를 들어 1월 1일에 1월 구매량을 예측하면서 입력에 “1월 마지막 날까지의 구매 횟수”를 넣으면 예측 시점에 없던 정보를 썼습니다. 관측 대상 기간, 입력이 가리키는 기간, 실제 공개 시각, 정답이 완성되는 시각을 구별합니다.
이번 시간 실습은 이미 순서가 정해진 위치를 역할로 나눕니다. 달력 파싱·공표 시각 확인·지연 변수 생성은 자동으로 하지 않습니다. 그 기능이 없다는 사실을 표 아래에서 계속 표시합니다.
Forecasting next year requires inputs available at the stated origin. Sorting dates and placing earlier rows in training is a starting point. A feature may nevertheless contain an annual total finalized later or behavior from a subsequent month.
Predicting January purchases on January first using the number of purchases through January’s last day uses unavailable information. Distinguish the target period, the period summarized by each input, publication time and the time when an outcome becomes complete.
The temporal lab assigns roles to positions already ordered by the user. It does not parse calendars, verify release times or construct lagged features. Keep those limits visible alongside its table.
기초Foundations
18. 한 출발점에서 여러 미래를 맞히는 절차를 적는다18. Specify the procedure at each forecast origin
설명용 시계열 값이 1, 2, 3, 4로 관측됐다고 합시다. 네 번째 시점 직후의 출발점에서 마지막 값 4를 다음 세 시점 모두의 예측으로 쓸 수 있습니다. 다음 실제 값 5를 본 뒤 나머지 두 예측을 5로 바꾸면, 처음에 정한 한 출발점 평가와 다른 절차입니다.
두 절차 모두 연구할 수 있지만 어떤 자료를 언제 받아 규칙을 갱신했는지 적어야 합니다. 한 출발점의 여러 기간 예측, 매 기간 새 관측을 받은 뒤의 한 기간 예측, 창을 이동하며 반복하는 평가는 서로 다른 손실을 만듭니다.
국가 실제 사례에서는 2022년 4분기까지의 기록으로 세 기준 규칙의 2023년 네 개 분기(1~4분기) 예측을 비교합니다. 검증으로 규칙 이름을 고른 뒤, 2023년 기록을 받아 같은 규칙의 입력을 갱신하고 2024년 네 개 분기(1~4분기)를 평가합니다.
Suppose values one through four have been observed. At the origin immediately after period four, a last-value rule predicts four for each of the next three periods. Replacing the remaining predictions by five after observing the next outcome defines a different procedure.
Both procedures can be studied, but state when new records arrive and when the rule updates. A multi-period forecast from one origin, repeated one-step forecasts and rolling-window evaluations produce different losses.
The actual country example compares three benchmarks for all four quarters of 2023 using records available through 2022-Q4 in the retained snapshot. After choosing the rule name on validation, it updates that rule’s inputs with 2023 records and scores all four quarters of 2024.
기초Foundations
19. 열두 위치에 시간 간격 두 개를 손으로 붙인다19. Assign two explicit gaps among twelve positions
설명용 시간 위치 1~12에서 훈련 끝을 6, 검증 끝을 9, 각 경계 뒤 제외 간격을 1행으로 정합시다. 훈련은 1~6, 첫 gap은 7, 검증은 8~9, 둘째 gap은 10, 시험은 11~12입니다. 개수는 6·2·2·2이며 네 역할 합이 12입니다.
gap 행은 원자료에서 사라지지 않습니다. 이번 적합·평가에 쓰지 않는다는 역할이 붙을 뿐입니다. 간격 0이면 훈련 1~6, 검증 7~9, 시험 10~12로 돌아갑니다. gap을 늘리면 검증·시험이 작아질 수 있습니다.
∣T∣=6,∣V∣=2∣E∣=2,∣H∣=2T∪V∪E∪H=I
여기서 H는 제외 간격 집합입니다. 간격이 크다는 이유만으로 독립성이 증명되지는 않습니다. 어떤 의존과 정보 중첩을 줄이려는지 별도로 설명합니다.
For toy positions one through twelve, set the training endpoint to six, validation endpoint to nine and a one-row gap after each endpoint. Training uses one through six; gaps are seven and ten; validation uses eight and nine; test uses eleven and twelve. Their counts are six, two, two and two.
Gap records remain in the source inventory, with an explicit unused role. With zero gap, validation is seven through nine and test is ten through twelve. Larger gaps can reduce validation and test sizes.
∣T∣=6,∣V∣=2∣E∣=2,∣H∣=2T∪V∪E∪H=I
H denotes excluded gap positions. A large gap does not itself prove independence. Explain which dependence or overlapping information it is intended to address.
기초Foundations
20. 겹치는 정답 기간에는 행 날짜보다 넓은 검사가 필요하다20. Overlapping outcome horizons require more than row dates
매일 한 행을 만들고 정답을 “앞으로 7일의 총구매량”으로 정의했다고 합시다. 오늘 행과 내일 행은 정답 기간 6일을 공유합니다. 날짜가 다른 행이라는 이유로 두 정답이 독립이라고 할 수 없습니다.
훈련 마지막 행의 정답이 시험 시작 뒤에야 완성된다면, 출발점 전에 그 훈련 정답을 알 수 있었는지도 확인해야 합니다. 일자 순서에 맞는 gap·purge 규칙을 연구 질문에 맞춰 선언할 수 있지만, 모든 문제에 통하는 고정 gap 길이는 없습니다.
일반 실습의 정수 gap은 이런 설계를 생각하는 도구입니다. 미래 7일 총량의 실제 구간을 입력받아 자동 검사하는 기능은 아닙니다. 원키와 정답 시작·끝 시각을 함께 보관해야 다음 감사가 가능합니다.
Suppose each daily row targets purchases over the following seven days. Adjacent rows share six days of outcome information. Different row dates do not imply independent targets.
If the final training target becomes complete only after a forecast origin, verify that it was actually available before fitting. A declared gap or purge rule may address the stated horizon; there is no universally sufficient gap length.
The integer-gap lab is a design aid, rather than an automatic audit of seven-day outcome intervals. Retain source keys together with outcome start and end times so that an interval-level audit is possible.
학부 연결 · 선택Undergraduate bridge · optional
21. 시간 분할 개수를 일반식으로 확인한다21. Verify temporal role counts algebraically
전체 위치 수 n≥0, 훈련 끝 t, 검증 끝 v, 간격 h를 비음수 정수라 둡니다. t+h≤v이고 v+h≤n이어야 아래 개수가 비음수입니다. 훈련은 t행, 검증은 v−t−h행, 시험은 n−v−h행, gap은 모두 2h행입니다.
nT=tnV=v−t−hnE=n−v−hnH=2hnT+nV+nE+nH=n
v=t+h이면 검증이 비고, n=v+h이면 시험이 빕니다. 경계가 유효하다는 것과 후보를 고르거나 성능을 평가할 자료가 충분하다는 것은 다릅니다. 실습은 불가능한 gap을 조용히 줄이지 않고 입력 오류로 돌려줍니다.
Let n≥0 be the number of ordered positions, t the training endpoint, v the validation endpoint and h a gap, all nonnegative integers. Require t+h≤v and v+h≤n. Training has t rows, validation v−t−h, test n−v−h and the two gaps together 2h.
nT=tnV=v−t−hnE=n−v−hnH=2hnT+nV+nE+nH=n
Validation is empty when v=t+h, and test is empty when n=v+h. Valid endpoints do not supply a nonempty selection or evaluation set. The lab rejects an impossible gap instead of silently shortening it.
기초Foundations
22. 관측 연도와 내려받은 빈티지를 함께 적는다22. Record observation dates and the downloaded vintage
2023년 값이라고 적힌 숫자를 2026년에 내려받았다면, 그 숫자가 2023년 당시에도 같은 값으로 공개됐다는 증거는 아닙니다. 통계가 개정되거나 공개가 늦을 수 있습니다. 시간순 평가에 사용한 파일의 내려받은 시점과 보관 해시를 함께 남깁니다.
이 장의 BIS 평가는 2026년에 보관한 분기 자료의 과거 기간 값을 이용한 재구성입니다. 2022년 말의 실제 데이터 빈티지, 당시의 최초 공표 시각, 당시 분석자가 내린 결정을 인증하지 않습니다. 검증·시험 역할을 명시해도 그 역사적 한계는 사라지지 않습니다.
실제 전향적 평가가 필요하면 각 출발점에 알 수 있던 데이터 사본과 코드·결정 기록을 보관해야 합니다. 기록이 없으면 “확인되지 않음”으로 보고하고 현재 재구성의 계산 결과와 구별합니다.
A value labeled 2023 but downloaded in 2026 does not establish what was published in 2023. Statistics may be revised or released later. Preserve download time and byte hashes alongside the observation periods.
The BIS exercise reconstructs historical periods from a snapshot retained in 2026. It does not certify a real 2022-end vintage, original release times or decisions actually made then. Labeling validation and test roles does not remove that historical limitation.
A prospective evaluation requires archived data available at each origin plus code and decision records. Without those records, report the historical claim as unverified and keep it separate from the present reconstruction.
기초Foundations
23. 과거와 미래의 차이를 분할이 고치지는 않는다23. A partition does not repair a change in the target population
과거에는 맑은 날만, 미래에는 비 오는 날도 포함한다면 앞부분의 낮은 손실이 미래에도 유지된다고 할 수 없습니다. 국가 경기·작성자 구성·제품 측정 관행이 달라지는 경우도 같은 문제를 만듭니다.
시간 분할은 순서를 보존하며 미래를 흉내 내는 한 설계입니다. 미래와 같은 분포를 만들어 주는 변환은 아닙니다. 어떤 지역·대상·기간을 평가했는지 적고, 다른 목표로 옮기려면 어떤 안정성·대표성 가정이 필요한지 설명합니다.
작은 시험 손실 하나로 “앞으로 항상 정확하다”고 결론내리지 않습니다. 그 손실은 선택한 규칙, 남겨 둔 관측, 선언한 손실에 대한 유한 결과입니다. 추론 구간이나 변화 탐지는 추가 모형·설계가 필요한 별도 과제입니다.
If earlier data contain only sunny days while future data also contain rainy days, low historical loss need not persist. Changes in economic conditions, writer composition or measurement practice create similar problems.
A temporal partition preserves order and can imitate a future-facing task. It does not transform the past into the future population. State the locations, units and periods actually evaluated and the stability or transport assumptions needed for another target.
One small test loss does not prove permanent accuracy. It is a finite result for the selected rule, retained observations and declared loss. Uncertainty intervals or change detection require additional designs and models.
기초Foundations
24. 실습 C · 시간 간격을 보존하며 경계를 옮긴다24. Lab C · move endpoints while retaining gap records
n, 훈련 끝, 검증 끝, gap을 바꾸어 시간 위치의 역할 띠와 원키 표를 봅니다. 각 경계 뒤 gap이 생기는지, 검증·시험이 비면 어떤 상태가 표시되는지 확인하세요. n=12, t=6, v=9, h=1의 손계산과 대조합니다.
이미 순서가 정해진 위치를 계산하는 JavaScript 실습입니다. 공개·정보 시각을 확인하거나 실제 달력의 독립성을 검사하는 도구가 아닙니다. 아래 보관 실행 기록에서는 같은 고정 예제를 실제 Python/R 새 프로세스로 실행한 출력·그림·코드를 별도로 확인할 수 있습니다.
Change n, the two endpoints and gap. Inspect the source-position timeline and table, including both gaps and any empty validation or test role. Compare n=12, t=6, v=9 and h=1 with the hand calculation.
This JavaScript lab assigns already ordered positions. It does not verify release times or calendar independence. Separately archived records show actual fresh Python/R executions, plots and code for fixed versions of the example.
기초Foundations
25. 검증 손실로 먼저 후보 번호를 정한다25. Choose the candidate index using validation loss first
세 후보의 검증 손실이 2, 1, 1이고 시험 손실이 5, 9, 0이라고 합시다. 작은 손실이 좋으며, 검증 최소가 여러 개면 원래 후보 번호가 작은 것을 고르기로 미리 정합니다. 내부 번호가 0, 1, 2이므로 검증 최소 후보는 1과 2, 선택은 1입니다.
선택된 후보의 시험 손실은 9입니다. 시험 손실 0인 후보 2로 바꾸면 시험 정답으로 선택을 바꾼 것입니다. 그 절차도 계산할 수 있지만 “검증으로 선택한 후보의 별도 시험 결과”와 같은 이름으로 보고할 수 없습니다.
규칙은 후보를 만든 훈련 자료와 검증 손실을 사용하고 시험 손실은 선택 뒤 공개합니다. 후보 이름·순서·동률 규칙도 평가 절차의 일부이므로 함께 보관합니다.
Let three validation losses be 2, 1, 1 and their test losses 5, 9, 0. Lower loss is better. Predeclare that ties go to the smallest original candidate index. With internal indices 0, 1, 2, validation minimizers are 1 and 2, and the selected index is 1.
Its test loss is nine. Switching to candidate two because its test loss is zero uses test outcomes for selection. That procedure is computable, but cannot be reported as the unchanged validation-selected procedure’s separate test result.
Training and validation determine the choice; reveal its test loss afterward. Archive candidate names, order and the tie rule as parts of the evaluation procedure.
기초Foundations
26. 동률과 결측 점수도 선택 규칙에 넣는다26. Include ties and missing scores in the choice rule
검증 손실을 유한한 비음수 수치 또는 미가용으로 입력합니다. 미가용 후보는 최소 비교에 참여하지 않습니다. 가용 후보가 하나도 없으면 선택은 미정의이며, 후보 0을 자동 선택하거나 손실을 0으로 채우지 않습니다.
검증으로 선택한 후보의 시험 손실이 미가용이라면 선택 번호는 알지만 그 시험 점수는 알 수 없습니다. 시험 값이 있는 다른 후보로 조용히 갈아타는 것은 선택 규칙의 변경입니다. 바꾸려면 무엇을 보고 바꿨는지 공개합니다.
이 실습은 정확한 십진·분수 손실을 비교합니다. 표시 반올림으로 1.000과 1.000이 같아 보여도 원값이 다를 수 있습니다. 동률은 원입력 수치로 판정하고 모든 실제 최소 번호를 보존합니다.
Input each validation loss as a finite nonnegative number or unavailable. Missing candidates are ineligible for the minimum. With no available candidate, selection is undefined; do not choose index zero or fill missing loss with zero.
A missing test loss for the validation-selected candidate leaves the selected index known but its test score unknown. Quietly switching to another candidate with a test score changes the procedure. Disclose what informed any change.
The lab compares exact decimal/fraction losses. Two displayed values rounded to 1.000 may differ before rounding. Determine ties from original inputs and retain every actual minimizing index.
학부 연결 · 선택Undergraduate bridge · optional
27. 좋은 시험 결과만 고르면 생기는 낙관을 손으로 본다27. See the optimism from selecting the best test score
설명용 두 후보의 시험 손실이 각각 확률 1/2로 0 또는 2이며, 두 손실이 독립이라고 가정합시다. 각 후보의 평균 손실은 1입니다. 두 시험 점수를 다 보고 최소를 고르면 최소가 2인 경우는 둘 다 2일 때뿐이라 확률 1/4이고, 나머지 경우 최소는 0입니다.
고른 시험 점수의 평균 1/2는 각 후보의 원래 평균 1보다 낮습니다. 이 예시는 선택 후 최소값의 낙관을 보여 주는 별도 가정 법칙입니다. 모든 실제 자료의 낙관 크기가 정확히 1/2라고 말하는 공식이 아닙니다.
Assume two toy test losses independently equal zero or two with probability one half each. Each candidate has expected loss one. After inspecting both and selecting the minimum, that minimum equals two only when both are two, an event of probability one quarter.
The selected test score averages one half, below either original expected loss of one. This explicit hypothetical law demonstrates selection optimism; it does not assign that exact optimism to every real evaluation.
대학원 연결Graduate bridge
28. 독립 시험 평균이 어떤 위험을 겨냥하는지 유도한다28. Derive what an independent test average estimates
선택·적합에 쓴 모든 자료와 결정의 정보를 A라 하고 그 정보로 정한 예측 함수를 f_A라 합시다. 시험 관측 Z₁, …, Z_m은 m≥1개이며 A 전체와 독립이고, 목표 법칙 P를 따르는 iid 관측이라고 추가 가정합니다. 손실 ℓ(f_A, Z)는 조건부 적분 가능하다고 둡니다.
새 목표 관측 Z에 대한 조건부 위험 R(f_A)를 적분으로 정의합니다. A를 고정하면 시험 관측마다 같은 적분을 가지므로 조건부 기대의 선형성이 아래 식을 줍니다. 시험 평균이 매번 위험과 같다는 등식은 아닙니다.
실제 그룹·시계열 자료가 이 조건을 만족하는지는 별도 판단입니다. 시험 정답을 본 뒤 f_A를 바꾸면 A와 독립이라는 전제가 그 변경된 선택에 적용되지 않습니다.
Let A contain every observation and decision used for fitting and selection, and let f_A be the resulting predictor. Additionally assume m≥1 test observations Z₁, …, Z_m are iid from target law P and independent of all of A. Require conditional integrability of the loss.
Define conditional risk by integration over a new target observation. Once A is fixed, each test term has that same integral, so conditional expectation is linear. This does not equate every realized test average with risk.
Whether real grouped or temporal records satisfy these assumptions is a separate question. Revising f_A after seeing test outcomes invalidates this independence argument for the revised selection.
기초Foundations
29. 선택 뒤 재적합하는 절차까지 미리 정한다29. Predeclare the refitting step after selection
후보의 설정을 검증으로 고른 뒤 훈련·검증을 합쳐 그 설정의 계수를 다시 맞추는 절차를 사용할 수 있습니다. 그러면 시험은 합친 자료로 재적합된 최종 함수를 평가합니다. 검증 때 점수 낸 함수와 최종 함수의 계수가 같다는 뜻은 아닙니다.
재적합 여부·사용할 자료·선택된 설정의 보존을 미리 설명합니다. 시험 결과가 나쁘다는 이유로 다시 설정을 고르거나 훈련 범위를 바꾸면 그 시험은 다음 선택에 쓰인 자료가 됩니다. 새 평가의 독립성을 되찾으려면 그에 맞는 새 설계가 필요합니다.
국가 사례의 갱신은 규칙 이름을 유지하며 직전 연도의 관측을 새 입력으로 넣는 간단한 예입니다. 검증으로 고른 마지막 값 규칙이 시험에서는 새 마지막 값으로 갱신됩니다. 과거에 실제 이 결정을 내렸다고 주장하지 않습니다.
After validation chooses a setting, a procedure may refit its coefficients using combined training and validation data. Test then evaluates that final refitted predictor. Its coefficients need not equal those of the predictor originally scored on validation.
Predeclare whether to refit, which records to use and which selected setting remains fixed. If a poor test result triggers another setting or training-range choice, test has entered the next selection. Independent evaluation then requires an appropriate new design.
The country example keeps the chosen benchmark name while updating its previous-year inputs. A selected last-value rule uses a new last value for the test year. This does not establish that the historical decision was actually made then.
기초Foundations
30. 후보 수뿐 아니라 평가를 본 횟수도 기록한다30. Record repeated inspection as well as candidate count
하이퍼파라미터 세 개만 비교했다고 적어도, 자료 정리·변수 선택·분할 offset·손실 정의를 시험 점수에 맞춰 여러 번 바꾸었다면 더 넓은 선택을 수행한 것입니다. 최종 표에 남은 후보 수만으로 그 과정을 알 수 없습니다.
후보 목록, 선택 점수, 동률 규칙, 정답을 열어 본 시점, 이후 변경을 로컬 기록에 남깁니다. 파일이 오늘 생성됐다는 사실은 과거에 이미 그 계획을 정했다는 증명이 아닙니다. 기록은 투명성을 돕지만 성능 보증이나 외부 사전등록을 자동으로 만들지 않습니다.
평가를 보고 고친 분석도 유용할 수 있습니다. 확인적 시험이라고 다시 이름 붙이기보다 탐색·수정의 경로와 현재 평가 범위를 정확히 적습니다.
A report may list only three hyperparameters while preprocessing, variables, split offsets or loss definitions were repeatedly changed after inspecting test scores. The final candidate count does not reveal that broader selection process.
Keep a local record of candidates, selection scores, tie rules, outcome-inspection times and later changes. A file created today does not prove the plan existed earlier. Records improve transparency but do not automatically provide performance guarantees or external preregistration.
Analysis revised after evaluation can still be useful. Describe its exploratory path and current evidence instead of renaming reused evaluation as a fresh confirmatory test.
기초Foundations
31. 선택 절차를 평가하려면 바깥 자료를 남긴다31. Retain outer data when evaluating a selection procedure
안쪽 훈련·검증으로 설정을 고르고 그 선택 절차를 바깥 평가 자료에서 점수 내는 중첩 설계를 생각할 수 있습니다. 바깥 정답을 안쪽 선택에 쓰지 않는다는 정보 경계가 핵심입니다. “중첩”이라는 이름만으로 그룹·시간 조건이 해결되지는 않습니다.
예를 들어 새 작성자를 목표로 한다면 바깥 분할도 실제 작성자 키를 존중해야 합니다. 키가 없는 손글씨 원행을 임의로 나눈 뒤 중첩했다고 해서 새 작성자 분리가 인증되지 않습니다. 시간 예측이라면 안쪽·바깥 모두 정보 시각과 정답 기간을 확인합니다.
이 장의 간단한 선택 실습은 이미 계산된 검증·시험 손실 목록을 비교합니다. 중첩 재적합 전체나 임의 학습 알고리즘을 자동 실행하지 않습니다. 다음 교차검증 절에서는 역할과 평균을 먼저 손으로 확인합니다.
A nested design can select settings using inner training/validation and evaluate that selection procedure on retained outer data. Keeping outer outcomes out of inner choices is the central information boundary. The name “nested” does not resolve grouping or timing conditions.
For a new-writer target, outer assignment must also respect actual writer identity. Arbitrarily splitting image rows with no writer keys does not certify new-writer separation merely because selection is nested. Temporal tasks require information and outcome-horizon checks at both levels.
The simple selection lab compares supplied validation/test loss lists. It does not run an arbitrary learner or an entire nested refitting pipeline. The following fold sections first establish role accounting and averaging.
기초Foundations
32. 실습 D · 동률을 보존하고 시험 재사용을 드러낸다32. Lab D · preserve ties and expose test reuse
같은 후보 순서로 검증 손실과 시험 손실을 입력합니다. null은 미가용입니다. 검증 최소의 모든 번호와 가장 작은 원번호 선택을 확인한 뒤 그 후보의 시험 점수를 봅니다. 번호는 내부 0부터의 인덱스와 화면의 1부터의 순번을 구별해 표시합니다.
별도 시험 최소 후보는 재사용 시연용 oracle입니다. 독립 평가 결과로 칭하지 않습니다. 기본 2, 1, 1 대 5, 9, 0에서 선택 시험 손실 9와 재사용 최소 0을 비교하고, 선택 후보의 시험 값을 null로 바꾸어 미정의 상태도 확인합니다.
Enter validation and test losses in the same candidate order, using null for unavailable values. Inspect all validation minimizers and the smallest-index choice, then its test score. Distinguish zero-based internal indices from one-based displayed positions.
A separate test minimum is an explicitly labeled reuse oracle, rather than independent evaluation. Compare selected test loss nine with reused minimum zero for 2, 1, 1 versus 5, 9, 0. Make the selected test entry null to inspect an undefined score.
기초Foundations
33. 여섯 행을 세 번 번갈아 가린다33. Hold out six rows in three turns
원키 1~6을 세 묶음 {1, 2}, {3, 4}, {5, 6}으로 둡니다. 첫 차례에는 1·2를 가리고 나머지 네 행으로 규칙을 맞춥니다. 둘째는 3·4를 가리고 다시 맞추며, 셋째는 5·6을 가리고 다시 맞춥니다. 각 행은 한 번 검증으로 쓰이고 두 번 훈련에 들어갑니다.
설명용 3-fold의 실제 원키 역할
차례
이번 검증
이번 훈련
1
1, 2
3, 4, 5, 6
2
3, 4
1, 2, 5, 6
3
5, 6
1, 2, 3, 4
한 번 맞춘 규칙을 같은 채로 세 번 점수 내는 것이 아닙니다. 각 차례 훈련 자료가 달라 세 개의 적합된 규칙이 생길 수 있습니다. fold는 번갈아 가리는 묶음이라는 뜻으로 연결해 기억합니다.
Split source keys one through six into {1, 2}, {3, 4} and {5, 6}. First hold out one and two and fit on the other four. Next hold out three and four and refit. Finally hold out five and six and refit. Each record is validation once and training twice.
Source-key roles in a toy three-fold procedure
Turn
Validation this turn
Training this turn
1
1, 2
3, 4, 5, 6
2
3, 4
1, 2, 5, 6
3
5, 6
1, 2, 3, 4
This is not one fitted rule scored unchanged three times. Different training sets can produce three fitted predictors. A fold is one of the groups held out in turn.
학부 연결 · 선택Undergraduate bridge · optional
34. 한 번씩 가린다는 성질을 일반화한다34. Generalize the held-out-once accounting
K≥2개 fold의 검증 키 집합을 V₁, …, V_K라 합시다. 이들이 서로 겹치지 않고 원키 집합 I 전체를 덮으면 한 행은 정확히 한 V_k에 속합니다. 해당 차례의 훈련을 I에서 V_k를 뺀 집합으로 두면 그 행은 다른 K−1차례 훈련에 속합니다.
k=1∑K∣Vk∣=nk=1∑K∣I∖Vk∣=(K−1)n
n=6, K=3에서는 검증 사용 수 합이 6, 훈련 사용 수 합이 12입니다. 이 등식은 역할 사용 횟수의 계산입니다. 같은 행이 여러 훈련에 들어가므로 fold별 점수가 서로 독립이라는 결론은 나오지 않습니다.
Let K≥2 validation-key sets V₁, …, V_K be disjoint and cover the full source-key set I. Each row then belongs to exactly one validation set. Training on I minus V_k places that row in the other K−1 training sets.
k=1∑K∣Vk∣=nk=1∑K∣I∖Vk∣=(K−1)n
For n=6 and K=3, validation uses sum to six and training uses to twelve. These identities count roles. Shared training records do not make fold scores independent.
기초Foundations
35. 그룹 단위로 번갈아 보내면 행 수는 다를 수 있다35. Round-robin groups can yield unequal fold sizes
A그룹 4행과 B, C, D, E그룹 각 1행을 생각합시다. 그룹을 A, B, C, D, E 순서로 세 fold에 번갈아 보내면 첫째는 A, D의 5행, 둘째는 B, E의 2행, 셋째는 C의 1행입니다. 그룹 수는 2·2·1이지만 행 수는 5·2·1입니다.
같은 그룹은 통째로 한 검증 fold에 들어갑니다. 그 fold를 가리는 차례에만 그 그룹 전체가 훈련에서 빠지므로 같은 그룹이 해당 차례의 훈련과 검증 양쪽에 나타나지 않습니다. 실제 제품·사람의 관계는 공급한 그룹 키가 무엇을 뜻하는지에 달려 있습니다.
실습은 그룹의 첫 원위치를 선언한 정수 순서로 정렬하고 round-robin으로 배정합니다. 그룹 이름을 알파벳순으로 바꾸어 정렬하는 별도 규칙과는 다를 수 있습니다.
Consider four rows in group A and one row each in B, C, D, E. Sending groups A, B, C, D, E round-robin to three folds gives A, D to the first fold, B, E to the second and C to the third. Group counts are 2, 2, 1, while row counts are 5, 2, 1.
A whole group enters one validation fold. When that fold is held out, every row of the group is excluded from training. What this means for real products or people depends on the supplied group key.
The lab orders first-source-position anchors using its declared modular order, then assigns round-robin. That can differ from sorting group names alphabetically.
기초Foundations
36. 두 점수의 평균과 여섯 행의 평균은 다르다36. Averaging two fold scores differs from averaging six rows
첫 fold의 검증 2행 손실이 모두 1, 둘째 fold의 검증 4행 손실이 모두 3이라고 합시다. fold 평균 1과 3을 똑같이 평균하면 2입니다. 전체 여섯 행의 손실을 평균하면 (2×1+4×3)/6=7/3입니다. 행이 많은 fold가 전체 행 평균에서 더 큰 무게를 갖습니다.
Lfold=(1+3)/2=2Lrow=(2+12)/6=7/3
어느 평균이 맞는지는 무엇에 같은 무게를 줄지에 달려 있습니다. 모든 관측 행의 평균을 보고하려면 검증 행 수를 가중치로 씁니다. 각 fold를 같은 중요도의 환경으로 보는 다른 질문이라면 그 이유를 설명하고 별도 평균을 보고합니다.
Suppose the first fold has two validation rows, each with loss one, while the second has four, each with loss three. Equally averaging the fold means gives two. Averaging all six row losses gives (2×1+4×3)/6=7/3. The larger fold carries more weight in the row average.
Lfold=(1+3)/2=2Lrow=(2+12)/6=7/3
The appropriate average depends on what receives equal weight. To summarize all observed rows, weight fold means by validation-row counts. Treating folds as equally important environments is another question that needs its own explanation.
학부 연결 · 선택Undergraduate bridge · optional
37. 가린 행 예측을 모은 평균의 항등식을 증명한다37. Prove the pooled held-out-row averaging identity
검증 fold V_k의 행 수 n_k≥1, 그 fold를 빼고 적합한 함수 f_{−k}, 각 검증 행의 손실 ℓ_i를 둡니다. 전체 n=Σn_k>0이며 각 행은 한 fold에만 있습니다. fold 평균 L_k를 n_k/n로 가중하면 각 행의 손실이 정확히 1/n의 계수를 갖습니다.
이 식의 ℓ_i는 해당 행을 가린 차례의 f_{−k}로 계산합니다. 모든 행으로 한 번 더 적합한 최종 함수의 같은 행 내 손실과는 다릅니다. 비어 있는 fold는 평균이 미정의이므로 0점으로 채우지 말고 따로 표시합니다.
Let validation fold V_k have n_k≥1 rows and predictor f_{−k} fitted without that fold. Denote each held-out loss by ℓ_i. With n=Σn_k>0 and each row in exactly one fold, weighting L_k by n_k/n gives every row loss coefficient 1/n.
Each ℓ_i uses the predictor from the turn when that row was held out. This differs from in-sample loss of a final predictor refitted on every row. Empty folds have undefined means and must not be filled with zero.
기초Foundations
38. 교차검증 점수의 흔들림을 독립 표본처럼 읽지 않는다38. Do not read fold variability as independent observations
첫 차례의 훈련 {3, 4, 5, 6}과 둘째 차례의 훈련 {1, 2, 5, 6}은 5·6을 공유합니다. 두 적합된 규칙과 두 점수는 같은 자료에 함께 반응할 수 있습니다. 점수 세 개의 표준편차를 √3으로 나누는 계산만으로 유효한 표준오차가 되는 것은 아닙니다.
K를 크게 하면 한 차례의 훈련 자료는 늘고 검증 자료는 줄 수 있습니다. 평가되는 적합 표본 크기와 점수의 변동이 함께 바뀝니다. 큰 K가 모든 목표에서 항상 우월하다는 단순 순서는 없습니다.
교차검증은 적절한 분할 아래 후보 선택과 오차 비교에 유용한 절차입니다. 불확실성 주장은 그 절차·의존 구조·표집 방식에 맞추어 추가로 정당화합니다. 실습은 실제 역할과 행 수를 먼저 보여 줍니다.
Training sets {3, 4, 5, 6} and {1, 2, 5, 6} share rows five and six. Their fitted rules and scores can respond jointly to the same observations. Dividing the standard deviation of three scores by √3 alone does not establish a valid standard error.
Larger K can increase training size per turn while decreasing validation size. Both the fitted procedure being evaluated and score variability change. There is no universal ranking in which larger K is always better.
With an appropriate partition, cross-validation is useful for candidate selection and error comparison. Uncertainty claims need justification matching the procedure, dependence and sampling design. The lab first exposes actual roles and counts.
기초Foundations
39. 교차검증으로 고른 점수와 새 시험 점수를 분리한다39. Separate a selected CV score from a new test score
두 설정의 교차검증 평균이 2와 1이면 둘째를 고를 수 있습니다. 그 최솟값 1은 선택에도 쓰였습니다. 동일한 자료를 반복해 나누어 다시 평균해도, 원래 정답을 처음 보는 새 시험으로 바뀌지는 않습니다.
선택한 설정으로 최종 적합을 한 뒤 따로 남긴 시험을 평가하거나, 바깥 fold가 안쪽 선택 절차 전체를 평가하는 중첩 설계를 고려합니다. 어느 경우든 외부 평가 정답을 다시 선택에 쓰는 순간 그 경계를 바꿨다는 사실을 기록합니다.
실제 손글씨 제공 시험 파일을 수십 번 보며 설정을 고른다면 파일 이름에 test가 남아 있어도 새 선택 자료가 됩니다. 어떤 자료에 접근했는지와 어떤 계산에 넣었는지를 과정으로 설명하는 것이 중요합니다.
If two settings have mean CV losses two and one, the second can be selected. The minimum of one has also informed selection. Repeatedly repartitioning and averaging the same outcomes does not turn them into a new unseen test.
Consider evaluation on a retained test after final refitting, or an outer fold evaluating the whole inner selection procedure. In either design, using outer outcomes for another choice changes the information boundary and should be recorded.
A source file named test becomes selection data if its outcomes are repeatedly inspected to choose settings. Describe actual access and use, rather than relying on a filename.
기초Foundations
40. 실습 E · 그룹 fold와 행 가중치를 확인한다40. Lab E · inspect grouped folds and row weights
그룹 목록·fold 수 K·지금 가릴 fold·offset을 바꿉니다. 각 그룹의 검증 fold, 원행별 역할, 차례별 훈련·검증 수와 가중치 n_k/n를 확인하세요. 빈 fold는 점수 0인 fold가 아닙니다.
A그룹 4행과 B, C, D, E 각 1행을 입력하여 K=3에서 5·2·1의 검증 행 수를 재현해 보세요. K를 그룹 수보다 크게 하면 일부 fold가 비는 것도 봅니다. 라이브 계산은 배정·개수만 수행하며 임의 예측 모델의 교차검증을 실행하지 않습니다.
Change group labels, K, the currently held-out fold and offset. Inspect each group’s validation fold, every source row’s role, per-turn training/validation counts and weights n_k/n. An empty fold does not have loss zero.
Enter four A rows and one each of B, C, D, E to reproduce validation counts 5, 2, 1 at K=3. With more folds than groups, observe empty folds. Live calculations assign roles and counts; they do not run cross-validation for an arbitrary prediction model.
기초Foundations
41. 같은 작은 개수를 Python과 R에서 실제로 계산한다41. Actually calculate the same small counts in Python and R
아래 코드는 원키 순서로 12행을 나누는 개수 계산입니다. Python의 //는 정수 나눗셈의 바닥값을 만듭니다. R에서는 floor로 같은 양의 비율 개수를 구합니다. 둘 다 훈련 7·검증 2·시험 3을 얻습니다. 어떤 키를 고를지의 순서 문제는 이 개수 계산과 별도입니다.
n = 12
n_train = 3 * n // 5
n_validation = n // 5
n_test = n - n_train - n_validation
print(n_train, n_validation, n_test)
# 7 2 3
n <- 12
n_train <- floor(3 * n / 5)
n_validation <- floor(n / 5)
n_test <- n - n_train - n_validation
print(c(n_train, n_validation, n_test))
# [1] 7 2 3
보관 다운로드는 더 넓은 고정 예제를 실제 새 프로세스에서 실행한 완전한 프로그램입니다. 아래 실행창은 그 기록과 코드를 보여 줍니다. 입력 조절기의 즉시 변화는 JavaScript 계산이며 Python/R 실행 결과로 꾸미지 않습니다.
The code calculates counts for twelve rows in source order. Python // floors integer division; R floor gives the corresponding positive-fraction counts. Both produce seven training, two validation and three test rows. Choosing their source keys is a separate ordering question.
n = 12
n_train = 3 * n // 5
n_validation = n // 5
n_test = n - n_train - n_validation
print(n_train, n_validation, n_test)
# 7 2 3
n <- 12
n_train <- floor(3 * n / 5)
n_validation <- floor(n / 5)
n_test <- n - n_train - n_validation
print(c(n_train, n_validation, n_test))
# [1] 7 2 3
Downloads contain complete standalone programs actually executed in new processes for broader fixed examples. Their record panels display archived code and output. Immediate control changes use JavaScript and are not presented as fresh Python/R executions.
기초Foundations
42. 네 개 검증 분기가 고른 규칙을 다음 해에 갱신한다42. Update the rule selected on four validation quarters
실제 BIS 180분기에서 1980~2022년의 172분기는 훈련, 2023년 네 개 분기(1~4분기)는 검증, 2024년 네 개 분기(1~4분기)는 시험 역할입니다. 예측 후보는 직전 연도 마지막 분기 값, 직전 연도 네 값의 평균, 직전 연도 같은 분기 값입니다.
검증 MSE는 각각 약 73.420794, 134.659140, 130.872788이므로 마지막 분기 값을 계속 쓰는 규칙이 선택됩니다. 이 이름을 유지한 채 2023년 말 값으로 입력을 갱신하면 2024년 시험 MSE는 약 2.613757입니다. 세 규칙의 시험 계산도 감사용 표에 보존하지만 선택 기준은 검증입니다.
이 결과는 네 기간의 지수점 제곱 평균입니다. 4라는 작은 평가 개수와 2026년 보관 빈티지를 함께 읽습니다. 실제 과거 시점의 자료 사본이나 당시 선택 기록은 추가로 확보해야 합니다.
Of 180 actual BIS quarters, 172 from 1980–2022 are training, all four quarters of 2023 are validation and all four quarters of 2024 are test. Candidates use the previous year’s last quarter, its four-quarter mean, or its matching quarter.
Their validation MSEs are approximately 73.420794, 134.659140 and 130.872788, selecting the last-quarter rule. Keeping that rule name and updating its input to the end of 2023 yields a 2024 test MSE of approximately 2.613757. Test arithmetic for all candidates remains available for audit, while validation determines selection.
These losses average four squared index-point errors. Read the small evaluation count alongside the retained 2026 vintage. Historical data snapshots and actual past decision records require additional evidence.
기초Foundations
43. 실제 숫자 블록과 훈련 전용 동률을 읽는다43. Read actual digit blocks and a training-only tie
손글씨 한 행은 8×8의 64개 블록 값과 숫자 정답입니다. 블록 값은 0~16이며 그림은 이 실제 수치의 진하기를 표현합니다. 원 훈련 파일 3,823행과 시험 파일 1,797행을 합치더라도 파일·원행 키를 유지합니다.
아무 이미지도 보지 않고 훈련에서 가장 많은 숫자 하나를 늘 예측하는 단순 기준선을 만듭니다. 숫자 1과 3이 각각 389개로 동률입니다. 작은 라벨을 고르는 규칙으로 1을 택하면 시험에서 182/1797≈0.101280을 맞힙니다. 시험에서 가장 많은 숫자를 찾아 동률을 푸는 절차가 아닙니다.
실습의 실제 원행 여섯 개는 0·1·8 모양을 보며 열 순서를 확인하는 예입니다. 제공자는 원 훈련/시험에 30명과 서로 다른 13명의 작성자가 참여했다고 설명합니다. 파일의 개별 행에는 작성자 키가 없어 새 내부 행 분할의 작성자 겹침까지 계산하지는 못합니다.
One image row contains 64 block counts on an 8×8 grid and a digit label. Counts range from zero to sixteen, and the image shades represent these actual values. Preserve filename/source-row keys for the 3,823 training and 1,797 test images.
A simple benchmark ignores image inputs and always predicts the most frequent training label. Labels one and three tie at 389 each. Choosing the smaller label yields 182/1797≈0.101280 correct test predictions. The test label frequencies do not resolve that training tie.
The six original rows in the lab illustrate zero, one and eight while exposing pixel order. The provider describes thirty training writers and thirteen different test writers. Per-row writer IDs are absent, so a new internal row split cannot audit writer overlap.
기초Foundations
44. 같은 1599행에서 두 배정 규칙을 대조한다44. Compare two assignments of the same 1,599 rows
실제 와인 1,599행을 결정적 순서로 행 단위 배정하면 훈련·검증·시험은 959·319·321행입니다. 11개 입력이 같은 패턴의 역할 간 겹침은 훈련/검증 63, 훈련/시험 54, 검증/시험 19개입니다. 이들은 겹치는 패턴 수이지 삭제할 행 수가 아닙니다.
1,359개 입력 패턴을 통째로 배정하면 역할별 패턴 수 815·271·273, 행 수 952·321·326이 됩니다. 같은 패턴의 역할 간 겹침은 모두 0입니다. 행은 여전히 1,599개이고 다른 품질 정답도 그대로 남습니다.
같은 실제 와인 원행을 보존한 두 설계
배정 단위
훈련 행
검증 행
시험 행
원행
959
319
321
입력 패턴 그룹
952
321
326
겹침 감소는 선언한 입력 패턴에 대한 사실입니다. 실제 제품의 독립성·새 생산자 성능이나 두 설계 중 더 좋은 시험 성능을 이 개수만으로 판정하지 않습니다.
Assigning the same 1,599 wine rows individually under the declared deterministic order gives 959 training, 319 validation and 321 test rows. Identical-input pattern overlaps are 63 for training/validation, 54 for training/test and 19 for validation/test. These are pattern counts, rather than rows to delete.
Assigning all 1,359 complete input-pattern groups gives pattern counts 815, 271, 273 and row counts 952, 321, 326. Every cross-role pattern overlap is zero. All 1,599 rows and their differing quality labels remain.
Two designs retaining the same original wine rows
Assignment unit
Training rows
Validation rows
Test rows
Source row
959
319
321
Input-pattern group
952
321
326
The overlap reduction describes those input patterns. These counts alone do not establish product independence, new-producer performance or which design produces better test loss.
기초Foundations
45. 선택 과정을 한 장의 기록으로 남긴다45. Keep a concrete record of the selection process
설명용 기록을 만들어 봅시다. 질문은 “처음 보는 그룹의 수치를 예측”, 손실은 평균 제곱오차, 그룹 키는 공개된 단위 코드, 후보는 A와 B, 검증 최소 동률은 A 우선이라고 적습니다. 자료 파일 해시와 각 역할의 원키도 함께 붙입니다.
다음 줄에는 언제 정답을 봤는지와 선택 뒤 무엇을 다시 맞췄는지를 적습니다. 예컨대 검증 MSE A=2, B=1을 보고 B를 고른 뒤 훈련·검증으로 B를 재적합하고, 그 다음 시험을 한 번 평가했다고 씁니다. 이미 시험을 보고 설계를 고쳤다면 그 변경도 적습니다.
이 기록은 현재 작업을 설명하는 로컬 문서입니다. 외부 기관에 등록됐거나 과거에 미리 작성됐다는 사실을 만들지 않습니다. 독자가 “어떤 정보로 무엇을 골랐는가”를 따라갈 수 있게 쓰는 것이 목적입니다.
Create a toy record: the question is prediction for a new group, loss is MSE, the group key is a supplied unit code, candidates are A and B, and validation ties favor A. Attach source hashes and original keys for every role.
Then record when outcomes were inspected and what was refitted after selection. For example, validation MSEs A=2 and B=1 selected B, which was refitted on training plus validation before one test evaluation. Include any later redesign informed by test results.
This local document describes the present workflow. It does not create external registration or establish a past planning date. Its purpose is to let a reader trace which information informed each choice.
기초Foundations
46. 실습 F · 원행 분할과 실제 실행 기록을 함께 본다46. Lab F · inspect original-row partitions and actual execution records
국가는 172/4/4와 검증 선택·갱신 후 시험 손실, 손글씨는 훈련 빈도·동률·실제 블록 여섯 개, 와인은 행/패턴 배정과 교집합을 봅니다. 라이브 원행 계산과 고정 Python/R 보관 기록을 구별하여 비교하세요.
고정 프로그램 30개를 새 프로세스로 실행했고, 이 중 빈 그룹 키를 거부하는 예상 오류가 언어별 하나씩 있습니다. 28개 SVG는 해당 실제 실행에서 만든 파일입니다. 실행 파일·입력 해시·종료 코드·표준 출력·오류·Python/R 버전·R 출력 자릿수·locale·시간대를 함께 보관합니다.
다운로드 코드는 묶음의 루트에서 실행합니다. Python 예제는 실제 Orange 설치의 Python 3.11.8과 Matplotlib 3.10.0, R은 4.5.1을 사용했습니다. 설치한 패키지가 다른 새 환경에서는 버전과 글꼴·출력 옵션을 확인합니다. 브라우저는 임의 Python/R 편집 실행기를 제공하지 않습니다.
Inspect country 172/4/4 roles and validation-selected, updated test losses; training-only digit frequencies, ties and six original block images; and wine row/pattern assignments with overlaps. Compare live source-row calculations with separately archived fixed Python/R records.
Thirty standalone programs were executed in fresh processes, including one intended missing-group-key rejection per language. Twenty-eight SVGs were produced by those executions. Code/input hashes, return codes, standard output/errors, runtime versions, R print precision, locale and time zone are archived together.
Run downloaded code from the bundle root. Python examples used the actual Orange installation’s Python 3.11.8 with Matplotlib 3.10.0; R used version 4.5.1. Check versions, fonts and print options in another environment. The browser does not provide arbitrary Python/R editing and execution.
기초Foundations
47. 실제 자료로 질문·배정·점수의 단위를 연결한다47. Connect actual questions, assignments and scoring units
국가 시계열 · 과거로 선택하고 다음 기간으로 확인한다
실제 BIS 한국 실질 주택가격지수의 1980-Q1~2024-Q4, 180개 분기를 시간 순서로 나눕니다. 학습은 1980~2022년 172분기, 검증은 2023년의 네 개 분기, 시험은 2024년의 네 개 분기입니다. 예측 대상은 뒤 시점의 지수이며, 인접 기록을 임의로 섞어 미래 값을 과거 학습에 넣지 않습니다. 단위는 2010년 평균=100인 지수 포인트이고 원화 거래가격이 아닙니다.
명시한 시간 역할 · 실제 분기 행을 모두 보존
역할
기간
분기 수
학습
1980-Q1~2022-Q4
172
검증
2023-Q1~2023-Q4
4
시험
2024-Q1~2024-Q4
4
세 단순 기준은 마지막 값 반복, 마지막 1년 평균 반복, 전년 같은 분기입니다. 검증에서는 2022-Q4를 출발점으로 2023년 네 목표를 한꺼번에 계산합니다. 검증 MSE가 가장 작은 규칙을 고른 뒤 규칙 이름은 고정하고, 입력만 2023-Q4까지 갱신해 2024년 네 목표를 계산합니다. 복잡한 모형이 172개를 모두 쓰는 경우와 달리 이 기준들의 입력 창은 각 규칙에 따라 마지막 값/마지막 1년입니다.
규칙 선택에는 검증 자료만 · MSE 소수 반올림
후보
2023년 검증 MSE 포인트²
마지막 분기 값
73.420794
직전 1년 평균
134.659140
전년 같은 분기
130.872788
검증이 고른 규칙은 “마지막 분기 값”이고 갱신 후 2024년 시험 MSE는 2.613757 포인트²입니다. 이 결과를 본 뒤 규칙을 바꾸면 2024년은 더 이상 그 변경 규칙의 깨끗한 시험자료가 아닙니다. 다운로드에는 후보별 산술을 감사할 수 있게 모두 남기되 시험 결과를 선택에 되먹이지 않습니다.
먼저 생각한 뒤 풀이 보기: 이 분할이 2023년에 실제 수행한 사전 실험인가요?
아닙니다. 지금 작성한 학습용 계획이며 이미 존재하는 결과를 사용합니다. 입력도 2026년 내려받은 개정 사본이라 2022년·2023년 당시 공개 빈티지를 인증하지 않습니다. 시간 역할을 올바르게 계산한 것과 전향적 실시간 실험을 수행한 것은 다릅니다. 네 시험 오차의 순위가 모든 미래 시기의 우승을 보장하지도 않습니다.
사람이 쓴 숫자 · 이미지 행과 작성자는 같은 관측 단위가 아니다
UCI Optical Recognition of Handwritten Digits의 원 optdigits.tra 3,823행과 optdigits.tes 1,797행을 사용합니다. 제공자 설명은 훈련 자료를 만든 30명과 다른 13명이 시험 자료를 만들었다고 명시합니다. 이미지 한 행은 한 사람이 아닙니다. 각 행은 64개 입력 수와 0~9 정답 코드 하나이며, 원 정규화 32×32 비트맵의 4×4블록 켜진 픽셀 수를 세어 8×8로 줄인 것입니다. 값은 0~16이고 결측은 없습니다.
아래 그림은 실제 원행의 64개 블록 수를 회색조로 표시한 것입니다. 원래 펜 선의 고해상도 사진이나 새로 생성한 손글씨가 아닙니다. 검은 셀은 켜진 픽셀이 많은 블록입니다. 출처 파일 이름과 그 파일 안의 원행 번호를 같이 남기므로 train 원행1과 test 원행1을 같은 키로 합치지 않습니다.
실제 train 원행 1 · 숫자 0실제 train 원행 12 · 숫자 1실제 train 원행 10 · 숫자 8실제 test 원행 1 · 숫자 0실제 test 원행 2 · 숫자 1실제 test 원행 9 · 숫자 8
실제 정답 분포 · 숫자는 순서가 있는 크기 아닌 분류 코드
정답 코드
원 훈련 행
원 시험 행
0
376
178
1
389
182
2
380
177
3
389
183
4
387
181
5
376
182
6
377
181
7
387
179
8
380
174
9
382
180
먼저 생각한 뒤 풀이 보기: 파일 안에서 행을 다시 섞으면 작성자가 분리된 검증자료가 자동 생기나요?
행별 작성자 ID가 없으므로 내부 행 분할이 작성자까지 분리했는지는 검사할 수 없습니다. 원 제공 분할의 30명/다른13명이라는 메타데이터와, 파일에서 직접 확인한 행 수·픽셀·정답을 구별합니다. 작성자 ID를 추정해 만들어 넣지 않습니다. 새 작성자 성능이 목표라면 작성자별 묶음이 필요하며 같은 작성자의 새 이미지 성능과 다른 목표입니다.
먼저 생각한 뒤 풀이 보기: 훈련의 최빈 정답이 동률이면 시험 정답으로 골라도 될까요?
훈련에서 1과3이 각각389행으로 동률입니다. “동률이면 작은 코드”라는 명시 규칙은1을 선택하며 원 시험 정답182/1797≈10.1280%를 맞춥니다. 시험에서3이183번 나온다는 사실을 보고3으로 바꾸면 시험을 선택 자료로 재사용한 것입니다. 이 기준은 학습된 영상 인식기가 아니라 정답 비중만 쓰는 낮은 상수 기준입니다.
제품 실무 사례 · 같은 입력 패턴이 양쪽에 있으면 무엇을 평가한 걸까?
포르투갈 Vinho Verde 레드와인 실제 1,599개 실험실·관능평가 기록에는 11개 이화학 입력과 품질점수가 있습니다. 업체·병·배치의 실제 고유 ID는 확인되지 않습니다. 기업 한 곳의 제품이나 독립 생산품 1,599개라고 쓰지 않습니다. 이번에는 품질 정답을 제외한 11개 입력의 정확한 수치 조합으로 1,359개 패턴 그룹을 만듭니다. 같은 입력이 같은 병이나 입력 오류라는 증거는 아니므로 원행을 삭제하지 않습니다.
두 선택을 비교합니다. 행 분할은 원행을 정해 둔 순열로 정렬해 약60%/20%/나머지를 학습·검증·시험에 둡니다. 패턴 그룹 분할은 패턴을 대표하는 첫 원행으로 같은 규칙을 적용하고 같은 패턴의 모든 원행을 한쪽에 둡니다. 순열 규칙은 (원행×104729 mod1000003, 원행)의 오름차순입니다. 전향적 무작위 표집이라고 주장하지 않는 결정적 예시이며, 개별 행수와 그룹수 비율은 서로 다를 수 있습니다.
두 분할 모두 원행 보존 · 품질 평균은 기술 요약·반올림
분할
역할
원행 수
입력 패턴 수
품질 평균
행 분할
학습
959
876
5.624609
행 분할
검증
319
308
5.695925
행 분할
시험
321
308
5.610592
입력 패턴 그룹 분할
학습
952
815
5.634454
입력 패턴 그룹 분할
검증
321
271
5.657321
입력 패턴 그룹 분할
시험
326
273
5.619632
서로 다른 역할 사이에 공유된 실제 입력 패턴 수
분할
역할 쌍
공유 패턴
행 분할
학습 / 검증
63
행 분할
학습 / 시험
54
행 분할
검증 / 시험
19
입력 패턴 그룹 분할
학습 / 검증
0
입력 패턴 그룹 분할
학습 / 시험
0
입력 패턴 그룹 분할
검증 / 시험
0
먼저 생각한 뒤 풀이 보기: 행 분할의 63·54·19 공유 패턴이 곧 부정확한 원자료라는 뜻인가요?
아닙니다. 실제 입력이 반복됐다는 계산이며 같은 제품의 중복 입력을 확정하지 않습니다. 익숙한 패턴의 새 관측을 예측할지, 완전히 새로운 입력 패턴을 평가할지에 따라 분할 목표가 다릅니다. 여기서는 패턴 공유를 피하는 보수적 선택을 비교한 것입니다. 새로운 생산업체에 일반화하는 성능은 업체 ID 없이 이 분할로 인증할 수 없습니다.
먼저 생각한 뒤 풀이 보기: 왜 품질 정답은 그룹 정의에서 빼나요?
그룹을 입력 패턴으로 정의한 목적에 맞추기 위해서입니다. 정답까지 같을 때만 묶으면 동일 입력·다른 정답인 기록은 서로 다른 그룹으로 갈 수 있습니다. 이 실제 자료에서도 원래 행과 정답을 모두 남기고 그룹은 11개 입력만으로 계산합니다. 그룹 분할은 모형 학습이나 좋은 예측 점수를 자동으로 보장하지 않으며 품질 점수는 순서형 평가라는 한계도 유지합니다.
Country time series · Select on earlier periods, then inspect a later one
Split the 180 actual BIS Korean real-property-price index quarters, 1980-Q1–2024-Q4, chronologically: 172 training periods through 2022, four 2023 validation periods and four 2024 test periods. The target is a later index value; do not shuffle later observations into past training. Units are index points, 2010 average=100, not KRW transaction prices.
Explicit time roles · all actual period records retained
Role
Periods
Quarters
Training
1980-Q1–2022-Q4
172
Validation
2023-Q1–2023-Q4
4
Test
2024-Q1–2024-Q4
4
The candidates repeat the last value, the last-year mean or the matching prior-year quarter. For validation, forecast all four 2023 targets from 2022-Q4. Select the smallest validation MSE, freeze the rule, then update its inputs through 2023-Q4 for the four 2024 targets. Although 172 periods define the training partition, these simple rules use their stated last-value/last-year windows.
Only validation chooses the rule · MSE rounded
Candidate
2023 validation MSE points²
Last-quarter value
73.420794
Last-year mean
134.659140
Matching prior-year quarter
130.872788
Validation selects “Last-quarter value”. Its updated 2024 test MSE is 2.613757 points². Changing the rule after seeing the test result reuses that test for selection. Downloads retain candidate arithmetic for audit, but test results do not choose this rule.
Think first, then reveal: Was this a prospective experiment actually run during 2023?
No. It is a learning plan written after outcomes existed, using a revised snapshot downloaded in 2026. Historical real-time vintages are not established. Correct chronological roles differ from an actual prospective experiment, and four test errors do not guarantee future ranking.
Human handwriting · An image record and its writer are different units
Use the original UCI optdigits.tra (3,823 rows) and optdigits.tes (1,797 rows). Provider metadata states that thirty writers supplied training data and thirteen different writers supplied test data. One image row is not one person. Each row has 64 inputs and a digit label 0–9: counts of on-pixels in 4×4 blocks of a normalized 32×32 bitmap, producing an 8×8 grid of values 0–16 without missing cells.
The displays below visualize 64 actual source block counts in grayscale. They are not high-resolution pen photographs or newly generated handwriting. Darker cells contain more on-pixels. Retain source filename together with row-within-file so training row one and test row one do not collide as keys.
Actual class counts · digit labels are class codes, not ordered magnitudes
Class label
Provided train rows
Provided test rows
0
376
178
1
389
182
2
380
177
3
389
183
4
387
181
5
376
182
6
377
181
7
387
179
8
380
174
9
382
180
Think first, then reveal: Does reshuffling rows automatically produce writer-disjoint validation?
Per-row writer IDs are absent, so we cannot audit writer separation for an internal row split. Distinguish provider-reported disjoint writer sets from row counts/pixels/labels directly checked in the files. Do not invent writer IDs. New-writer performance requires writer grouping and differs from new images by familiar writers.
Think first, then reveal: May test labels resolve a training majority tie?
Training labels one and three each occur 389 times. The stated smallest-label tie rule chooses one, matching 182/1797≈10.1280% of provided test labels. Switching to three after noticing its 183 test labels reuses the test for selection. This is a low constant-label benchmark, not a trained image recognizer.
Product-practice case · What is evaluated when identical inputs cross partitions?
The 1,599 actual Portuguese Vinho Verde red-wine laboratory/sensory records contain eleven physicochemical inputs and a quality score. Real producer, bottle and batch IDs are not established. They are not identified as one firm’s products or 1,599 independent products. Define 1,359 exact eleven-input patterns, excluding the quality label. Equal inputs do not establish the same bottle or an entry error; delete no rows.
Compare two chosen designs. Row splitting orders source rows by a fixed permutation and assigns about 60%/20%/remainder to training/validation/test. Pattern-group splitting applies the same rule to first-source-row anchors and keeps every matching pattern together. Order by (sourceRow×104729 mod 1000003, sourceRow). This is a deterministic illustration, not prospective random sampling. Group proportions need not equal row proportions.
Both splits retain source rows · quality means are descriptive/rounded
Design
Role
Rows
Input patterns
Quality mean
Row split
train
959
876
5.624609
Row split
validation
319
308
5.695925
Row split
test
321
308
5.610592
Input-pattern group split
train
952
815
5.634454
Input-pattern group split
validation
321
271
5.657321
Input-pattern group split
test
326
273
5.619632
Actual input patterns shared between role partitions
Design
Role pair
Shared patterns
Row split
train / validation
63
Row split
train / test
54
Row split
validation / test
19
Input-pattern group split
train / validation
0
Input-pattern group split
train / test
0
Input-pattern group split
validation / test
0
Think first, then reveal: Do 63/54/19 shared patterns prove incorrect source data?
No. They establish repeated input values, not accidental duplicate products. Predicting another observation of a familiar pattern differs from evaluating entirely unseen patterns. This example compares a conservative nonoverlap design. New-producer generalization cannot be certified without producer IDs.
Think first, then reveal: Why exclude the quality label from grouping?
The declared group is an input pattern. Grouping only when labels also match could separate identical inputs with differing outcomes. Compute groups from eleven inputs while retaining every original row and label. Group separation alone does not train a model or guarantee good scores; quality is still an ordinal assessment.
기초Foundations
48. 원문에서 분할의 이유와 정보 경계를 찾아 읽는다48. Read original explanations of roles and information boundaries
scikit-learn의 교차검증 안내에서 기본 훈련/시험 분리, 하이퍼파라미터 선택과 그룹·시간 분할 설명을 좁혀 읽습니다. API 이름을 외우기 전에 어떤 행·그룹·시점이 같은 역할로 들어가는지 작은 표를 그립니다. 원문에 등장하는 무작위 함수의 실제 확률 배정과 이 장의 결정적 순서도 구별합니다.
CrashCourse 제작자 페이지의 지도학습 소개와 Hastie의 대학 소개를 연결해 학습 규칙과 평가 질문을 따로 말해 봅니다. 예측 교재의 자료 분할 설명에서는 예측 출발점과 미래 기간을 확인합니다. 원문을 읽었다는 사실이 이 장의 실제 자료에 모든 가정을 자동으로 보장하지는 않습니다.
Read selected scikit-learn explanations of basic training/test separation, hyperparameter selection, and grouped/temporal splitting. Draw a small role table before memorizing an API. Distinguish actual random assignment functions in that documentation from this chapter’s deterministic ordering.
Use the CrashCourse creator page and Hastie’s university introduction to separate a learning rule from its evaluation question. In the forecasting reading, identify the origin and future periods. Reading a general method does not automatically establish all its assumptions for these records.
자료 묶음을 풀고 코드와 실제데이터 폴더를 함께 두세요. 터미널에서 코드 파일이 있는 폴더로 이동해 아래 명령을 실행합니다. 코딩이 처음이라면 손계산과 웹 실습을 먼저 하고, 데이터 사이언스 입문에서 코드를 배운 뒤 돌아와도 됩니다.Extract the bundle, keeping the scripts beside the data folder. In a terminal, enter the script folder and run the commands below. Beginners can complete hand calculations and browser labs first, returning to code after studying introductory data science.
결과 파일은 각 코드에 지정된 결과 폴더에 저장됩니다. CSV 원자료는 덮어쓰지 않습니다.Result files are saved in the result directory specified by each script; the input CSVs are not overwritten.
영상·학자·함께 읽기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.
Crash Course · 지도학습의 예측 대상과 시험Crash Course · Prediction targets and tests in supervised learning
CrashCourse Statistics 36
분류·예측을 다루는 공식 소개를 보고, 이 장의 “새로운 행/새 작성자/미래 시점” 중 무엇이 목표인지 먼저 적습니다. 그룹·시간 분할의 자세한 규칙은 본문과 공식 읽기에서 확인합니다.Use the official supervised-learning introduction to state whether the target is new rows, new writers or later periods. The chapter and official readings specify group/time split details.
교재 안의 YouTube 플레이어에서 재생합니다. 원영상에서 제공하는 자막은 플레이어의 CC·설정에서 선택할 수 있습니다.Playback stays in this chapter’s YouTube player. Available captions can be selected through CC/settings.
보고 읽은 뒤 답하기Respond after watching/reading정답이 있는 자료면 아무 행이나 나눠도 같은 시험인가요?Does labeled data make every row split the same test?
생각을 점검하는 해설Check your reasoning
아닙니다. 작성자·제품·시간 관계와 실제 배포 표적에 따라 달라집니다.No. Writer, product and time relationships change the deployment target.
Stanford Department of Statistics official profile
응용 회귀·분류와 통계적 학습 저술의 소개를 읽습니다. 모델을 고르는 자료와 마지막 성능을 보고하는 자료를 구별하는 학습 원칙을 연결하세요.Read the official introduction to applied regression/classification and statistical-learning work. Connect it with distinguishing model-selection data from final evaluation data.
3.1.2.4의 그룹을 겹치지 않게 나누는 규칙과 3.1.2.6의 시간 순서 설명을 읽습니다. API의 행·그룹 비율과 반복 분할의 겹침은 각 클래스 규칙을 확인하고 독립적으로 해석합니다.Read grouped data in 3.1.2.4 and time series in 3.1.2.6. Check each splitter’s group/row proportions and whether repeated test partitions can overlap.
보고 읽은 뒤 답하기Respond after watching/reading같은 그룹을 양쪽에 두지 않으면 모든 의존 문제가 해결되나요?Does group nonoverlap resolve every dependence issue?
생각을 점검하는 해설Check your reasoning
그룹 정의가 적절해야 하며 다른 시간·기관·측정 의존도 남을 수 있습니다.The group definition must be appropriate; other temporal, institutional or measurement dependence can remain.
FPP3 · 새 자료의 오차와 시간 순서 평가FPP3 · New-data errors and chronological evaluation
Hyndman & Athanasopoulos · 5.8 training/test and 5.10 rolling origin
5.8 Training and test sets와5.10 도입의 과거만 학습하는 순서를 읽습니다.20%는 예시 관행이지 모든 문제의 필수 규칙으로 쓰지 않습니다.Read 5.8 Training and test sets and the 5.10 rolling-origin introduction. The illustrative 20% convention is not a universal requirement.
보고 읽은 뒤 답하기Respond after watching/reading시간 분할만 하면 개정 자료의 실시간 사용 가능성도 확인되나요?Does chronological splitting verify real-time availability of revised data?
생각을 점검하는 해설Check your reasoning
아닙니다. 발표 시점·개정 빈티지와 입력 가용성도 별도로 기록해야 합니다.No. Release timing, revision vintage and feature availability require separate records.
연습문제 · 계산에서 설명과 증명까지Exercises: calculation, explanation and proof
먼저 혼자 풀고 풀이를 여세요. 숫자와 함께 단위·포함 기준·계산 이유를 확인하세요.Attempt each problem before opening its solution. Check units, inclusion rules and the reason for the calculation.
1. 10행을 6·2·2로 나누기Assign ten rows as 6, 2, 2
원키 순서의 10행에 훈련 비율 3/5, 검증 비율 1/5를 적용합니다. 두 개수는 바닥값을 취하고 나머지는 시험으로 둡니다. 각 개수와 시험 원키를 구하세요.
For ten rows in source order, floor the training count at fraction 3/5 and validation count at fraction 1/5, assigning the remainder to test. Find counts and test keys.
풀이와 확인할 이유Solution and explanation
훈련은 ⌊10×3/5⌋=6, 검증은 ⌊10×1/5⌋=2, 시험은 10−6−2=2행입니다. 훈련 원키 1~6, 검증 7~8, 시험 9~10입니다.
Training has floor(10×3/5)=6 rows, validation two and test 10−6−2=2. Training keys are 1–6, validation 7–8 and test 9–10.
2. 나머지를 시험에 두기Assign the remainder to test
n=17, 훈련 3/5, 검증 1/5에서 각각 바닥값을 취하고 시험을 나머지로 둡니다. 세 개수와 시험의 실제 비율을 구하세요.
At n=17, floor training at 3/5 and validation at 1/5, and assign the remainder to test. Find the three counts and realized test fraction.
풀이와 확인할 이유Solution and explanation
훈련 10, 검증 3, 시험 4입니다. 시험 실제 비율은 4/17≈0.235294로 선택한 나머지 비율 1/5와 다릅니다. 정수 배정 때문입니다.
The counts are 10, 3, 4. The realized test fraction is 4/17≈0.235294, differing from the nominal remaining fraction 1/5 because rows are indivisible.
3. 세 개별 반올림의 문제Independent rounding can fail
n=3에 세 역할 비율을 각각 1/3으로 정하고 세 개수를 모두 올림하면 합은 얼마인가요? n=4에서도 같은 올림을 하면 어떤 문제가 생기나요?
For n=3 with three fractions 1/3, what happens if each count is rounded up? Repeat at n=4.
풀이와 확인할 이유Solution and explanation
n=3에서는 각 1행이라 합 3입니다. n=4에서는 각 ⌈4/3⌉=2행이라 합 6이 되어 4행을 서로 겹치지 않게 나누는 개수가 아닙니다. 일관된 나머지 규칙이 필요합니다.
At n=3, each count is one and the total is three. At n=4, each ceiling is two, totaling six rather than four. A consistent remainder rule avoids this failure.
4. 개수만 맞는 잘못된 분할Counts alone miss overlap and omission
I={1, 2, 3}, T={1, 2}, V={2}, E가 빈집합입니다. 개수 합, 겹친 키, 빠진 키를 각각 구하세요.
Let I={1, 2, 3}, T={1, 2}, V={2} and E empty. Find total count, overlap and omitted keys.
풀이와 확인할 이유Solution and explanation
개수 합은 2+1+0=3입니다. T∩V={2}이고 합집합은 {1, 2}라 키 3이 빠집니다. 개수 합만 검사하면 두 오류를 놓칩니다.
Counts sum to 2+1+0=3. T and V overlap at two, while their union is {1, 2}, omitting three. Count equality alone misses both errors.
5. 파일 이름이 들어간 원키Include filenames in source keys
optdigits.tra 원행 1과 optdigits.tes 원행 1을 합친 뒤 단순 키 1로 기록했습니다. 추적 가능한 두 키를 제시하고 작성자 ID인지 설명하세요.
Row one of optdigits.tra and row one of optdigits.tes were merged under key 1. Supply traceable distinct keys and explain whether they are writer IDs.
풀이와 확인할 이유Solution and explanation
예를 들어 optdigits.tra:1과 optdigits.tes:1을 씁니다. 파일·원행 위치를 구별하지만 작성자의 신원을 알려 주지는 않습니다.
Use keys such as optdigits.tra:1 and optdigits.tes:1. They identify file positions, rather than writer identities.
6. 한 행의 빈 훈련An empty training role with one row
n=1, 훈련 3/5, 검증 1/5에서 각각 바닥값·시험 나머지 규칙을 씁니다. 개수를 구하고 훈련 평균을 0이라 둘 수 있는지 설명하세요.
At n=1, floor training at 3/5 and validation at 1/5 and use the remainder as test. Find counts and decide whether the training mean is zero.
풀이와 확인할 이유Solution and explanation
개수는 0·0·1입니다. 훈련 값이 없으므로 평균은 미정의입니다. 0을 넣는 것은 분할이 알려 준 평균이 아니라 별도의 대체 선택입니다.
Counts are 0, 0, 1. With no training value, its mean is undefined. Filling zero would be an additional rule rather than an observed mean.
7. 다른 비율의 손계산Calculate another fraction pair
원키 순서의 n=11에서 훈련 비율 1/2, 검증 1/4를 각각 바닥값으로 정합니다. 시험 개수와 검증 원키를 구하세요.
For n=11 in source order, floor training at fraction 1/2 and validation at 1/4. Find test count and validation keys.
풀이와 확인할 이유Solution and explanation
훈련 5, 검증 2, 시험 4입니다. 원키 순서이므로 검증은 6·7입니다. 모든 비율 개수를 별도 올림하지 않습니다.
Counts are five training, two validation and four test. Validation keys are six and seven under the stated source order.
8. 결정적 순서의 뜻Interpret a deterministic ordering
배정 순서가 h(i)=(104729i+offset) mod 1000003와 원키 동률 순서로 완전히 정해집니다. 같은 입력의 재현 가능성과 독립 확률표집은 같은 주장인가요?
Assignment uses h(i)=(104729i+offset) mod 1000003 and source-key tie order. Are reproducibility and independent probability sampling the same claim?
풀이와 확인할 이유Solution and explanation
같은 입력은 같은 순서를 재현합니다. 독립 확률표집이라는 확률 법칙은 이 결정적 식만으로 주어지지 않습니다. 두 주장은 다릅니다.
The same inputs reproduce the same order. A joint probability-sampling law is not supplied by that deterministic formula alone, so the claims differ.
9. 순서 값의 첫 계산Compute the first ordering values
offset=0에서 h(i)=(104729i) mod 1000003입니다. i=1, 2, 3의 값을 구하고 이 세 키 안에서의 순서를 쓰세요.
With offset=0, let h(i)=(104729i) mod 1000003. Compute values for i=1, 2, 3 and their order within these three keys.
풀이와 확인할 이유Solution and explanation
104729, 209458, 314187이며 모두 1000003보다 작습니다. 따라서 이 세 키 안의 순서는 1, 2, 3입니다. 더 큰 키까지 같은 순서라는 결론은 아닙니다.
Values are 104729, 209458, 314187, all below the modulus. These three keys order as 1, 2, 3. This does not establish that order for all larger keys.
10. 역할 개수의 일반 합Prove count feasibility
정수 n≥0와 a, b≥0, a+b≤1에서 n_T=⌊na⌋, n_V=⌊nb⌋, n_E=n−n_T−n_V입니다. n_E≥0와 개수 합 n을 보이세요.
For integer n≥0 and a, b≥0 with a+b≤1, set n_T=floor(na), n_V=floor(nb), n_E=n−n_T−n_V. Prove n_E≥0 and total n.
풀이와 확인할 이유Solution and explanation
바닥값 합은 na+nb≤n보다 크지 않아 n_E≥0입니다. 정의를 더하면 n_T+n_V+n_E=n입니다. 이 수치 조건만으로 실제 키의 겹침 없음까지 보장되지는 않습니다.
The two floors sum to at most n(a+b)≤n, giving n_E≥0. Substitution yields total n. Actual key disjointness still needs checking.
11. 같은 그룹의 행 분할Find group overlap across disjoint rows
원행 그룹이 A, A, B, B이고 역할이 훈련, 검증, 훈련, 시험입니다. 훈련/검증과 훈련/시험의 공유 그룹을 구하세요.
Rows have groups A, A, B, B and roles training, validation, training, test. Find shared groups for training/validation and training/test.
풀이와 확인할 이유Solution and explanation
훈련 그룹은 {A, B}, 검증은 {A}, 시험은 {B}입니다. 훈련/검증은 A, 훈련/시험은 B를 공유합니다. 원행 키가 다르다는 사실로 이 겹침이 없어지지 않습니다.
Training groups are {A, B}, validation {A}, test {B}. Shared groups are A and B respectively, despite disjoint row keys.
12. 그룹 개수와 행 개수Group counts differ from row counts
A는 4행, B, C, D, E는 각 1행입니다. 그룹 순서 A, B, C, D, E에서 훈련 3그룹·검증 1그룹·시험 1그룹을 배정하세요. 역할별 행 수는 얼마인가요?
Group A has four rows and B, C, D, E one each. In that group order assign three groups to training, one validation and one test. Find row counts.
풀이와 확인할 이유Solution and explanation
훈련은 A, B, C라 4+1+1=6행, 검증 D는 1행, 시험 E는 1행입니다. 그룹 비율 3/5·1/5·1/5와 행 비율 6/8·1/8·1/8은 다릅니다.
Training A, B, C has 4+1+1=6 rows. Validation D and test E each have one. Group fractions 3/5, 1/5, 1/5 differ from row fractions 6/8, 1/8, 1/8.
13. 작은 그룹 수의 빈 검증An empty validation set with four groups
그룹이 A, B, C, D의 네 개이고 그룹 훈련 비율 3/5·검증 1/5의 바닥값을 취합니다. 그룹별 행 수가 모두 2라면 역할별 그룹 수·행 수를 구하세요.
There are four groups A, B, C, D, each containing two rows. Floor group training at 3/5 and validation at 1/5, with remainder test. Find group and row counts.
풀이와 확인할 이유Solution and explanation
그룹 수는 2·0·2이고 행 수는 4·0·4입니다. 검증 후보 선택에 쓸 점수가 없는 상태를 0점으로 보고하면 안 됩니다.
Group counts are 2, 0, 2; row counts are 4, 0, 4. Empty validation does not produce a zero selection loss.
14. 행 평균과 그룹 평균Compare row and group averages
A그룹은 4행 모두 손실 0, B그룹은 1행 손실 10입니다. 행에 같은 무게를 준 평균과 두 그룹 평균에 같은 무게를 준 평균을 구하세요.
Group A has four rows with loss zero; group B has one row with loss ten. Find the row-weighted mean and the equal-group mean.
풀이와 확인할 이유Solution and explanation
행 평균은 (4×0+10)/5=2입니다. 그룹 평균은 (0+10)/2=5입니다. 행을 새로 뽑는 질문과 그룹을 같은 무게로 보는 질문이 달라집니다.
The row mean is (4×0+10)/5=2. Equal weighting of the two group means gives (0+10)/2=5. They answer different weighting questions.
15. 정답을 뺀 패턴 키Exclude targets from an input-pattern key
두 와인 행의 11개 입력은 모두 같고 품질 점수는 5와 6입니다. 동일 입력의 역할 간 겹침을 막으려면 품질을 그룹 키에 넣어도 되나요?
Two wine rows share all eleven inputs but have quality labels five and six. Should quality enter a key intended to prevent identical inputs crossing roles?
풀이와 확인할 이유Solution and explanation
이번 목적에는 품질을 빼야 합니다. 품질을 넣으면 두 행이 다른 그룹으로 갈라져 같은 입력이 역할을 건널 수 있습니다. 원 품질 5와 6은 모두 보존합니다.
Exclude quality for this purpose. Including it would separate the identical inputs into different groups. Preserve both original labels five and six.
16. 같은 수치와 같은 제품Matching values do not identify a product
두 기록의 입력 11개가 같지만 제품 ID가 없습니다. “한 제품의 중복이므로 한 행을 지운다”가 자료만으로 따라오는지 설명하세요.
Two rows match in eleven inputs but have no product ID. Does this alone justify deleting one as a duplicate product?
풀이와 확인할 이유Solution and explanation
따라오지 않습니다. 같은 입력은 확인되지만 같은 제품·반복 측정·입력 오류 중 무엇인지는 알 수 없습니다. 그룹 설계 선택과 원행 삭제는 구별합니다.
No. Input equality does not identify a product, repeated measurement or input error. A grouping choice differs from deletion.
17. 미확인 작성자Unknown writer identity
이미지 파일에 작성자 키가 없습니다. 파일·원행 키가 서로 다르면 서로 다른 작성자의 이미지라고 할 수 있나요?
Image records lack writer IDs. Do distinct filename/source-row keys establish different writers?
풀이와 확인할 이유Solution and explanation
파일·원행 키는 다른 기록임을 보여 줍니다. 작성자의 신원을 보여 주지 않으므로 그 결론은 나오지 않습니다. 제공자가 설명한 파일 간 작성자 구성과 새 내부 행 분할의 확인 범위를 따로 씁니다.
They establish distinct source records, rather than distinct writers. Keep provider metadata about supplied files separate from what a new internal row split can audit.
18. 그룹 배정의 겹침 없음 증명Prove group-role separation
각 행 i의 그룹 g(i)에 함수 a가 역할 하나를 배정합니다. 행 역할을 a(g(i))로 정할 때 같은 그룹이 훈련과 검증 양쪽에 나타날 수 없음을 보이세요.
A function a assigns one role to each group g. Row i receives role a(g(i)). Prove that a group cannot appear in both training and validation.
풀이와 확인할 이유Solution and explanation
같은 그룹 g의 모든 행은 동일한 함수값 a(g)를 받습니다. 훈련과 검증이 다른 역할이므로 a(g)가 둘일 수 없습니다. 단, g가 실제 개체를 정확히 나타내는지는 별도 사실입니다.
Every row of a given group g receives the same a(g). One function value cannot equal two different roles. Whether g correctly represents a real unit is a separate issue.
19. 시간 위치 손계산Assign chronological positions by hand
n=12, 훈련 끝 6, 검증 끝 9, 각 끝 뒤 gap=1입니다. 모든 역할의 원키를 쓰세요.
Let n=12, training end six, validation end nine and a gap of one after each endpoint. List source keys for all roles.
풀이와 확인할 이유Solution and explanation
훈련 1~6, gap 7·10, 검증 8·9, 시험 11·12입니다. gap을 포함해 12개 원위치가 정확히 한 번 보존됩니다.
Training uses 1–6; gaps are 7 and 10; validation 8 and 9; test 11 and 12. Every original position remains exactly once.
20. 불가능한 시간 간격Reject an impossible gap
n=12, 훈련 끝 6, 검증 끝 8, gap=3을 선택했습니다. 필요한 두 부등식을 확인해 어느 조건이 실패하는지 설명하세요.
Set n=12, training end six, validation end eight and gap three. Check both required endpoint inequalities.
풀이와 확인할 이유Solution and explanation
6+3≤8이 거짓입니다. 8+3≤12는 참이어도 첫 조건이 실패하므로 이 입력을 거부해야 합니다. 간격을 조용히 2로 바꾸면 선언한 설계가 달라집니다.
The condition 6+3≤8 fails, although 8+3≤12 holds. Reject the input instead of silently changing the gap to two.
21. 시간 분할 일반 개수Count a temporal split
n=20, 훈련 끝 t=10, 검증 끝 v=16, 각 경계 뒤 gap h=2입니다. 훈련·검증·시험·gap 개수를 계산하고 합을 확인하세요.
Let n=20, training endpoint t=10, validation endpoint v=16 and gap h=2 after each boundary. Find training, validation, test and gap counts and check their sum.
풀이와 확인할 이유Solution and explanation
훈련 10, 검증 16−10−2=4, 시험 20−16−2=2, gap 2×2=4입니다. 합은 20이며 검증은 원키 13~16, 시험은 19~20입니다.
Counts are 10, 16−10−2=4, 20−16−2=2 and 2×2=4, totaling twenty. Validation keys are 13–16 and test keys 19–20.
22. 일주일 정답의 중첩Overlap in seven-day outcomes
첫 행 정답은 2~8일의 구매량 합, 둘째 행 정답은 3~9일의 구매량 합입니다. 공유하는 날짜 수를 구하고 행 날짜 차이만으로 정답 독립성이 생기는지 설명하세요.
The first row targets total purchases on days 2–8; the second targets days 3–9. Count shared days and decide whether different row dates establish independent outcomes.
풀이와 확인할 이유Solution and explanation
3~8일의 6일을 공유합니다. 공유되는 구매 기록 때문에 두 합은 의존할 수 있습니다. 서로 다른 행 날짜만으로 독립이 증명되지 않습니다.
They share days 3–8, six days. Shared purchases can create dependence; distinct row dates do not establish independence.
23. 한 출발점과 갱신 출발점One origin versus updated origins
관측값 1, 2, 3, 4 뒤 마지막 값 규칙으로 다음 세 시점을 한꺼번에 예측합니다. 다음 값 5가 공개된 뒤 나머지 예측을 5로 바꾸면 처음의 예측 벡터와 어떻게 다른가요?
After observing 1, 2, 3, 4, forecast the next three periods with the last-value rule. After observing the next value five, update the remaining predictions. Compare procedures.
풀이와 확인할 이유Solution and explanation
처음 한 출발점 벡터는 (4, 4, 4)입니다. 갱신하면 첫 예측은 4, 나머지는 (5, 5)가 되어 다른 정보 시점의 절차입니다. 둘을 같은 고정 예측 벡터라고 합치지 않습니다.
The original one-origin forecast is (4, 4, 4). Updating produces first prediction four and remaining predictions (5, 5). These use different information cutoffs.
24. 2024년 관측과 2026년 사본An observation year is not a vintage
2026년에 내려받은 파일에 2024년 값이 있습니다. 이 파일만으로 2024년 당시 최초 공표값이 같았다고 할 수 있나요? 필요한 추가 기록을 하나 쓰세요.
A file downloaded in 2026 contains a 2024 observation. Does it establish the identical first-release value in 2024? Name one additional record needed.
풀이와 확인할 이유Solution and explanation
같았다고 할 수 없습니다. 예를 들어 당시 날짜에 보관한 원 데이터 빈티지나 공표 이력과 최초 값이 필요합니다. 기간 이름은 다운로드 시점과 다릅니다.
No. A contemporaneous archived vintage or release history with original values would be needed. Observation periods and download dates are different.
25. 검증 최소 동률의 선택Choose a validation tie
내부 후보 번호 0, 1, 2의 검증 손실은 2, 1, 1이고 시험 손실은 5, 9, 0입니다. 검증 최소 동률은 가장 작은 원번호로 풉니다. 선택 번호와 해당 시험 손실을 구하세요.
Candidates indexed 0, 1, 2 have validation losses 2, 1, 1 and test losses 5, 9, 0. Resolve validation ties toward the smallest original index. Find the selected index and its test loss.
풀이와 확인할 이유Solution and explanation
검증 최소 번호는 {1, 2}이고 선택은 1입니다. 해당 시험 손실은 9입니다. 시험 최소 0을 보고 번호 2로 바꾸면 시험을 선택에 쓴 다른 절차입니다.
Validation minimizers are {1, 2}; select index one. Its test loss is nine. Switching to two after seeing test minimum zero uses test outcomes for selection.
26. 가용 검증 후보만 비교Select among available validation scores
내부 번호 0, 1, 2의 검증 손실은 null, 3, 2이고 시험 손실은 1, 4, null입니다. 가용 검증 최소를 고르면 선택과 시험 점수는 무엇인가요?
Validation losses at indices 0, 1, 2 are null, 3, 2 and test losses 1, 4, null. Select the available validation minimum. What is selected and what test score is available?
풀이와 확인할 이유Solution and explanation
선택은 검증 손실 2인 번호 2입니다. 그 시험 손실은 null이라 미정의입니다. 시험 값이 있는 번호 0이나 1로 조용히 바꾸지 않습니다.
Index two is selected because its validation loss is two. Its test score is unavailable. Do not quietly switch to another candidate with an observed test score.
27. 전부 미가용인 검증No available validation candidate
두 후보의 검증 손실은 둘 다 null이고 시험 손실은 0과 5입니다. 검증 최소 선택 규칙의 결과를 쓰세요.
Two validation losses are both null; test losses are zero and five. What does the validation-minimum rule return?
풀이와 확인할 이유Solution and explanation
가용 검증 후보가 없어 선택은 미정의입니다. 시험 손실 0을 골라 검증 선택 결과라고 부를 수 없습니다.
Selection is undefined because there is no eligible validation candidate. Choosing test loss zero would be a different rule.
28. 아주 작은 양수 손실Compare tiny positive losses exactly
두 검증 손실의 원입력이 1e−400과 2e−400이고 미가용이 아닙니다. 정확 수치로 비교하면 어느 후보가 선택되나요? 화면에 둘 다 0으로 보일 때 동률인가요?
Available validation losses are declared as 1e−400 and 2e−400. Which candidate minimizes them exactly? Does a display of zero for both imply a tie?
풀이와 확인할 이유Solution and explanation
첫 손실이 엄격히 작아 첫 후보가 선택됩니다. 표시 수의 underflow가 원래 정확 양수를 0으로 바꾸지는 않으며 동률도 아닙니다.
The first is strictly smaller and is selected. Display underflow does not change the declared positive values or make them a mathematical tie.
29. 두 독립 시험 최소의 기대값Expected minimum of two independent scores
L₁, L₂가 독립이고 각각 0 또는 2를 확률 1/2씩 가집니다. 각 기대값과 E[min(L₁, L₂)]를 구하세요.
L₁, L₂ are independent and each equals zero or two with probability one half. Find their expectations and the expected minimum.
풀이와 확인할 이유Solution and explanation
각 기대값은 1입니다. 최소가 2인 사건은 둘 다 2인 경우로 확률 1/4이므로 최소 기대값은 2×1/4=1/2입니다.
E[Lj]=1E[min(L1,L2)]=1/2
Each expectation is one. The minimum equals two only if both equal two, with probability one quarter; its expectation is therefore one half.
E[Lj]=1E[min(L1,L2)]=1/2
30. 같은 주변분포와 다른 의존Dependence changes the selected minimum
L이 0 또는 2를 확률 1/2씩 갖고 L₁=L₂=L입니다. E[min(L₁, L₂)]를 구하고 독립일 때 1/2와 비교하세요.
Let L equal zero or two with probability one half and set L₁=L₂=L. Find the expected minimum and compare with one half under independence.
풀이와 확인할 이유Solution and explanation
최소가 언제나 L이라 기대값은 1입니다. 각 주변분포는 독립 예와 같지만 결합 의존이 달라 최소 기대값이 다릅니다.
The minimum always equals L, so its expectation is one. Marginal distributions match the independent example, while dependence changes the minimum.
31. 세 독립 후보의 최소Minimum of three independent candidates
서로 독립인 L₁, L₂, L₃는 각각 0 또는 2를 확률 1/2씩 갖습니다. 세 점수를 보고 최소를 고른 값의 기대값을 구하세요.
Three mutually independent losses each equal zero or two with probability one half. Find the expectation of the minimum selected after inspecting all three.
풀이와 확인할 이유Solution and explanation
최소가 2일 확률은 셋 모두 2인 확률 1/8입니다. 기대값은 2/8=1/4입니다. 후보별 기대값 1과 구별합니다.
The minimum is two only when all three are two, with probability one eighth. Its expectation is 2/8=1/4, rather than the individual expectation one.
32. 선택 뒤 재적합의 대상Identify the refitted procedure
훈련 60행·검증 20행으로 설정 B를 고른 뒤 두 역할을 합쳐 B를 재적합하고 별도 시험 20행으로 평가합니다. 최종 적합 행 수와 시험이 평가하는 함수를 설명하세요.
A setting B is selected using sixty training and twenty validation rows, then refitted on both and evaluated on twenty separate test rows. What is fitted and evaluated?
풀이와 확인할 이유Solution and explanation
최종 적합은 80행을 사용합니다. 시험은 설정 B를 유지하고 80행으로 다시 맞춘 최종 함수를 평가합니다. 원래 훈련 60행에서 맞춘 함수와 같다고 가정하지 않습니다.
The final fit uses eighty rows with setting B. Test evaluates that refitted function, which need not equal the original sixty-row fit.
33. 시험을 보고 offset 바꾸기Choosing offsets after test inspection
시험 점수를 본 뒤 offset을 0부터 9까지 바꾸어 가장 좋은 분할만 보고했습니다. 이것이 원래 고정 분할의 한 번 시험과 같은가요?
After inspecting test scores, offsets zero through nine were tried and only the best reported. Is this one evaluation of a fixed original split?
풀이와 확인할 이유Solution and explanation
아닙니다. 시험 결과가 분할 선택에 들어갔습니다. 탐색한 열 offset과 선택 과정을 보고하고 고른 점수를 새 독립 시험이라고 부르지 않습니다.
No. Test outcomes informed partition selection. Disclose the ten choices and do not call the selected score a fresh independent test.
34. 세 fold의 역할표Read a three-fold role table
원키 1~6의 검증 fold가 {1, 2}, {3, 4}, {5, 6}입니다. 둘째 fold를 검증으로 둘 때 훈련 원키와 세 차례 전체의 훈련 사용 수를 구하세요.
Validation folds for keys 1–6 are {1, 2}, {3, 4}, {5, 6}. Find training keys in the second turn and total training uses across all turns.
풀이와 확인할 이유Solution and explanation
둘째 차례 훈련은 {1, 2, 5, 6}입니다. 각 차례 훈련 4행이므로 전체 사용 수는 3×4=12입니다. 고유 원행 수는 여전히 6입니다.
Second-turn training keys are {1, 2, 5, 6}. Four training rows per turn give twelve training uses overall, with six unique source records.
35. 그룹 round-robin의 행 수Count round-robin grouped folds
그룹 순서 A, B, C, D, E에서 A는 4행, 나머지는 1행입니다. 차례로 fold 0, 1, 2, 0, 1에 보내면 각 fold의 검증 행 수는 얼마인가요?
In group order A, B, C, D, E, A has four rows and each other group one. Assign folds 0, 1, 2, 0, 1. Find validation-row counts.
풀이와 확인할 이유Solution and explanation
fold 0은 A, D로 5행, fold 1은 B, E로 2행, fold 2는 C로 1행입니다. 그룹 수는 2·2·1이라 행 수와 다릅니다.
Fold zero has A, D and five rows; fold one has B, E and two rows; fold two has C and one row. Group counts are 2, 2, 1.
36. 그룹보다 많은 foldMore folds than groups
그룹 A에는 2행, B에는 1행이 있고 순서 A, B를 K=4개의 fold 0, 1, 2, 3에 번갈아 배정합니다. 검증 행 수와 빈 fold 수를 구하세요.
Groups A and B have two and one rows. Assign them round-robin in that order to K=4 folds indexed 0–3. Find validation-row counts and the number of empty folds.
풀이와 확인할 이유Solution and explanation
검증 행 수는 2, 1, 0, 0이고 두 fold가 빕니다. 빈 fold의 평균 손실은 미정의이며 0점 성과가 아닙니다.
Counts are 2, 1, 0, 0, leaving two empty folds. Their mean losses are undefined rather than zero.
37. 같은 fold 평균과 행 평균Average folds or rows
첫 검증 fold는 2행 모두 손실 1, 둘째는 4행 모두 손실 3입니다. 두 fold 평균의 단순 평균과 전체 행 평균을 구하세요.
The first validation fold has two rows with loss one; the second has four with loss three. Find the unweighted fold average and pooled row average.
풀이와 확인할 이유Solution and explanation
단순 평균은 (1+3)/2=2입니다. 전체 행 평균은 (2×1+4×3)/6=7/3입니다. 전체 행에 같은 무게를 줄 때 후자를 씁니다.
They are (1+3)/2=2 and (2×1+4×3)/6=7/3. The latter gives each row equal weight.
38. 행 수가 같은 foldEqual-size fold averaging
K=3개 검증 fold가 각각 4행이고 평균 손실은 1, 2, 6입니다. 행 가중 평균과 fold 단순 평균을 구하고 왜 같은지 설명하세요.
Three validation folds each contain four rows and have mean losses 1, 2, 6. Find weighted and unweighted averages and explain equality.
풀이와 확인할 이유Solution and explanation
둘 다 (1+2+6)/3=3입니다. 각 fold 가중치가 n_k/n=4/12=1/3으로 같기 때문입니다. 불균등 크기에서도 항상 같다는 뜻은 아닙니다.
Both equal (1+2+6)/3=3 because every fold weight is 4/12=1/3. Equality need not hold for unequal sizes.
39. 겹치는 훈련 집합Shared training observations
두 차례 훈련 키는 {3, 4, 5, 6}과 {1, 2, 5, 6}입니다. 교집합을 구하고 두 점수를 독립 관측 두 개로 자동 취급할 수 있는지 설명하세요.
Training sets in two turns are {3, 4, 5, 6} and {1, 2, 5, 6}. Find their intersection and decide whether scores are automatically independent.
풀이와 확인할 이유Solution and explanation
교집합은 {5, 6}입니다. 같은 관측을 공유해 적합·점수가 함께 변할 수 있습니다. 독립이라는 추가 근거 없이 두 독립 점수로 취급하지 않습니다.
The intersection is {5, 6}. Fits and scores can move together because of shared observations. Independence needs additional justification.
40. 최종 적합과 fold 적합Final fits differ from fold fits
n=6을 세 fold 각 2행으로 나누고 한 fold를 뺀 4행으로 매 차례 적합했습니다. 마지막에 6행 모두로 다시 맞춘 함수의 같은 행 내 손실이 교차검증 손실과 반드시 같은가요?
Six rows are split into three folds of two, fitting on four in each turn. Must in-sample loss of a final six-row fit equal cross-validation loss?
풀이와 확인할 이유Solution and explanation
같지 않을 수 있습니다. 교차검증은 각 행을 제외한 차례의 함수로 손실을 계산하지만 최종 함수는 그 행까지 포함해 적합됩니다. 함수와 정보가 달라집니다.
No. Each CV loss uses a function fitted without that row, while the final fit includes it. The fitted functions and information differ.
41. 세 예측 기준선 손계산Calculate three forecast benchmarks
직전 연도 네 분기 값은 (100,102,104,106), 다음 해 검증 정답은 (108,110,112,114)입니다. 마지막 값 반복, 직전 연도 평균 반복, 같은 분기 값의 세 예측 MSE를 구하고 최소를 고르세요.
Previous-year quarters are (100,102,104,106), with next-year validation outcomes (108,110,112,114). Compare MSEs of repeating the last value, repeating the prior-year mean, and matching prior-year quarters.
풀이와 확인할 이유Solution and explanation
마지막 값은 (106,106,106,106)이므로 MSE=(4+16+36+64)/4=30입니다. 평균 103 반복은 (25+49+81+121)/4=69, 같은 분기는 오차 8씩이라 MSE=64입니다. 검증 최소는 마지막 값 규칙입니다.
Repeating 106 gives (4+16+36+64)/4=30. Repeating mean 103 gives (25+49+81+121)/4=69. Matching quarters has errors eight throughout, giving 64. Validation selects the last-value rule.
42. 선택한 규칙의 입력 갱신Update the selected rule’s input
검증으로 마지막 값 반복 규칙을 골랐습니다. 이제 직전 연도 값은 (108,110,112,114), 다음 해 시험 정답은 (115,116,117,118)입니다. 새 예측 벡터와 시험 MSE를 구하세요.
Validation selected the repeated-last-value rule. The updated previous year is (108,110,112,114), and test outcomes are (115,116,117,118). Find predictions and test MSE.
풀이와 확인할 이유Solution and explanation
규칙 이름을 유지하며 마지막 입력 114를 갱신해 (114,114,114,114)를 예측합니다. 제곱오차 합은 1+4+9+16=30이므로 MSE는 30/4=7.5입니다.
Keep the rule and update its last input to 114, predicting (114,114,114,114). Squared errors sum to 1+4+9+16=30; MSE is 7.5.
43. 172·4·4 기간을 풀어 쓰기Expand the 172, 4, 4 periods
실제 사례는 1980~2024년의 매년 네 분기입니다. 1980~2022년을 훈련, 2023년 네 개 분기를 검증, 2024년 네 개 분기를 시험으로 둡니다. 연도 수와 세 행 수를 계산하세요.
The case has four quarters in every year from 1980 through 2024. Use 1980–2022 as training, all four 2023 quarters as validation and all four 2024 quarters as test. Calculate year and row counts.
풀이와 확인할 이유Solution and explanation
훈련 연도는 2022−1980+1=43년이므로 172분기입니다. 검증과 시험은 각각 4분기이며 전체는 45×4=180분기입니다. “네 개 분기”는 특정 4분기(Q4) 하나가 아닙니다.
Training has 2022−1980+1=43 years, or 172 quarters. Validation and test each have four, totaling 45×4=180. Four quarters do not mean only Q4.
44. 실제 작은 시험의 범위Interpret a small actual test
2026년 보관 BIS 사본에서 고른 규칙의 2024년 네 분기 시험 MSE가 2.6137569725입니다. 이것만으로 앞으로 모든 해의 MSE가 그 이하이거나 2022년 말에 이 규칙을 골랐다고 할 수 있나요?
A rule selected from a retained 2026 BIS snapshot has MSE 2.6137569725 on four quarters of 2024. Does this guarantee future MSE no larger or establish selection at the end of 2022?
풀이와 확인할 이유Solution and explanation
둘 다 따라오지 않습니다. 이 값은 남긴 네 기간에 대한 유한 제곱오차 평균입니다. 미래 성과에는 추가 안정성 가정, 실제 과거 선택 주장에는 당시 데이터·결정 기록이 필요합니다.
Neither follows. It is a finite four-period squared-error average. Future performance needs further assumptions, and historical selection needs contemporaneous data and decision records.
45. 훈련 최빈 라벨 동률Resolve a training-majority tie
실제 숫자 훈련 3,823행에서 라벨 1과 3이 각각 389개로 최대 동률입니다. 작은 라벨을 고르기로 미리 정했습니다. 시험에서 1은 182개, 3은 183개라고 할 때 무엇을 골라야 하나요?
In 3,823 actual training images, labels one and three tie for the maximum at 389 each. Ties predeclare the smaller label. Test has 182 ones and 183 threes. What should be selected?
풀이와 확인할 이유Solution and explanation
훈련 동률 규칙대로 1을 고릅니다. 시험에서 더 많은 3으로 바꾸면 시험 정답이 선택에 들어갑니다. 389/3823은 훈련에서 고른 라벨의 빈도이지 시험 정확도가 아닙니다.
Choose one under the training tie rule. Switching to three because of test counts uses test outcomes for selection. The training fraction 389/3823 is not test accuracy.
46. 실제 단순 기준선 점수Score an actual constant benchmark
정답을 보기 전에 항상 숫자 1을 예측하는 규칙을 정했고, 실제 시험 1,797행 중 정답 1은 182개입니다. 정확도와 0–1 평균 손실을 정확 분수로 구하세요.
A rule always predicts digit one, fixed before test outcomes are inspected. Of 1,797 test images, 182 have label one. Find accuracy and mean zero-one loss as fractions.
풀이와 확인할 이유Solution and explanation
정확도는 182/1797≈0.101280입니다. 틀린 수는 1797−182=1615라 0–1 평균 손실은 1615/1797입니다. 이미지 입력을 쓰는 다른 학습기의 성능을 뜻하지 않습니다.
Accuracy is 182/1797≈0.101280. There are 1,615 errors, giving zero-one loss 1615/1797. This is not the score of an image-based learner.
47. 64블록의 위치Locate one of 64 image blocks
8×8 이미지를 행 우선 순서로 p0, p1, …, p63에 저장합니다. 화면에서 1부터 세는 둘째 행·셋째 열은 어떤 필드인가요? 이 필드가 작성자 ID인가요?
An 8×8 image is stored row-first as p0, …, p63. Which field is row two, column three when display rows and columns count from one? Is it a writer ID?
풀이와 확인할 이유Solution and explanation
0부터의 선형 위치는 (2−1)×8+(3−1)=10이므로 p10입니다. 블록의 측정값 필드이며 작성자 ID가 아닙니다.
Its zero-based linear position is (2−1)×8+(3−1)=10, so it is p10. It stores a block count, rather than a writer ID.
48. 와인 원행 보존 합Check preservation of wine rows
같은 실제 1,599행에서 행 배정 수는 959·319·321, 패턴 그룹 배정 수는 952·321·326입니다. 각 합과 그룹 배정의 훈련 행 변화량을 구하세요.
For the same 1,599 wine rows, row assignment gives 959, 319, 321 and grouped assignment 952, 321, 326. Find both totals and the change in training rows.
풀이와 확인할 이유Solution and explanation
두 합 모두 1599입니다. 그룹 배정의 훈련 행은 952−959=−7행 변화했고 검증 +2·시험 +5가 됩니다. 삭제가 아니라 역할 이동입니다.
Both totals are 1,599. Training changes by 952−959=−7, validation by +2 and test by +5. Records change roles rather than being deleted.
세 역할의 패턴 집합 A, B, C에서 쌍별 교집합 크기가 63, 54, 19이고 삼중 교집합 크기가 5라고 가정합니다. 적어도 두 역할에 있는 고유 패턴 수를 구하세요.
Three role-pattern sets A, B, C have pair-overlap sizes 63, 54, 19. Assume their triple intersection has size five. Find distinct patterns appearing in at least two roles.
풀이와 확인할 이유Solution and explanation
쌍별 크기의 합은 136이지만 삼중 패턴은 세 번 세어집니다. 한 번으로 만들려면 2×5를 빼므로 126개입니다. 삼중 크기가 없으면 쌍별 세 수만으로 고유 수를 확정하지 못합니다.
U=(A∩B)∪(A∩C)∪(B∩C)∣U∣=136−2⋅5=126
Pair counts sum to 136, but every triple pattern is counted three times. Subtract two extra counts for each, giving 136−2×5=126. Pair counts alone do not determine the distinct total without the triple size.
U=(A∩B)∪(A∩C)∪(B∩C)∣U∣=136−2⋅5=126
50. 패턴 그룹 수와 비율Count whole input-pattern groups
실제 1,359개 입력 패턴에 훈련 3/5·검증 1/5의 바닥값과 시험 나머지 규칙을 적용합니다. 역할별 패턴 수를 구하세요.
Apply floored training fraction 3/5 and validation 1/5 to 1,359 actual input patterns, with remainder test. Find pattern counts.
풀이와 확인할 이유Solution and explanation
훈련 ⌊1359×3/5⌋=815, 검증 ⌊1359/5⌋=271, 시험 1359−815−271=273입니다. 각 패턴의 행 수가 달라 행 수 952·321·326과 일치할 필요는 없습니다.
Counts are floor(1359×3/5)=815, floor(1359/5)=271 and 273. Unequal pattern sizes explain why these differ from row counts 952, 321, 326.
51. 행 평균의 가중 합 유도Derive pooled row-loss weighting
서로 겹치지 않는 K개 검증 fold가 전체 n>0행을 덮고 각 n_k≥1입니다. 유한한 행 손실 ℓ_i의 fold 평균 L_k=(1/n_k)Σ_{i∈V_k}ℓ_i를 정의할 때 가중 평균 Σ(n_k/n)L_k가 전체 행 평균임을 보이세요.
K disjoint validation folds cover n>0 rows, with n_k≥1 and finite row losses defining mean L_k=(1/n_k)Σ_{i∈V_k}ℓ_i. Prove that Σ(n_k/n)L_k equals the full row average.
풀이와 확인할 이유Solution and explanation
각 n_k가 약분되고 각 원행이 한 번씩 나타납니다. 아래 계산은 손실 값이 유한하다는 범위의 항등식이며 독립성 가정이 필요하지 않습니다.
k∑nnkLk=n1k∑i∈Vk∑ℓi=n1i∈I∑ℓi
The n_k factors cancel, and every source row occurs exactly once. This finite arithmetic identity does not require independence.
k∑nnkLk=n1k∑i∈Vk∑ℓi=n1i∈I∑ℓi
52. 두 평균이 같은 조건When do two averaging conventions agree?
두 비어 있지 않은 fold의 크기는 n₁, n₂이고 유한한 평균은 L₁, L₂입니다. 행 가중 평균과 단순 평균의 차이를 식으로 구하고 언제 0인지 설명하세요.
Two nonempty folds have sizes n₁, n₂ and finite means L₁, L₂. Derive weighted-row mean minus the unweighted fold mean, and characterize zero difference.
풀이와 확인할 이유Solution and explanation
n=n₁+n₂라 두고 공통 분모로 정리하면 차이는 (n₁−n₂)(L₁−L₂)/(2n)입니다. 크기가 같거나 평균이 같으면 0입니다. 차이가 0일 필요충분조건은 n₁=n₂ 또는 L₁=L₂입니다.
53. 독립 시험의 조건부 기대Conditional expectation of independent test loss
선택·적합 정보 A가 함수 f_A를 정합니다. 시험 Z₁, …, Z_m은 m≥1개이며 A와 독립인 목표 법칙 P의 iid 관측이고 손실은 조건부 적분 가능합니다. R(f_A)=∫ℓ(f_A, z)dP(z)라 할 때 시험 평균의 조건부 기대를 구하세요.
Information A determines f_A. Test observations Z₁, …, Z_m, m≥1, are iid from target P and independent of A, with conditionally integrable loss. Define R(f_A)=∫ℓ(f_A, z)dP(z). Find the conditional expectation of test-average loss.
풀이와 확인할 이유Solution and explanation
A가 주어지면 f_A가 고정되고 각 시험 항의 조건부 기대가 R(f_A)입니다. 선형성으로 평균도 같은 기대를 가집니다. 실현한 평균이 위험과 반드시 같다는 뜻은 아닙니다.
RE=m1i∑ℓ(fA,Zi)E[RE∣A]=R(fA)
Given A, the predictor is fixed and each test term has conditional expectation R(f_A). Linearity gives the same expectation for their average, rather than equality for every realized score.
RE=m1i∑ℓ(fA,Zi)E[RE∣A]=R(fA)
54. 분할 함수의 완전성과 겹침 없음Prove completeness of a role function
유한 원키 집합 I의 각 원키에 함수 r:I→{T, V, E}가 정확히 한 값을 부여합니다. 역상 집합 T, V, E가 전체를 덮고 서로 겹치지 않음을 보이세요.
A function r:I→{T, V, E} assigns exactly one role to every key of finite I. Prove that the three inverse-image sets cover I and are disjoint.
풀이와 확인할 이유Solution and explanation
각 i는 함수값 하나를 가져 적어도 한 역할에 속하므로 합집합이 I입니다. 서로 다른 역할 두 개에 속하면 r(i)가 두 값을 가져 함수라는 정의와 모순입니다. 키가 빠진 부분 함수라면 이 증명의 첫 단계가 실패합니다.
Every key has one function value, so the union covers I. Membership in two distinct roles would require two values of r(i), contradicting its being a function. A partially defined assignment would not justify the first step.
55. 최소값의 기본 낙관 부등식Prove a basic selected-minimum inequality
M≥1개 적분 가능한 손실 L₁, …, L_M과 그 최소가 적분 가능하다고 가정합니다. E[min_j L_j]≤min_j E[L_j]를 보이세요. 독립성이 필요한가요?
M≥1 losses and their minimum are integrable. Prove E[min_j L_j]≤min_j E[L_j]. Is independence required?
풀이와 확인할 이유Solution and explanation
각 고정 j에 대해 최소≤L_j이므로 기대의 단조성으로 E[최소]≤E[L_j]입니다. 모든 j의 최소를 취하면 결론입니다. 이 부등식에는 독립성이 필요 없습니다.
For every fixed j, the minimum is at most L_j. Monotonicity of expectation gives the bound for each j, and taking the smallest right-hand side proves the claim. Independence is unnecessary.
56. 균등 오차 안에서 선택의 손실Bound selection error under uniform score accuracy
유한한 M≥1개 후보의 실제 위험 R_j와 추정 점수 R̂_j가 모두 유한합니다. ε≥0이고 모든 j에서 |R̂_j−R_j|≤ε라고 가정합니다. R̂ 최소 후보 ĵ와 R 최소 후보 j*에 대해 R_ĵ≤R_j*+2ε를 보이세요.
M≥1 candidates have finite risks R_j and estimated scores R̂_j. Assume ε≥0 and |R̂_j−R_j|≤ε for every j. Let ĵ minimize scores and j* minimize risks. Prove R_ĵ≤R_j*+2ε.
풀이와 확인할 이유Solution and explanation
실제 위험을 추정 점수로 한 번, 최소 선택으로 한 번, 다시 실제 위험으로 한 번 비교합니다. 동률의 어느 최소를 골라도 성립합니다.
57. 유한 후보의 실패 확률 합Bound simultaneous score failure
M≥1개 후보마다 점수 오차가 ε를 넘는 사건 A_j의 확률이 δ_j 이하라고 가정합니다. 하나라도 넘을 확률의 상계를 구하세요. 사건 독립성이 필요한가요?
For M≥1 candidates, event A_j means score error exceeds ε and satisfies P(A_j)≤δ_j. Bound the probability that any candidate exceeds ε. Is independence required?
풀이와 확인할 이유Solution and explanation
합집합 상계로 P(∪A_j)≤ΣP(A_j)≤Σδ_j이며 확률 상계는 1과의 최소로 자를 수 있습니다. 독립성이 필요 없습니다. 따라서 적어도 1−min(1, Σδ_j) 확률로 모든 후보의 오차가 동시에 ε 이하입니다.
P(j⋃Aj)≤min(1,j∑δj)
The union bound gives P(∪A_j)≤Σδ_j, clipped at one. Independence is unnecessary. All errors are simultaneously at most ε with probability at least 1−min(1, Σδ_j).
P(j⋃Aj)≤min(1,j∑δj)
58. 목표가 다른 두 평균Different new-unit questions give different averages
한 그룹에서 새 행을 예측하는 것과 처음 보는 그룹을 예측하는 것이 다를 수 있습니다. A그룹 100행·B그룹 1행의 시험 평균을 모든 그룹의 동일 가중 성능이라 부를 수 있는지 설명하세요.
A test has one hundred rows from group A and one from group B. Can its ordinary row average be called equally weighted performance across groups?
풀이와 확인할 이유Solution and explanation
행 평균은 A에 100/101의 무게를 줍니다. 두 그룹 동일 가중 성능은 각 1/2의 무게를 주는 별도 평균입니다. 목표 단위를 먼저 정해야 하며 행 수만으로 두 목표가 같아지지 않습니다.
The row average gives A weight 100/101. Equal-group performance gives each group weight one half. Define the new-unit question before choosing an averaging convention.
59. 새 프로세스 기록의 읽기Read actual process records
고정 Python/R 프로그램 30개를 실제 실행했고 두 개는 빈 그룹 키에 대한 예상 오류였습니다. 생성된 SVG는 28개입니다. 오류 두 개를 계산 실패로 숨기지 않고 어떻게 보고해야 하나요?
Thirty fixed Python/R programs were actually run; two intentionally reject missing group keys. Twenty-eight SVGs were created. How should the two errors be reported?
풀이와 확인할 이유Solution and explanation
각 코드·입력 해시·종료 코드·출력·오류와 “예상 거절” 상태를 보존합니다. 성공 28개와 예상 거절 2개를 구별합니다. 그림 파일이 없는 예상 오류를 가짜 0점 결과로 만들지 않습니다.
Preserve code/input hashes, return codes, output/error text and expected-rejection flags. Distinguish twenty-eight successes from two intended rejections rather than fabricating zero-score outputs.
60. 수치·그림·주장의 층을 함께 감사Audit numbers, artifacts and claims together
실제 원행의 역할 수를 JS가 즉시 계산하고, 고정 예제의 Python/R 출력과 SVG는 보관 파일에서 읽습니다. 같은 화면에 있을 때 독자가 혼동하지 않도록 어떤 세 가지를 명시해야 하나요?
A browser recalculates source-row roles in JavaScript while fixed Python/R output and SVGs are loaded from archives. Name three distinctions the display should make clear.
풀이와 확인할 이유Solution and explanation
현재 조절기에 반응한 라이브 JS 결과, 어떤 고정 코드·입력으로 실제 실행한 보관 기록인지, 그리고 그 결과로 말할 수 있는 평가 대상·시점을 각각 밝힙니다. 실행 사실은 독립 표집이나 미래 성능 보증과 같지 않습니다.
Identify the live JS result responding to current controls, the exact fixed code/inputs behind archived process records, and the unit/time scope of the evaluation claim. Actual execution alone does not establish independent sampling or future performance.
자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.