AI-23 · ARTIFICIAL INTELLIGENCE

실제 리뷰의 텍스트 분류·출처 검증Real-review classification and provenance validation

실제 리뷰 원문에서 단어·가능도·검증 선택·오류 분석·출처 확인과 독립 재현까지 연결한다.Connect actual native reviews to words,likelihood,validation choice,error analysis,provenance and independent replication.

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

학부Undergraduate

리뷰 문장을 계산 문제로 바꾸기Turn a review sentence into a computational question

“이 영화가 마음에 들었다”와 “다시는 보고 싶지 않다”를 읽으면 사람은 대략 다른 평가라고 느낍니다. 컴퓨터에는 문장과 함께 우리가 맞히려는 이름표를 정해야 합니다. 이 장의 목표는 사람의 속마음을 알아내는 것이 아니라, 공개 자료에 붙어 있는 긍정·부정 이름표를 제한된 단어 세기 모형으로 예측하고 그 결과의 출처와 한계를 설명하는 것입니다.

입력은 원문 문자열 X, 목표는 자료 제공자가 붙인 이진 라벨 Y∈{0,1}입니다. 이 자료에서는 1이 긍정, 0이 부정입니다. 숫자 1은 호감의 크기나 별점 1점을 뜻하지 않습니다. 영화·상품·식당에서 같은 숫자를 써도 대상과 작성 상황은 다르므로, 세 자료를 처음부터 같은 모집단이라고 가정하지 않습니다.

X=observed sentence,Y∈{0,1},f(X)∈{0,1}X=\text{observed sentence},\qquad Y\in\{0,1\},\qquad f(X)\in\{0,1\}

문장 안에 “좋다”가 있어도 “좋다고 할 수 없다”는 반대 뜻일 수 있습니다. 우리가 만들 단어 주머니 모형은 어순과 문맥의 상당 부분을 버립니다. 그 약점을 먼저 알고 시작하면 단순한 계산도 좋은 비교 기준이 됩니다. 작은 모형을 쓸모없다고 버리거나, 몇 개를 맞혔다고 언어를 이해한다고 부르는 양쪽 성급함을 피하고 실제 오답을 읽습니다.

A person can often distinguish “I enjoyed this movie” from “I never want to see it again.” A computer needs an explicit target. Our task is to predict the supplied positive/negative labels in a public corpus using a limited word-count model, then explain the evidence and its provenance. It is not a claim to read the writer’s mind.

The input X is an observed sentence and Y is its provider-supplied binary label: one for positive and zero for negative. One is a category, not a sentiment magnitude or a one-star rating. Movie, product and restaurant sentences refer to different objects and settings; sharing a binary encoding does not make their populations identical.

X=observed sentence,Y∈{0,1},f(X)∈{0,1}X=\text{observed sentence},\qquad Y\in\{0,1\},\qquad f(X)\in\{0,1\}

A word such as “good” can occur in “not good.” Our bag-of-words model discards much of order and context. Knowing that limitation makes a simple model a useful baseline. Read actual mistakes instead of either dismissing a small model or calling a few correct classifications language understanding.

학부Undergraduate

새로 내려받은 자료와 새로 관측한 자료A fresh download is not a fresh observation

이 장은 UCI의 Sentiment Labelled Sentences 공식 압축파일을 보존하여 사용합니다. 2015년에 공개된 자료를 2026년 11월 4일 다시 내려받았습니다. 따라서 다운로드 시각은 확보 이력이고, 문장들이 그날 새로 작성됐다는 뜻이 아닙니다. 자료의 공개 연도·관측 시점·다운로드 시점을 구분해서 기록해야 과거 리뷰로 현재 소비자 의견을 측정했다는 오해를 막을 수 있습니다.

보존한 세 원문 파일
원 파일문장 수라벨 0라벨 1맥락
amazon_cells_labelled.txt1000500500상품
imdb_labelled.txt1000500500영화
yelp_labelled.txt1000500500식당

각 파일의 500:500 구성은 자료 제작자가 선택한 균형 표본입니다. 중립 문장을 포함한 모든 실제 이용자 의견의 분포가 아닙니다. 이 비율로 학습한 사전확률 1/2을 “현실에서 절반이 만족한다”로 해석하면 표본 설계를 놓칩니다. 라벨이 명료한 문장 중심으로 구성된 자료라는 점도 함께 남깁니다.

원 압축파일의 SHA-256은 afc26626d710899948693e1a61405dce197f57ffa719fa1130d346b4cc095343입니다. 해시는 현재 보존한 바이트가 같은지 확인하는 지문입니다. 내용이 참이라는 인증서가 아니며, 암호화나 익명성 보장도 아닙니다. 원 README·출처·라이선스와 함께 보관해야 숫자 지문 이상의 설명이 됩니다.

We retain the official UCI Sentiment Labelled Sentences archive. It was published in 2015 and downloaded again on 4 November 2026. Retrieval time records acquisition, not when the opinions were written. Distinguish release, observation and retrieval dates before interpreting historical reviews as current consumer opinion.

Three retained native files
Native fileSentencesLabel 0Label 1Context
amazon_cells_labelled.txt1000500500Products
imdb_labelled.txt1000500500Movies
yelp_labelled.txt1000500500Restaurants

The provider selected a balanced 500:500 sample in each file. This is not the distribution of all reviews, including neutral sentences. A fitted class prior of one half does not establish that half of present-day customers are satisfied. The selection of clearly polar sentences is part of the data design.

The retained archive has SHA-256 afc26626d710899948693e1a61405dce197f57ffa719fa1130d346b4cc095343. A hash identifies retained bytes; it does not certify truth, encrypt the content or guarantee anonymity. Keep its README, attribution and license alongside that fingerprint.

학부Undergraduate

원문 한 행·라벨·식별자를 구분하기Separate a native line, its label and its identity

원문 파일의 한 관측은 문장 뒤에 탭을 두고 마지막에 0 또는 1을 적은 한 행입니다. 문장 안에 따옴표가 있다고 CSV의 인용 규칙으로 다시 합치지 않습니다. 원 LF 바이트를 기준으로 행을 나누고 행 끝의 CR만 제거한 뒤 마지막 탭에서 문장과 라벨을 나눕니다. 문장 안의 유니코드 줄 구분 기호를 새 관측으로 잘라서는 안 됩니다.

실제 IMDb 파일에는 내부 유니코드 구분 문자가 있어 일반적인 “모든 줄 구분 기호로 분할” 함수가 1,002조각을 만들 수 있습니다. 원 LF 경계로 읽으면 올바른 관측 수는 1,000입니다. 이 차이는 지저분한 자료를 임의로 삭제한 문제가 아니라 파일 형식의 경계를 정확히 따른 문제입니다. 원문과 라벨이 일대일로 유지되는지 먼저 확인합니다.

이 장의 문장 ID는 원 파일명과 1부터 시작하는 원 행 번호를 연결합니다. 예를 들어 imdb_labelled.txt:17은 해당 파일의 17번째 관측을 찾는 주소입니다. 17번째 사람·17번째 영화·독립된 17번째 전체 리뷰를 뜻하지 않습니다. 원 자료에는 작성자 ID와 부모 리뷰 문서 ID가 제공되지 않아 서로 다른 문장의 사람·문서 독립성을 증명할 수 없습니다.

연습할 때 문장만 복사하지 말고 원 파일·행 주소·라벨·분할 역할을 같이 적으세요. 예측이 틀리면 같은 문장을 다시 찾아 전처리와 이름표를 확인할 수 있습니다. 반대로 원 행 번호를 모형의 단어 입력에 몰래 넣으면 자료의 정렬이나 선택 절차를 외우는 지름길이 될 수 있으므로 주소는 설명용 메타데이터로 분리합니다.

A native observation is a sentence followed by a tab and a final zero/one label. Quotation marks inside a sentence do not turn this text format into quoted CSV. Split native LF bytes, remove only a terminal CR, then split at the last tab. Internal Unicode separator characters are not additional observations.

The IMDb member contains internal Unicode separators: a generic split-on-every-line-separator function can produce 1, 002 pieces. Native LF boundaries give the intended 1, 000 observations. Preserving the file format is different from arbitrarily dropping inconvenient rows. Check the sentence-to-label pairing first.

Our sentence ID combines the source filename with its one-based native row. imdb_labelled.txt:17 addresses the seventeenth observation, not the seventeenth person, movie or independent complete review. The source supplies neither author IDs nor parent-review document IDs, so distinct sentence addresses do not establish author or document independence.

Retain the source address, label and split role beside each sentence. You can then revisit a mistake and inspect the same original text. Keep that address as provenance metadata, rather than quietly feeding row numbers into the predictor and learning source ordering instead of review language.

학부Undergraduate

글자·바이트·단어의 서로 다른 좌표Characters, bytes and words have different coordinates

컴퓨터에서 “길이”는 무엇을 세는지에 따라 달라집니다. UTF-8 파일의 바이트 수, 유니코드 코드포인트 수, 브라우저 문자열의 UTF-16 코드단위 수, 추출한 단어 수는 같은 값이 아닐 수 있습니다. 이 장의 단어 위치는 원문에 대응하는 0기준 코드포인트 반열린 구간 [시작,끝)으로 적습니다. 끝 위치의 글자는 포함하지 않습니다.

예시 A🍎B café can't 10/10.에서 사과 이모지는 한 코드포인트입니다. A의 구간은 [0,1), B는 [2,3), ASCII 규칙이 추출하는 caf는 [4,7), can’t가 아니라 ASCII 아포스트로피를 쓴 can't는 [9,14)입니다. 숫자 10/10은 단어 목록에서 빠집니다. 읽는 사람에게는 중요한 점수라도 이 표현에는 남지 않습니다.

우리는 A부터 Z만 소문자로 바꿉니다. 전체 유니코드의 대소문자 변환이나 악센트 제거를 한 것으로 부르지 않습니다. café의 é는 영어 ASCII 단어 규칙에 없어서 caf까지만 남고, 한국어 문장은 대부분 빈 단어 목록이 됩니다. 이는 영어 중심 교육용 토큰화의 명백한 한계이며 다국어 서비스를 그대로 구현해도 된다는 뜻이 아닙니다.

실습 A에서 이모지·악센트·아포스트로피·숫자를 하나씩 바꾸고 원문 위치와 단어 목록을 비교하세요. 먼저 어떤 부분이 사라질지 예상하고 결과를 읽습니다. “원문이 그대로 보관된다”와 “모형이 원문의 모든 정보를 사용한다”가 전혀 다른 말이라는 점을 확인하는 실험입니다.

Length can mean UTF-8 bytes, Unicode code points, browser UTF-16 code units or extracted words. These counts need not agree. Word positions here are zero-based code-point half-open intervals [start, end) corresponding to the original text; the character at the end is excluded.

In A🍎B café can't 10/10., the apple is one code point. A occupies [0, 1), B [2, 3), the ASCII extraction caf [4, 7), and can't [9, 14). The numerical rating 10/10 contributes no word. Information important to a reader can disappear from this representation.

We lowercase A through Z only. This is neither full Unicode case folding nor accent removal. The é in café ends the ASCII word after caf; Korean text largely produces no retained words. That is a limitation of this English-oriented teaching tokenizer, not a deployment recommendation for multilingual services.

In lab A, change one emoji, accent, apostrophe or digit at a time and compare the original spans with extracted words. Predict the lost information before running the example. Preserving the original text does not mean the model uses everything in it.

학부Undergraduate

같은 문장과 같은 단어 표현은 다르다Identical text differs from an identical word representation

원문이 완전히 같은 두 행은 바이트나 문자열 비교로 찾을 수 있습니다. GOOD film과 good film은 원문이 다르지만 ASCII 대소문자와 연속 공백을 정리하면 같은 문장 키가 됩니다. 여기서 정규화 규칙을 명시해야 악센트·이모지·숫자까지 임의로 지운 것을 “중복 제거”라고 부르지 않게 됩니다.

반면 rating 1과 rating 5는 정규화 문장 키가 다릅니다. 숫자를 버리는 단어 표현에서는 둘 다 rating이 되어 충돌합니다. 실제 의미가 다르더라도 모형 입력이 같아졌으니 어떤 분류기도 그 입력만으로 둘을 구분하지 못합니다. 이런 표현 충돌을 원문 복제나 라벨 오류로 단정하지 않습니다.

훈련 문장과 시험 문장의 정규화 키가 같다면 새 문장을 맞힌 평가인지 다시 검토해야 합니다. 그러나 작성자 ID가 없을 때 중복 몇 개를 지웠다고 모든 사람·문서가 독립적이라고 증명되지는 않습니다. 중복 탐지는 특정 위험을 찾는 도구이지 모든 평가 타당성을 보증하는 도장이 아닙니다.

실제 작은 표본은 원 파일 안에서 먼저 나온 정규화 문장을 남긴 뒤 미리 정한 순서 규칙으로 뽑습니다. 모든 원 3,000행과 중복 장부는 보존합니다. 시험 라벨이 마음에 들지 않는다는 이유로 훈련 행을 지우거나 바꾸지 않으며, Amazon과 Yelp 사이의 겹침 제한은 입력 문장 키만 비교합니다.

Exact raw duplicates can be found by comparing the original strings. GOOD film and good film differ in raw text but share an explicitly ASCII-case/space-normalized key. State the rule so that removing accents, emoji or numbers is not quietly called duplicate removal.

By contrast, rating 1 and rating 5 have different canonical text keys. The word representation drops their digits and maps both to rating. No classifier using only that representation can distinguish them. A representation collision is not automatically copied text or a label error.

A canonical key appearing in both training and test data deserves a leakage check. Removing such duplicates still cannot establish independent writers or source reviews when those IDs are unavailable. Duplicate detection locates particular risks; it does not certify the entire evaluation design.

Our small frames retain the first canonical text within each original file before applying a prespecified selection rule. All 3, 000 original lines and the duplicate ledger remain available. Test labels do not delete or change training rows; the Amazon-to-Yelp overlap restriction compares input text keys only.

학부Undergraduate

훈련·검증·시험의 서로 다른 질문Training, validation and test ask different questions

훈련 자료는 단어 목록·라벨별 단어 수·사전확률을 정하는 재료입니다. 검증 자료는 미리 적은 후보 중 어느 평활 강도를 쓸지 고릅니다. 시험 자료는 그 선택을 끝낸 규칙을 한 번 평가하는 자료입니다. 시험 문장에 자주 나오는 단어를 보고 단어 목록에 추가한 뒤 같은 시험 결과를 “처음 본 문장” 성능이라고 쓰면 입력 정보를 미리 본 셈입니다.

이 장은 단어 빈도수와 문서 빈도를 구분하고, 훈련 문서 빈도 내림차순·동률이면 ASCII 사전순으로 최대 32개 단어를 고릅니다. 검증·시험의 원문 길이나 단어를 단어 선정에 쓰지 않습니다. 각 분할의 결과와 다수 클래스 기준을 함께 제시해서, 맞힌 수가 많아도 모두 한쪽으로만 예측한 것은 아닌지 확인합니다.

실제 IMDb 사례는 64훈련·16검증·16시험 문장입니다. Amazon→Yelp 사례는 Amazon 64훈련·32검증 후 Yelp 64시험으로 대상 영역을 바꿉니다. 국가 사례의 100·36·40행은 시간 순서대로 나눕니다. 이 세 가지는 동일한 평가 설계가 아닙니다. 무작위 사람 실험이나 실시간 배포를 수행했다는 이름을 붙이지 않습니다.

학습 일지를 한 장 만들어 원본 해시, 문장 주소, 역할, 단어 선정 규칙, 후보 α, 선택 기준, 최종 시험 분모를 적어 보세요. 뒤에서 정확한 분수를 계산하더라도 이 설계가 빠지면 무엇을 평가했는지 알 수 없습니다. 수학의 정확성과 평가 질문의 적절성은 서로 필요한 두 조건입니다.

Training determines the vocabulary, class counts and priors. Validation chooses among declared smoothing candidates. Test data evaluate the selected rule. Adding words after inspecting test sentences and reporting performance on those same sentences uses test-input information before the evaluation.

We distinguish token counts from document frequency. At most 32 words are selected by training document frequency, with ASCII lexical ties. Validation/test words and lengths do not choose the vocabulary. Report every split alongside a training-majority baseline to reveal a rule that predicts only one class.

The observed IMDb core has 64 training, 16 validation and 16 test sentences. The Amazon-to-Yelp design uses 64 Amazon training and 32 Amazon validation sentences before testing on 64 Yelp sentences. The country core splits 100/36/40 rows chronologically. These are different designs, not randomized person-level experiments or real-time deployments.

Write a study log with the original hash, sentence addresses, roles, vocabulary rule, alpha candidates, selection criterion and final test denominator. Exact fractions do not repair an unspecified evaluation question. Arithmetic precision and a suitable design are separate requirements.

학부Undergraduate

단어 주머니와 횟수 벡터A bag of words and its count vector

책상 위에 밝다·영화·밝다라는 카드 세 장이 있다고 생각하세요. 카드를 순서 없이 세면 밝다2개·영화1개입니다. 단어 주머니 표현도 이처럼 정해진 단어 목록의 각 단어가 몇 번 등장하는지 셉니다. 단어 목록이 [bright,film,dull]이면 bright film bright는 (2,1,0)입니다. 길이가 다른 문장도 같은 길이의 숫자 벡터로 바꿀 수 있습니다.

ϕ(x)=(n1(x),…,nV(x)),nj(x)=count of vocabulary word j\phi(x)=(n_1(x),\ldots,n_V(x)),\qquad n_j(x)=\text{count of vocabulary word }j

순서를 버린다는 것은 대가가 있습니다. dog bites person과 person bites dog는 같은 단어 횟수입니다. 같은 벡터에는 같은 예측이 나오므로 이 모형으로 두 사건의 주체를 구별할 수 없습니다. 이 한계는 가중치를 조금 조절하면 해결되는 문제가 아니라 입력 표현에서 이미 잃은 정보입니다.

빈도 벡터를 만드는 규칙은 훈련과 시험에서 같아야 합니다. 훈련에서는 소문자로 바꾸고 시험에서는 대문자를 남기면 같은 단어를 다른 것으로 처리할 수 있습니다. 먼저 원문→ASCII소문자→단어 추출→고정 목록의 횟수라는 네 단계를 각기 출력해 어디서 정보가 빠졌는지 확인하세요.

Imagine three word cards: bright, film, bright. Counting without order gives two bright cards and one film card. A bag-of-words representation counts occurrences from a fixed vocabulary. With [bright, film, dull], bright film bright becomes (2, 1, 0). Sentences of different lengths now share a vector dimension.

ϕ(x)=(n1(x),…,nV(x)),nj(x)=count of vocabulary word j\phi(x)=(n_1(x),\ldots,n_V(x)),\qquad n_j(x)=\text{count of vocabulary word }j

Discarding order has a cost. dog bites person and person bites dog have the same counts. The model must predict identically, so it cannot distinguish their agents. Adjusting weights does not recover information already lost by the representation.

Apply the same representation during training and evaluation. Lowercasing only the training text can turn the same word into two apparent types. Inspect the four stages separately: raw text, ASCII folding, extraction, then counts over a fixed vocabulary.

학부Undergraduate

문서 빈도와 단어 횟수를 따로 세기Count document frequency separately from occurrences

단어가 한 문장에 열 번 나온 것과 열 문장에 한 번씩 나온 것은 다릅니다. 단어 횟수는 모든 출현을 더하지만 문서 빈도 DF는 해당 단어가 한 번이라도 있는 문장을 셉니다. 이 장은 문서 빈도로 작은 단어 목록을 고르고, 선택된 단어의 실제 횟수로 라벨별 모형을 맞춥니다. 선정 기준과 확률 계산의 분모를 섞지 마세요.

직접 추적할 네 훈련 문장
ID원문라벨
p1bright film bright1
p2warm film1
n1dull film0
n2cold film dull0

film은 네 문장에 있고 총4번 나옵니다. bright는 한 문장에 있지만 총2번, dull은 두 문장에 총2번 나옵니다. 따라서 DF내림차순 목록의 앞은 film, dull입니다. 나머지 DF1 단어는 ASCII사전순 bright,cold,warm으로 정합니다. 목록 순서를 고정하면 서로 다른 코드에서도 같은 좌표의 의미를 맞출 수 있습니다.

실습 B에서 p1의 bright를 더 반복해 보세요. DF는 그대로1이지만 라벨1의 단어 횟수는 늘어납니다. 다음에는 같은 단어가 있는 새 훈련 문장을 추가해 두 수가 모두 바뀌는지 관찰합니다. 검증·시험 행으로 역할을 바꾼 문장을 훈련 전용 함수에 넣으면 거절되는 것도 확인하세요.

Ten repetitions within one sentence differ from one occurrence in each of ten sentences. Token count sums occurrences; document frequency DF counts sentences containing the word at least once. We choose the compact vocabulary by DF, then fit class-specific probabilities using occurrence counts. Keep selection criteria distinct from probability denominators.

Four traceable training sentences
IDRaw textLabel
p1bright film bright1
p2warm film1
n1dull film0
n2cold film dull0

Film occurs in four documents and four positions. Bright occurs twice in one document; dull occurs twice across two documents. The descending-DF vocabulary therefore starts film, dull. The DF-one words follow ASCII order: bright, cold, warm. A fixed ordering preserves coordinate meaning across implementations.

In lab B, repeat bright within p1: DF remains one while class-one token count increases. Then add a new training sentence containing bright and observe both counts. A validation/test-role row supplied to the training-only endpoint must be rejected.

학부Undergraduate

라벨별 사전확률과 조건부 단어 확률Class priors and conditional word probabilities

상자 두 개를 라벨0과 라벨1이라고 합시다. 먼저 어느 상자의 문장을 볼지 고를 확률을 사전확률 π라고 부릅니다. 이 장에서는 각 라벨의 훈련 문장 수를 전체 훈련 문장 수로 나눕니다. 양쪽2문장씩이면 π0=π1=1/2입니다. 이 비율은 훈련 표의 구성에 대한 추정이지 현재 모든 사람의 감정 비율이 아닙니다.

π^c=NcN0+N1,Tcj=∑i:Yi=cnj(Xi),Tc=∑j=1VTcj\widehat\pi_c=\frac{N_c}{N_0+N_1},\qquad T_{cj}=\sum_{i:Y_i=c}n_j(X_i),\qquad T_c=\sum_{j=1}^{V}T_{cj}

라벨1 상자에는 bright2,film2,warm1이 있고 총5개 토큰입니다. 라벨0에는 dull2,film2,cold1이 있어 역시5개입니다. 문장 수는 각2이지만 단어 확률의 분모는 각5입니다. 문장 하나를 두 번 읽는 것과 한 문장 안 단어가 두 번 나오는 것은 모형의 다른 부분을 바꿉니다.

조건부 단어 확률 θcj는 라벨c가 주어졌을 때 고정된 목록 안에서 단어j가 나오는 확률입니다. 실제 언어에서 단어들은 독립적으로 섞이지 않지만, 단순한 조건부 독립 모형을 비교 기준으로 선언합니다. 문장 라벨을 안다고 모든 단어의 관계가 사라진다는 사실을 자료로 증명한 것은 아닙니다.

Think of two boxes labeled zero and one. A class prior π specifies which box supplies a document. We estimate it by the class document count divided by the total training document count. Two documents per class give equal priors of one half. This reflects the training frame, not the sentiments of all current people.

π^c=NcN0+N1,Tcj=∑i:Yi=cnj(Xi),Tc=∑j=1VTcj\widehat\pi_c=\frac{N_c}{N_0+N_1},\qquad T_{cj}=\sum_{i:Y_i=c}n_j(X_i),\qquad T_c=\sum_{j=1}^{V}T_{cj}

The positive box contains bright twice, film twice and warm once: five tokens. The negative box contains dull twice, film twice and cold once, also five tokens. Document count is two per class, whereas the word-probability denominator is five. Repeating a document and repeating a word affect different model components.

A conditional word probability θcj describes word j within the fixed vocabulary given class c. Real words are not independent draws; conditional independence is our simplifying baseline assumption. Merely knowing a document’s class does not empirically establish independence among its words.

학부Undergraduate

0확률을 막는 평활과 그 대가Smoothing prevents zeros, with a trade-off

라벨0훈련 문장에 bright가 없다고 그 라벨에서 bright가 절대 나올 수 없다고 결론 내릴 수는 없습니다. 원 횟수만 나누면0확률이 되어 그 단어 하나로 전체 문장 가능도가0이 됩니다. 양의 α를 모든 선택 단어 횟수에 더하면 보지 못한 단어에도 작은 확률을 줍니다. 자료가 생긴 것은 아니며 모형에 의도적인 보정을 넣은 것입니다.

θ^cj=Tcj+αTc+αV,α>0\widehat\theta_{cj}=\frac{T_{cj}+\alpha}{T_c+\alpha V},\qquad \alpha>0

네 문장 예시의 단어 목록은5개입니다. α=1이면 각 라벨의 분모는5+1×5=10입니다. bright는 라벨1에서(2+1)/10=3/10, 라벨0에서(0+1)/10=1/10입니다. film은 양쪽 모두3/10이므로 이 예의 라벨 구분 증거를 주지 않습니다. 각 라벨의 다섯 단어 확률은 합이1인지 직접 더해 보세요.

α를 아주 크게 하면 단어 확률은 각1/V에 가까워져 라벨별 차이가 약해집니다. α를 아주 작게 하면 드문 단어의 영향이 커질 수 있습니다. 어느 값이 가장 좋은지는 훈련표만 보고 자동 결정되지 않습니다. 검증 기준을 먼저 정하고 후보를 비교하되, 작은 검증표의 우연과 자료 영역 이동까지 설명합니다.

A missing training occurrence does not prove that bright is impossible under class zero. Unsmooth counts would assign zero probability and let that one word zero out the whole sequence likelihood. Adding positive alpha to every selected word gives unseen class-word combinations positive mass. It is an explicit model adjustment, not a new observation.

θ^cj=Tcj+αTc+αV,α>0\widehat\theta_{cj}=\frac{T_{cj}+\alpha}{T_c+\alpha V},\qquad \alpha>0

Our four-document example has five vocabulary words. With alpha one, each class denominator is 5+1×5=10. Bright has probability 3/10 in class one and 1/10 in class zero. Film has 3/10 in both, giving no class evidence in this example. Add the five probabilities within each class to verify that they sum to one.

Very large alpha pushes probabilities toward 1/V and weakens class differences. Very small alpha can amplify rare-word evidence. Training counts alone do not determine the best value. Declare a validation criterion before comparing candidates, then discuss small-sample variation and domain shift.

학부Undergraduate

독립 가정 아래 문장 점수 만들기Build sequence scores under conditional independence

목록 안의 단어를 차례로 뽑는 모형을 생각해 봅시다. 알려진 토큰 수를 고정하고 라벨c가 주어지면 각 토큰의 확률을 곱합니다. 같은 단어가nj번이면 그 확률을nj제곱합니다. 여기에 사전확률을 곱한 값을 Jc라고 적습니다. 이것은 라벨과 선택된 단어열의 결합 점수이지 조건부 가능도만의 이름은 아닙니다.

Jc(x)=π^c∏j=1Vθ^cj nj(x),P(Y=1∣ϕ(x))=J1(x)J0(x)+J1(x)J_c(x)=\widehat\pi_c\prod_{j=1}^{V}\widehat\theta_{cj}^{\,n_j(x)},\qquad P(Y=1\mid\phi(x))=\frac{J_1(x)}{J_0(x)+J_1(x)}

bright 한 번에 대해 J1=(1/2)(3/10)=3/20, J0=(1/2)(1/10)=1/20입니다. 합1/5로 나누면 라벨1 사후확률은3/4입니다. bright가 두 번이면 J1=9/200,J0=1/200으로 사후확률9/10입니다. 같은 증거를 반복하면 모형 안의 확신이 커지지만 실제 독립된 증거가 두 개 생겼다는 뜻은 아닙니다.

단어 주머니의 순서를 무시한 정확한 횟수 사건에는 다항계수가 붙습니다. 여기서는 같은 관측 횟수 벡터에 대해 두 라벨에 동일한 계수이므로 사후확률의 분자·분모에서 약분됩니다. 또한 문장 길이가 라벨에 주는 증거를 따로 모형화하지 않고, 버린 OOV단어와 원문 전체의 생성 확률도 계산하지 않습니다. 제한된 표현에 대한 조건부 모형이라고 정확히 부릅니다.

Imagine drawing a sequence from the fixed vocabulary. Conditional on its retained length and class c, multiply its token probabilities; word j occurring nj times contributes the nj-th power. Multiplying by the prior gives Jc, a prior-times-sequence joint score, not the conditional likelihood alone.

Jc(x)=π^c∏j=1Vθ^cj nj(x),P(Y=1∣ϕ(x))=J1(x)J0(x)+J1(x)J_c(x)=\widehat\pi_c\prod_{j=1}^{V}\widehat\theta_{cj}^{\,n_j(x)},\qquad P(Y=1\mid\phi(x))=\frac{J_1(x)}{J_0(x)+J_1(x)}

For one bright token, J 1=3/20 and J 0=1/20. Dividing by their sum 1/5 gives posterior 3/4. Two bright tokens give J 1=9/200 and J 0=1/200, hence posterior 9/10. Repetition increases confidence inside the model; it does not establish two independent pieces of real-world evidence.

The probability of an unordered count vector includes a multinomial coefficient. For the same observed vector this coefficient is identical under both classes and cancels in the posterior. We also condition on retained length rather than modeling its class evidence, discard OOV evidence and do not compute a probability for the full original text. Name the restricted conditional model accurately.

학부Undergraduate

처음 본 단어·부정어·빈 표현Unseen words, negation and empty representations

선택한 단어 목록 밖의 단어를 OOV라고 합니다. 이 구현은 OOV를 별도 미지 단어 항목에 넣지 않고 증거에서 제외합니다. 따라서 mysterious만 있는 문장에서 두 라벨의 곱은 빈 곱1이고, Jc=πc이므로 사후확률은 사전확률로 돌아옵니다. 모든 단어가 낯설다고 무조건 부정이라고 해석하지 마세요. 동률일 때0을 택한 결정 규칙일 수 있습니다.

예시 목록에 not이 없으면 not bright와 bright는 같은 예측3/4를 냅니다. 이는 사람의 의미 해석과 반대일 수 있습니다. not을 목록에 넣어도 단어 주머니는 “not bad” 같은 결합을 그대로 이해하지 않습니다. 바이그램·문맥 표현·사전학습 모형을 비교할 수 있지만, 먼저 동일한 분할과 평가 기준을 유지해야 개선을 비교할 수 있습니다.

실습 C에서 훈련표와 α를 바꿔 클래스별 문장 수·단어 수·평활 확률을 읽습니다. 다음 실습 D에서 원문·알려진 단어·OOV·사후확률을 함께 비교합니다. 값이 달라졌다면 어떤 횟수나 단어 목록이 원인인지 설명해 보세요. 모형 출력에0.9가 보인다는 이유만으로 “실제로90%가 긍정”이라고 쓰지 않고 이 단어 모형 안의 값이라고 적습니다.

A word outside the chosen vocabulary is OOV. Our implementation drops it rather than assigning it to an unknown-word category. A sentence containing only mysterious leaves an empty product of one, so Jc equals the prior and the posterior returns to that prior. A class-zero decision can be the tie rule, not observed negative evidence.

If not is outside the vocabulary, not bright and bright receive the same posterior 3/4. Even adding not does not make a word bag understand combinations such as “not bad.” Bigrams or contextual models are useful comparisons, but maintain the same split and evaluation question before attributing improvements.

In lab C, change the training table and alpha, then read document counts, token counts and smoothed probabilities. In lab D, compare raw text, retained words, OOV words and posterior together. Explain each change through counts or vocabulary. A displayed 0.9 is a value inside this word model, not automatically a calibrated 90% real-world probability.

학부Undergraduate

곱을 로그의 합으로 읽기Read a product as a sum of logarithms

작은 확률을 여러 번 곱하면 매우 작은 수가 됩니다. 예를 들어1/10을100번 곱하면10의−100제곱입니다. 계산기가0처럼 보인다고 수학적으로0인 것은 아닙니다. 로그를 쓰면 곱을 합으로 바꾸어 크기를 비교하기 쉽습니다. 자연로그는 양수에서 증가하므로 같은 양수 점수의 대소관계가 유지됩니다.

ℓc=log⁡π^c+∑jnjlog⁡θ^cj,log⁡J1J0=log⁡π^1π^0+∑jnjlog⁡θ^1jθ^0j\ell_c=\log\widehat\pi_c+\sum_jn_j\log\widehat\theta_{cj},\qquad \log\frac{J_1}{J_0}=\log\frac{\widehat\pi_1}{\widehat\pi_0}+\sum_jn_j\log\frac{\widehat\theta_{1j}}{\widehat\theta_{0j}}

bright의 한 토큰 로그오즈 기여는 log3입니다. bright두 번이면2log3=log9이고 사전오즈가1이면 사후오즈9입니다. film은 양쪽 확률이 같아 log1=0입니다. 설명 표는 단어별 한 토큰의 로그비와 횟수를 따로 제시하므로, 긴 문장에서 같은 단어가 왜 큰 영향을 주는지 추적할 수 있습니다.

이 장의 정확 분류는 로그 근삿값의 반올림으로 결정하지 않고 유리수 J1과 J0를 비교합니다. 로그는 읽기 쉬운 설명과 수치 검산용 근사입니다. 특히 아주1에 가까운 비율은 빼기 때문에0으로 반올림될 수 있으므로 수학적 양·음·0 표지를 함께 둡니다. 근사 로그를 정확한 분수나 보증 오차구간이라고 부르지 않습니다.

Multiplying small probabilities can produce a tiny result: one tenth multiplied 100 times is 10 to the power−100. A displayed zero need not be mathematical zero. Logarithms turn products into sums, and their monotonicity preserves comparisons of positive exact scores.

ℓc=log⁡π^c+∑jnjlog⁡θ^cj,log⁡J1J0=log⁡π^1π^0+∑jnjlog⁡θ^1jθ^0j\ell_c=\log\widehat\pi_c+\sum_jn_j\log\widehat\theta_{cj},\qquad \log\frac{J_1}{J_0}=\log\frac{\widehat\pi_1}{\widehat\pi_0}+\sum_jn_j\log\frac{\widehat\theta_{1j}}{\widehat\theta_{0j}}

One bright contributes log 3 to log odds. Two contribute 2 log 3=log 9, giving odds nine when prior odds are one. Film contributes log 1=0. Explanation tables separate per-token log ratios from occurrence counts, making repeated evidence visible.

Our classification compares exact rational J 1 and J 0 rather than rounded log scores. Logs provide readable approximate explanations and checks. Ratios extremely close to one can display a log rounded to zero, so retain the exact mathematical sign separately. Approximate logs are neither exact fractions nor certified error intervals.

학부Undergraduate

사후확률·오즈·결정 규칙 연결Connect posterior, odds and the decision rule

확률p와 오즈p/(1−p)는 같은 양을 다른 눈금으로 표현합니다. p=3/4이면 오즈3, p=9/10이면 오즈9입니다. 오즈가1보다 큰 것은 p가1/2보다 큰 것과 동치입니다. 이 장은 J1>J0이면1, 같거나 작으면0을 예측합니다. 정확히1/2인 동률은0으로 정한 약속이지 부정이 더 사실이라는 결론이 아닙니다.

O=p1−p=J1J0,p=O1+O,y^=1{J1>J0}O=\frac{p}{1-p}=\frac{J_1}{J_0},\qquad p=\frac{O}{1+O},\qquad \widehat y=\mathbf1\{J_1>J_0\}

업무 비용이 다르면 같은 경계가 최선은 아닐 수 있습니다. CFP와 CFN은 0 이상이고 합은 양수라고 가정합니다. 거짓긍정 비용이 CFP, 거짓부정 비용이 CFN이고 다른 비용이0이면, 모형확률을 비용 계산에 믿을 수 있다는 전제 아래1의 기대비용은 CFP(1−p),0의 기대비용은 CFNp입니다. 따라서 CFP/(CFP+CFN)보다 클 때1을 택하는 규칙을 도출할 수 있습니다. 경계에서는 두 결정의 기대비용이 같습니다. 이론적 확장일 뿐 현재 실습의 고정 동률 규칙을 몰래 바꾸지는 않습니다.

영화 문장을 개인에게 불이익을 주는 의사결정으로 바로 연결하면 라벨의 의미와 비용이 모두 달라집니다. 정확한 오즈 계산이 타당한 정책을 자동으로 고르지 않습니다. 먼저 누구에 대한 어떤 손실인지, 확률이 그 환경에서 보정됐는지, 유보나 사람이 확인하는 선택이 필요한지 검토합니다.

Probability p and odds p/(1−p) are two scales: p=3/4 gives odds three; p=9/10 gives odds nine. Odds above one are equivalent to p above one half. We predict one exactly when J 1>J 0, and zero on a tie. A tie-to-zero convention does not establish that the negative label is truer.

O=p1−p=J1J0,p=O1+O,y^=1{J1>J0}O=\frac{p}{1-p}=\frac{J_1}{J_0},\qquad p=\frac{O}{1+O},\qquad \widehat y=\mathbf1\{J_1>J_0\}

Different costs can imply a different boundary. Assume CFP and CFN are nonnegative and CFP+CFN>0. With false-positive cost CFP and false-negative cost CFN, assuming usable model probabilities and zero correct-decision costs, choosing one costs CFP(1−p) in expectation and zero costs CFNp. Comparing these yields threshold CFP/(CFP+CFN). At equality, the two decisions have equal expected cost. This theoretical extension does not silently change our implementation’s fixed decision rule.

Using movie sentences to make consequential decisions about people would change both the target and the losses. Exact odds do not automatically select a valid policy. Specify whose loss is considered, whether probabilities transfer and calibrate in that setting, and whether abstention or human review is appropriate.

학부Undergraduate

정확한 분수와 화면의 소수는 다르다An exact fraction differs from its decimal display

α를10의200제곱처럼 크게 하면 bright의 두 클래스 확률이 거의 같습니다. 그래도 클래스1횟수2가 클래스0횟수0보다 크므로 동일사전확률에서 사후확률은 정확히1/2보다 큽니다. 화면의 보통 소수에서는0.5로 보일 수 있습니다. 이때 표시된0.5만 다시 비교하면 동률로 잘못 분류할 수 있습니다.

실습은 정확한 분자·분모와1/2의 어느 쪽인지 표지를 보존합니다. 소수 표시는 짧게 읽되 정확값을 펼쳐 확인할 수 있습니다. 긴 분수를 기본 셀에 수백 자리로 늘어놓는 대신 가까운 경계의 방향을 설명합니다. 반대로 정확히1/2인 경우에는 동률 표지를 두고0을 예측합니다. “차이가 안 보임”과 “차이가 없음”은 다릅니다.

α가 매우 작고 익숙하지 않은 토큰이 반복되면 양쪽 결합 점수가 소수로0까지 작아질 수 있습니다. 두 값을0/0으로 나누면 안 됩니다. 정확 분수로 약분한 사후확률은 여전히 정의될 수 있습니다. 로그 점수와 정확한 비율, 표시 손실을 함께 읽는 이유입니다.

실습 D에서 bright한 단어와 매우 큰α를 비교하고, all-OOV문장과 정확동률도 비교하세요. 먼저 “확률이1/2보다 큰가?”와 “화면 소수가0.5인가?”를 따로 답합니다. 실제 과학 계산에서는 구현의 자원 한계를 넘으면 명시적으로 거절될 수도 있습니다. 거절은 무한히 큰 모든 계산을 지원한다는 약속을 대신하는 정직한 경계입니다.

With alpha as large as 10 to the power 200, the two bright probabilities are almost equal. Yet the class-one count is two and the class-zero count zero, so equal priors still give a posterior strictly above one half. A standard decimal display can show 0.5. Reclassifying that display would incorrectly turn a strict decision into a tie.

The lab preserves exact numerator/denominator and side-of-half metadata. Read a short decimal first and expand the exact value when needed, rather than filling a default table cell with hundreds of digits. An exact half has a separate tie flag and predicts zero. An invisible displayed difference is not an absent mathematical difference.

Tiny alpha and repeated rare tokens can make both joint scores project to decimal zero. Dividing the displayed zeros would be wrong. Their exact rational ratio can remain well-defined. Read log scores, exact ratios and display-loss flags together.

In lab D, compare bright under huge alpha, an all-OOV sentence and an exact tie. Answer separately whether the posterior exceeds one half and whether its decimal display equals 0.5. Calculations beyond explicit resource bounds may be rejected; bounded support is not a promise of unlimited exact arithmetic.

학부Undergraduate

혼동표의 네 칸과 분모Four confusion cells and their denominators

예측1·실제1은 TP,예측1·실제0은 FP,예측0·실제0은 TN,예측0·실제1은 FN입니다. 표를 읽을 때 항상 어느 쪽이 예측인지 먼저 확인하세요. 정답률은(TP+TN)/전체, 정밀도는TP/(TP+FP), 재현율은TP/(TP+FN)입니다. 이름이 비슷하지만 분모가 묻는 질문이 다릅니다.

IMDb 실제 시험16문장의 선택모형
실제 라벨예측1예측0
실제153
실제044

위 표는 정답률9/16,정밀도5/9,재현율5/8입니다. 틀린7문장을 다시 찾아 어떤 단어가 증거가 됐는지 읽습니다. 한두 오류를 골라 그럴듯한 이야기만 하지 않도록 전체 시험 문장·예측·원 행 주소도 CSV로 남깁니다.

양성 예측이 하나도 없으면 정밀도 분모0입니다. 양성 실제 라벨이 없으면 재현율 분모0입니다. 이를0%로 채우면 근거가 없는 비율을 실패율처럼 보이게 합니다. 해당없음·미정의로 표시하고 지지하는 표본 수를 같이 보여줍니다. 작은 시험표의 비율을 확정적인 일반 성능으로 해석하지 않는 것도 중요합니다.

Predicted one/observed one is TP; predicted one/observed zero FP; predicted zero/observed zero TN; predicted zero/observed one FN. Check the orientation before reading a table. Accuracy=(TP+TN)/all, precision=TP/(TP+FP), recall=TP/(TP+FN). Their denominators ask different questions.

Selected-model IMDb test frame of16 sentences
Observed labelPredicted1Predicted0
Observed153
Observed044

This gives accuracy 9/16, precision 5/9 and recall 5/8. Revisit the seven errors and their contributing words. Retain all test predictions and native row addresses in CSV, rather than selecting a few persuasive error stories.

With no positive predictions, precision has denominator zero. With no positive observed labels, recall has denominator zero. Filling either with 0% fabricates a supported rate. Display undefined/not supported with its counts, and avoid treating a tiny test frame as a definitive general performance estimate.

학부Undergraduate

정답률과 Brier 점수·보정의 차이Accuracy, Brier score and calibration differ

정답률은 경계를 넘은 쪽만 봅니다. 실제 라벨이1일 때 p=0.51과 p=0.99는 둘 다1로 예측하므로 정답률에서는 같습니다. Brier 점수는 (p−y)의 제곱을 평균하므로 두 확률의 차이를 봅니다. 낮을수록 이 표의 숫자 라벨에 가까운 확률입니다. 극단적으로 자신하는 오답은 큰 제곱오차를 냅니다.

Brier=1n∑i=1n(pi−yi)2\mathrm{Brier}=\frac1n\sum_{i=1}^{n}(p_i-y_i)^2

p=3/4,y=1이면1/16이고 p=3/4,y=0이면9/16입니다. 실제 라벨1에 확률을 거의1로 주었을 때 제곱오차는 양수여도 화면에서0으로 작아질 수 있어,이 구현은 정확히0인지 양의 비영값이 작아진 것인지 구분합니다. Brier 값은 표시에 근삿값을 쓰지만 내부 유한평균은 정확하게 계산합니다.

Brier가 낮다고 모든 집단·모든 확률 구간에서 보정됐다는 뜻은 아닙니다. 보정은 예를 들어0.7을 내는 사건들에서 실제 라벨1이 약70%인지 묻는 성질이며,확인할 충분한 별도 자료와 분할이 필요합니다. 나이브베이즈는 의존한 단어 증거를 중복으로 셀 수 있으므로 좋은 분류 경계와 좋은 확률 보정이 다를 수 있습니다.

이 장은 검증 오분류 수를 기준으로α를 고릅니다. Brier는 추가 평가로 함께 보되 작은 차이에 임의 오차허용치를 넣어 선택을 바꾸지 않습니다. 다른 선택 기준을 실험하려면 먼저 선언하고 독립 시험표로 다시 평가하세요. 결과를 본 뒤 유리한 지표만 고르는 것은 새로운 탐색입니다.

Accuracy sees only the chosen side of a boundary. For observed label one, p=0.51 and p=0.99 both classify correctly. Brier averages squared probability errors and distinguishes them; a confident mistake receives a large squared error.

Brier=1n∑i=1n(pi−yi)2\mathrm{Brier}=\frac1n\sum_{i=1}^{n}(p_i-y_i)^2

For p=3/4, y=1 the contribution is 1/16; with y=0 it is 9/16. A tiny positive error can display as zero when p is extremely close to the correct endpoint. The implementation distinguishes exact zero from positive underflow. It computes the finite mean exactly internally, then presents an explicitly approximate display packet.

A low Brier score does not certify calibration within every group or probability range. Calibration asks, for example, whether events receiving 0.7 are positive about 70% of the time, requiring adequate separate data. Naive Bayes may count dependent word evidence repeatedly, so a useful decision boundary need not provide well-calibrated probabilities.

Our alpha choice minimizes validation error counts. Brier is supplementary; no numerical tolerance silently changes selection. Declare a different criterion before experimenting and reevaluate with independent test data. Selecting a favorable metric after seeing results is another exploratory choice.

학부Undergraduate

검증으로 평활 강도를 고르는 정확한 절차Choose smoothing by an explicit validation rule

후보α를[1/2,1,2]순서로 미리 적습니다. 후보마다 같은 훈련자료·같은 단어목록으로 확률을 다시 계산하고 검증 문장에만 예측을 냅니다. 정답과 다른 수가 가장 작은 후보를 고릅니다. 오류 수가 같으면 목록에서 먼저 나온 후보를 남깁니다. 정수 오류 수 비교이므로 “거의 같다”는 임의 기준이 필요 없습니다.

k^=min⁡arg min⁡k∈{0,1,2}∑i∈V1{y^i(k)≠yi}\widehat k=\min\operatorname*{arg\,min}_{k\in\{0,1,2\}}\sum_{i\in\mathcal V}\mathbf1\{\widehat y_i^{(k)}\ne y_i\}

선택 이후 훈련+검증으로 자동 재학습하지 않습니다. 그렇게 하면 단어목록·사전확률·횟수가 달라질 수 있어 현재 선택모형과 다른 모형입니다. 재학습을 하려면 별도의 절차로 선언하고 그 모형의 시험결과를 따로 기록합니다. 이 장은 원 훈련표에 맞춘 선택모형을 그대로 시험합니다.

실제 세 사례는 모두 첫 후보1/2을 선택하지만 이것이 모든 텍스트 문제에서α=1/2이 최적이라는 결론은 아닙니다. 작은 검증표에서 다수 후보가 같은 결정을 낼 수 있고 미리 정한 동률 규칙이 선택을 정합니다. α와 오류 수를 함께 보면 “최적화가 엄청난 개선을 찾았다”는 과장도 줄일 수 있습니다.

원본을 보존한 별도 복사본에서 시험 라벨만 바꾸는 의존성 검사를 하면 단어목록·후보별 검증오류·선택α가 바뀌지 않아야 합니다. 바뀌는 것은 그 시험 라벨에 대한 성적뿐입니다. 반면 훈련 라벨을 바꾸면 확률과 예측이 바뀔 수 있습니다. 자료의 어느 부분이 어느 결과를 결정하는지 추적하는 실험이 단순한 버튼 누르기보다 중요합니다.

Declare alpha candidates[1/2, 1, 2] in order. Fit each on the same training set and vocabulary, predict validation rows only, then minimize the integer number of errors. Keep the earliest candidate on ties. Exact integer comparison requires no “nearly equal” tolerance.

k^=min⁡arg min⁡k∈{0,1,2}∑i∈V1{y^i(k)≠yi}\widehat k=\min\operatorname*{arg\,min}_{k\in\{0,1,2\}}\sum_{i\in\mathcal V}\mathbf1\{\widehat y_i^{(k)}\ne y_i\}

We do not automatically refit on combined training and validation data. Such a refit may change vocabulary, priors and counts, creating a different model. If desired, declare it as a separate procedure with a separately recorded test result. Here the selected training-fitted model is evaluated unchanged.

All three observed cases select the first candidate, one half. That does not establish a universally optimal smoothing strength. Candidates can make identical decisions in small validation frames, leaving the declared tie rule to decide. Show alpha and error counts together instead of implying a dramatic optimization gain.

Changing test labels must leave vocabulary, candidate validation errors and selected alpha unchanged; only evaluation against those labels changes. Changing training labels may alter probabilities and predictions. Tracing which data determine which outputs is the purpose of the source lab, beyond pressing a button.

학부Undergraduate

누출을 찾아도 자동 삭제하지 않기Detect leakage without silently deleting data

감사 함수는 문제를 찾는 목록을 보여주고 원 행을 임의로 지우지 않습니다. 같은 정규화 문장이 훈련·시험에 걸쳐 있으면 해당ID와 역할을 함께 보여줍니다. 상반된 제공 라벨이 붙은 같은 문장도 따로 표시합니다. 어떤 라벨이 옳은지 모형이 판정한 것은 아니므로 원문·문맥·자료 제작 과정을 다시 살펴야 합니다.

한 번 고른 시험표에서 중복이나 오류를 발견하면 수정 내역과 이유를 기록하고 평가 버전을 새로 만듭니다. 바꾸기 전 결과를 없애면 개선이 모형 때문인지 자료 선택 때문인지 알 수 없습니다. 테스트를 끝없이 바꾸며 가장 좋은 결과만 보고하면 사실상 시험자료로 선택한 것입니다.

실습 E에서 같은 문장·대소문자 변형·숫자만 다른 문장·반대 라벨을 각각 넣어 보세요. 어느 목록에 잡힐지 먼저 예상합니다. 감사 보고서에 원본인증 false가 나오는 것은 실패가 아니라 범위의 표시입니다. 텍스트 비교는 ZIP 전송 바이트의 동일성이나 작성자 독립성을 증명하지 않기 때문입니다.

The audit reports issues without silently deleting rows. A canonical sentence appearing across training and test roles is listed with its IDs and roles. Conflicting supplied labels receive a separate flag. The model has not decided which label is true; inspect the original context and data construction.

If a held-out frame needs correction after a duplicate or error is found, record the reason and create a new evaluation version. Retain the earlier result so that changes in the model can be separated from changes in data selection. Repeatedly changing the test set until a favorable result appears uses it for selection.

In lab E, add an exact duplicate, a case/space variant, a digit-only difference and opposite labels. Predict which audit list receives each. An authenticity flag of false states scope: text comparisons do not verify archive bytes or independent writers.

학부Undergraduate

재현 명세를 먼저 쓰는 팀 실험Specify a reproducible team experiment

한 팀원이 원문을 읽고 다른 팀원이 모형을 맞춘다면 무엇을 주고받아야 할까요? CSV만 주면 라벨의 의미·분할 규칙·삭제 기준이 빠질 수 있습니다. 원자료 주소·해시·라이선스·원행ID·역할표·정규화 규칙·단어 정렬·후보 순서·선택 기준을 함께 명세합니다. 프로그램 버전과 실행명령도 남겨 같은 입력의 다른 해석을 막습니다.

검증할 불변조건을 적습니다. 시험 라벨만 바꾸면 훈련 단어·클래스 횟수·선택α·모든 확률이 같아야 합니다. 반환 결과를 화면에서 편집해도 다음 원자료 호출은 같은 관측을 내야 합니다. CJS와 브라우저에서 같은 입력을 계산하면 같은 정확 분수가 나와야 합니다. 이는 몇 가지 구체적 설계 성질을 확인하는 것이며 모형의 사회적 타당성을 자동 인증하지는 않습니다.

원 다운로드를 다시 하는 것과 보존한 원본을 다시 읽는 것도 구분합니다. 이 장의 UCI 압축파일은 새로 확보했지만 WDI 수치는 앞장에서 보존한 동일 빈티지를 재독합니다. 같은 자료를 여러 프로그램이 읽었다고 새 관측 수가 늘어나지 않습니다. 재현 실행 횟수와 관측 수를 분리해서 보고합니다.

코드를 읽을 수 없는 학습자도 표 한 줄을 손으로 검산하고 원 주소를 클릭하며 논리를 추적할 수 있어야 합니다. 반대로 복잡한 검사 로그를 본문에 나열해 학습 설명을 대신하지 않습니다. 본문은 왜 그 계산을 하는지 설명하고,전체 코드·CSV·정확값은 필요할 때 펼치거나 내려받을 수 있게 둡니다.

When one teammate reads sources and another fits the model, a CSV alone is insufficient. Specify source addresses, hashes, license, native row IDs, roles, normalization, vocabulary ordering, candidate order and selection rule. Include software versions and commands to prevent different interpretations of the same input.

State invariants. Changing only test labels must preserve vocabulary, class counts, selected alpha and all probabilities. Editing a returned display object must not alter future native-source calls. CJS and browser calculations should return identical exact fractions. These checks establish specific implementation properties, not automatic social validity.

Distinguish a new download from rereading a retained original. The UCI archive was newly acquired; WDI values reuse the same retained vintage from earlier chapters. Reading one dataset in several programs does not increase the observation count. Report executions separately from observations.

A learner who cannot yet read the whole program should still check one table row by hand and trace its source address. Long verification logs cannot replace explanation. The text teaches why a calculation matters; full code, CSV and exact values remain available on demand.

대학원 연결Graduate bridge

생성 모형의 로그오즈가 선형이 되는 이유Why generative log odds become linear

앞의 로그오즈 식을 보면 입력은 단어 횟수nj이고 각 단어의 가중치는 log(θ1j/θ0j)입니다. 절편은 log(π1/π0)입니다. 따라서 이 나이브베이즈 분류의 경계는 단어 횟수 공간에서 선형입니다. “베이즈라서 비선형” 또는 “텍스트라서 신경망 필수”라고 분류하기보다 실제 식을 읽어야 합니다.

log⁡O=b+∑jwjnj,b=log⁡(π1/π0),wj=log⁡(θ1j/θ0j)\log O=b+\sum_jw_jn_j,\qquad b=\log(\pi_1/\pi_0),\quad w_j=\log(\theta_{1j}/\theta_{0j})

로지스틱회귀도 선형 로그오즈를 쓸 수 있지만 매개변수를 얻는 방법이 다릅니다. 나이브베이즈는 라벨별 단어분포와 사전확률을 맞추고 조건부 사후확률을 유도합니다. 로지스틱회귀는 보통 라벨의 조건부 가능도를 직접 최적화합니다. 같은 모양의 경계가 같은 추정법·같은 확률 보정을 뜻하지 않습니다.

대학원 연결 문제는 의존성이 있는 단어를 일부 복제했을 때 무슨 일이 생기는지입니다. bright와 그 복제 단어가 항상 함께 있으면 조건부 독립모형은 별개 증거처럼 로그비를 더해 더 자신할 수 있습니다. 실제 새 정보가 늘지 않아도 확률이 극단화될 수 있습니다. 경계 정답률·Brier·보정곡선·외부자료를 함께 비교해야 하는 이유입니다.

In the log-odds expression, inputs are word counts nj, weights are log(θ1 j/θ0 j), and the intercept is log(π1/π0). The resulting boundary is linear in count space. Read the equation rather than assuming that a Bayesian method must be nonlinear or that text necessarily requires a neural network.

log⁡O=b+∑jwjnj,b=log⁡(π1/π0),wj=log⁡(θ1j/θ0j)\log O=b+\sum_jw_jn_j,\qquad b=\log(\pi_1/\pi_0),\quad w_j=\log(\theta_{1j}/\theta_{0j})

Logistic regression can also use linear log odds, but obtains parameters differently. Naive Bayes fits class-conditional word distributions and priors before deriving a posterior; logistic regression commonly optimizes a conditional label likelihood directly. Similar boundary shapes do not imply identical estimation or calibration.

For a graduate extension, duplicate a dependent word feature. If bright and its copy always co-occur, a conditional-independence model can add their log ratios as separate evidence and become more confident without new information. Compare accuracy, Brier, calibration and external data, rather than interpreting confidence alone.

대학원 연결Graduate bridge

평활의 베이지안 해석과 점추정의 한계A Bayesian interpretation of smoothing and its limits

선택한V개 단어확률을 합1인 벡터로 보고 각 항목에 같은 양의 Dirichlet 매개변수α를 둔다고 합시다. 라벨별 토큰 횟수를 관측한 후 그 벡터의 사후평균은(Tcj+α)/(Tc+Vα)입니다. 이 장 평활식과 같습니다. “가짜 관측”이라는 비유로 끝내기보다 어떤 모형과 요약값에서 같은 식이 나오는지 명시하면 더 정확합니다.

θc∼Dirichlet(α,…,α),E[θcj∣Tc]=Tcj+αTc+Vα\theta_c\sim\mathrm{Dirichlet}(\alpha,\ldots,\alpha),\qquad E[\theta_{cj}\mid T_c]=\frac{T_{cj}+\alpha}{T_c+V\alpha}

이 식은 해당 단어확률 벡터의 사후평균이지 항상 사후최빈값MAP인 것은 아닙니다. 내부 최빈값 조건이 맞는 경우의MAP식에는α−1이 등장하며 경계 경우를 따로 다룹니다. 또한 우리는 추정한 확률을 여러 토큰에 곱해 쓰는 plug-in모형을 구현했습니다. θ를 완전히 적분한 Dirichlet-다항 예측분포와 동일한 모든 문장확률이라고 부르지 않습니다.

자료에 근거한 불확실성까지 보려면 단어확률의 사후분포·문장 선택의 불확실성·라벨오류·영역변화를 분리해야 합니다. 정확 분수 하나가 이 모든 불확실성을 포함하지는 않습니다. 손계산 가능한 작은 모형에서 시작해 추정량·예측분포·자료설계를 서로 구분하는 것이 대학원 수준의 핵심 확장입니다.

Treat the V word probabilities as a vector summing to one and assign symmetric positive Dirichlet parameter alpha. After observing class-specific token counts, the posterior mean is (Tcj+alpha)/(Tc+V alpha), matching our smoothing formula. State the model and summary instead of stopping at a “fake observations” analogy.

θc∼Dirichlet(α,…,α),E[θcj∣Tc]=Tcj+αTc+Vα\theta_c\sim\mathrm{Dirichlet}(\alpha,\ldots,\alpha),\qquad E[\theta_{cj}\mid T_c]=\frac{T_{cj}+\alpha}{T_c+V\alpha}

This is a posterior mean, not universally a MAP mode. The interior MAP formula involves alpha minus one and has separate boundary conditions. Our implementation also multiplies fitted probabilities as a plug-in model; it is not the fully integrated Dirichlet-multinomial probability for every sentence.

A fuller uncertainty analysis separates uncertainty in word probabilities, sentence selection, labels and domain transfer. One exact fraction does not incorporate all of them. Distinguishing estimators, predictive distributions and data design is the graduate extension of this hand-checkable model.

학부Undergraduate

길이를 조건으로 둘 때 잃는 증거Evidence lost by conditioning on length

두 라벨의 문장길이 분포가 다르면 길이 자체가 정보일 수 있습니다. 현재 모형은 남긴 토큰의 길이를 고정하고 단어확률만 곱합니다. OOV를 버린 뒤 알려진 토큰이0개인 문장도 같은 사전확률로 돌아갑니다. 그 문장이 원래 매우 길었는지 한국어였는지 이모지만 있었는지는 별도 원문정보에 있지만 현재 분류 점수에 쓰지 않습니다.

원래 문장길이m의 분포P(m|Y=c)를 모형화한다면 그 항도 클래스 점수에 들어갈 수 있습니다. 하지만 자료를 보고 좋아 보이는 길이항을 몰래 추가하면 모형이 바뀝니다. 길이를 쓰는 기준모형을 따로 선언하고 같은 훈련·검증·시험 규칙으로 비교해야 합니다. 단어 수로 나눈 평균 로그점수도 원래 문장 결합점수와 동일한 모형이 아닙니다.

실제 국가 사례는 성장률의 숫자 크기가 ASCII 단어규칙에서 빠집니다. positive와 negative라는 선언한 부호단어는 남지만3.2와8.1의 차이는 없어집니다. 따라서 성장률 실수 전체를 이해하는 예측기라고 부르지 않습니다. 어떤 수치정보를 텍스트로 직렬화했고 어떤 정보를 토큰화가 버렸는지 구체적으로 검토합니다.

If sentence length distributions differ by class, length itself can be informative. Our model conditions on retained length and multiplies word probabilities only. After dropping OOV words, zero-known-token sentences all return the prior. Their original length, language or emoji content remain in the raw record but not in this score.

An explicit model for P(length=m|Y=c) could add a length term. Quietly adding one after seeing favorable results changes the model. Declare a separate length-aware baseline and compare it under the same splits. Dividing log scores by word count is also not automatically the original joint-score model.

In the country case, ASCII tokenization removes numerical magnitudes from serialized growth values. Declared positive/negative sign words survive, but values 3.2 and 8.1 do not remain distinct numerical inputs. This is not a model that understands the complete real-valued growth observation. Inspect both serialization and information loss.

학부Undergraduate

영역 이동을 실패가 보이는 실험으로 만들기Make domain shift an inspectable experiment

상품에서 좋다는 단어와 식당에서 좋다는 단어는 일부 공유하지만 맥락이 다릅니다. 영화의 예측 불가능한 전개는 칭찬일 수 있고 상품의 예측 불가능한 작동은 불만일 수 있습니다. 한 영역에서 맞춘 단어확률을 다른 영역에 그대로 쓸 때 결과가 유지된다는 보장은 없습니다. 이것이 Amazon에서 훈련하고 Yelp에서 시험하는 의도적인 비교의 이유입니다.

영역 이동을 숫자 하나로만 설명하지 말고 OOV비율·예측 클래스 분포·오류 문장·기준 정답률을 같이 읽습니다. 높은OOV는 모형이 읽지 못하는 단어가 많다는 뜻이지만 낮은OOV도 단어의 의미와 라벨 관계가 같음을 보장하지 않습니다. 같은 단어가 반대의 기능을 가질 수 있기 때문입니다.

실제 회사 사례의 시험 정답률은21/32입니다. 이 수치는64개 미리 선택한 식당 문장의42개 정답을 요약합니다. Amazon 또는 Yelp 기업의 품질·이익·소비자후생·전체 서비스 성적을 측정한 것이 아닙니다. 라벨과 입력의 관계를 예측한 교육 실험과 기업에 대한 평가를 구분합니다.

외부 검증을 확장하려면 지역·시기·상품범주·작성자·전체 리뷰 문서를 구분할 수 있는 적법한 자료가 필요합니다. 현재 자료에 없는 속성을 상상으로 채우지 않습니다. 먼저 알 수 없는 것을 명시하고,추가 자료가 어떤 가정을 검토하게 해줄지 연구 질문으로 적습니다.

Positive language overlaps between products and restaurants but its context differs. An unpredictable movie plot may be praised; unpredictable product behavior may be criticized. Word probabilities fitted in one domain need not transfer unchanged. This motivates the deliberate Amazon-training/Yelp-test comparison.

Inspect OOV share, predicted-class balance, actual error sentences and baseline accuracy alongside the headline score. High OOV means many words supply no evidence. Low OOV still does not ensure stable meanings or word-label relationships across domains.

Our company-case test accuracy is 21/32: 42 correct classifications among 64 prespecified restaurant sentences. It does not measure either platform’s corporate quality, profits, consumer welfare or overall service performance. A sentence-label prediction exercise differs from evaluating a company.

Broader external validation needs appropriately usable data with period, region, category, author or parent-document information. Do not invent attributes absent from this corpus. State what is unknown and which additional data could test each assumption.

학부Undergraduate

집단별 성적을 평균 하나로 숨기지 않기Do not hide group results in one average

영화·상품·식당을 합쳐 정답률 하나만 보고하면 어느 영역에서 잘못되는지 안 보입니다. 관측 수가 많은 집단은 전체 평균에 더 큰 비중을 갖습니다. 집단별 정답률을 같은 비중으로 평균하는 거시평균과 모든 행을 합치는 미시평균은 다른 질문입니다. 어느 비중을 택했는지 밝히고 분모가 작은 집단의 불안정함도 남깁니다.

micro=∑gCg∑gNg,macro=1G∑gCgNg(Ng>0)\mathrm{micro}=\frac{\sum_g C_g}{\sum_g N_g},\qquad \mathrm{macro}=\frac1G\sum_g\frac{C_g}{N_g}\quad(N_g>0)

이 자료의 집단은 출처 영역이나 국가코드입니다. 작성자의 나이·성별·인종을 추측해 공정성표를 만들지 않습니다. 영화문장 출처를 개인의 보호속성과 같다고 부를 수 없습니다. 집단 성적 격차가 있으면 자료 차이·라벨·OOV·표본 선택 등의 추가 질문을 세울 수 있지만 그 하나로 차별의 인과 원인을 식별하지는 못합니다.

국가별 시간자료와 익명 리뷰를 한 통계적 표본처럼 합쳐 신뢰구간을 만드는 것도 피합니다. 단위·목표·의존구조가 다릅니다. 세 사례는 같은 계산도구가 다른 자료에서 어떻게 해석되는지 비교하는 교육 구성이며 통합 모집단의 하나의 성능표가 아닙니다.

Pooling movie, product and restaurant sentences into one accuracy can hide the failing domain. Larger groups dominate a row-weighted average. Macro averaging weights group accuracies equally; micro averaging pools rows. State the weights and preserve the small denominators behind unstable group rates.

micro=∑gCg∑gNg,macro=1G∑gCgNg(Ng>0)\mathrm{micro}=\frac{\sum_g C_g}{\sum_g N_g},\qquad \mathrm{macro}=\frac1G\sum_g\frac{C_g}{N_g}\quad(N_g>0)

Available groups here are source domains or country codes. Do not invent writers’ ages, sexes or races to build a fairness table. Source domain is not a person’s protected attribute. A gap motivates questions about labels, OOV and selection; it does not identify a causal mechanism of discrimination.

Nor should country time observations and anonymous review sentences be pooled as one statistical sample for a confidence interval. Units, targets and dependence differ. The three cases teach how one computational tool changes interpretation across data, not performance on a unified population.

학부Undergraduate

작은 시험표의 불확실성과 독립성Uncertainty and dependence in a small test frame

16문장에서 정답9개는 관측된 정확한 개수입니다. 하지만 새 문장에서의 진짜 정답률이 정확히9/16이라는 뜻은 아닙니다. 시험표를 다르게 뽑으면 수치가 바뀔 수 있습니다. 불확실성을 논하려면 어떤 단위가 어떤 모집단에서 어떻게 뽑혔는지부터 정해야 합니다. 목적적으로 균형을 맞춘 선택표의 한계를 먼저 적습니다.

정답 지시변수가 서로 독립이고 같은 성공확률을 갖는 베르누이 표본이라고 가정하면 이항모형을 쓸 수 있습니다. 그러나 같은 작성자나 같은 전체 리뷰에서 나온 문장은 의존할 수 있고 현재 자료는 그ID를 제공하지 않습니다. 따라서 편리한 이항가정으로 정밀한 모집단 보장을 자동 부여하지 않습니다. 표 안의 정답 비율과 추론 가정을 분리합니다.

같은 시험표에서 두 분류기를 비교할 때는 정답 지시변수의 짝을 보존해야 합니다. 각각의 정답률만 빼면 어떤 문장에서 서로 다르게 맞혔는지 잃습니다. 짝비교 검정의 조건부 독립방향 등 추가 가정도 필요하며 단순 교환가능성만으로 모든 이항 귀무법칙이 생기는 것은 아닙니다. 이전 평가장의 가정 체크를 연결해 읽으세요.

실용적으로는 오류 문장·분모·분할·원본을 모두 남겨 다른 설계의 외부 검증이 가능하게 합니다. 근거가 작을수록 소수점 자리를 늘리는 것보다 추가 자료 계획을 구체화하는 편이 학습에도 연구에도 도움이 됩니다.

Nine correct classifications among 16 sentences is an exact observed count, not an exact success rate on every future sentence. Another test selection could yield another result. Before inference, specify the sampling unit, population and selection process, including our deliberately balanced frame.

A binomial model is available under independent Bernoulli correctness indicators with a common success probability. Sentences sharing a writer or source review can violate independence, and the necessary IDs are absent here. A convenient binomial assumption must not silently create a precise population guarantee. Separate descriptive fractions from inferential assumptions.

Comparing two classifiers on the same frame should preserve paired correctness. Marginal accuracies alone lose which sentences each model got right. Paired tests require their own assumptions; exchangeability alone does not imply every conditional binomial null law. Revisit the assumption checks from the evaluation chapter.

Retain errors, denominators, splits and originals so that a differently designed external evaluation remains possible. With small evidence, planning additional data is more informative than adding decimal places.

학부Undergraduate

공개 텍스트의 이용 조건과 민감한 해석Use conditions and sensitive interpretations of public text

공개 다운로드가 가능하다는 것과 아무 설명 없이 무제한 사용해도 된다는 것은 다릅니다. 이 장 자료의 공식 UCI 라이선스 표시와 원 README의 논문인용을 함께 남깁니다. 원자료가 파생한 더 큰 리뷰집합의 주소도 README에서 확인할 수 있지만 이 장이 그 전체를 다운로드하거나 읽었다고 주장하지 않습니다.

원문은 공개 문장이지만 사람의 감정·건강·인격 등 민감한 속성을 진단하는 자료로 바꾸어 부르지 않습니다. 작성자ID가 없다는 사실도 완전 익명성의 증명은 아닙니다. 여기서는 원문을 자료출처와 오류분석을 이해할 교육 범위로 사용하고 실명 추적이나 개인 프로파일링을 하지 않습니다.

모형 설명표의 단어 기여는 현재 가정 안의 계산 기여입니다. 실제 사람의 판단이 그 단어 때문에 생겼다는 인과설명이 아닙니다. 이용자가 불리한 결정을 받을 상황이라면 데이터권리·이의제기·검토절차 등 별도 설계가 필요합니다. 이 교육모형의 단순한API가 그 운영요건을 대신하지 않습니다.

Public download access is not permission to ignore use conditions. Retain the official UCI license information and the README’s paper attribution. The README also points to larger source review collections, but this chapter does not claim to have downloaded or read those complete datasets.

Do not turn public sentence labels into diagnoses of a person’s emotional health or character. Missing author IDs do not prove complete anonymity. We use retained sentences to teach provenance and error analysis, without identifying writers or building personal profiles.

A word contribution explains a calculation under this model. It is not evidence that the word caused the writer’s judgment. Consequential deployment would require separate design for rights, review and contestability. A teaching API does not supply those operational requirements.

학부Undergraduate

다른 사람이 읽을 수 있는 모형 카드A model card another reader can understand

모형카드는 홍보문구가 아니라 판단에 필요한 설명입니다. 목표·자료범위·입력표현·선택절차·결과·한계·사용하지 말아야 할 해석을 한곳에 정리합니다. “AI감성분석99%” 대신 원자료명·작은 코어 분모·실제 정답 수·다수 기준·OOV를 적으면 다른 사람이 결과를 평가할 수 있습니다.

이 장의 모형 카드 질문
항목답할 질문
목표제공된 어느 라벨을 예측하는가?
입력원문 중 어떤 정보를 버렸는가?
선택검증으로 고른 것은 무엇인가?
결과정답수·분모·기준·오류 문장은?
출처원 파일·행·라이선스·해시는?
한계작성자 독립성·보정·대표성은 확인됐는가?

같은 숫자라도 단위가 중요합니다. 국가 성장률 이진목표,익명IMDb 문장라벨,Amazon→Yelp 영역이동의 정답률은 서로 다른 항목으로 씁니다. 한 모형카드 안에 세 사례를 넣을 수 있어도 하나의 소비자 만족도 지표로 합치지 않습니다.

모형 버전·자료해시·전처리 규칙을 같이 남기면 나중에 오류를 고칠 때 무엇이 바뀌었는지 추적할 수 있습니다. 설명 오타 수정·표시 소수 수정·학습자료 변경·선택규칙 변경을 구분하세요. 실제 자료와 계산이 바뀐 것을 그저 디자인 수정이라고 부르지 않습니다.

A model card provides decision-relevant description rather than advertising. Collect the target, data scope, representation, selection, results and limits in one place. Native source names, core denominators, correct counts, majority baselines and OOV evidence are more assessable than a vague “99% AI sentiment” claim.

Questions for this chapter’s model card
ItemQuestion
TargetWhich supplied label is predicted?
InputWhat raw information is discarded?
SelectionWhat is chosen by validation?
ResultsCorrect counts,denominators,baselines and errors?
ProvenanceNative file,row,license and hash?
LimitsAre writer independence,calibration and representativeness established?

Keep units explicit. Country growth targets, anonymous IMDb sentence labels and Amazon-to-Yelp domain-shift accuracy describe different objects. One document can compare them without merging them into one customer-satisfaction statistic.

Record model version, source hashes and preprocessing so that corrections remain traceable. Distinguish a copy edit, a display-decimal change, a changed training frame and a changed selection rule. Scientific changes must not be labeled merely visual redesign.

학부Undergraduate

정확 계산의 비용도 설계한다Design the cost of exact computation

유리수는 분자와 분모를 정수로 보존합니다. 곱셈을 계속하면 정수의 자릿수가 늘고,약분에도 시간이 듭니다. 단어가128개뿐이어도 확률분모가 아주 크면 비트연산 비용이 커질 수 있습니다. 부동소수점이 빠르다는 사실과 정확 계산이 유용하다는 사실은 함께 성립합니다. 어느 부분에 어떤 정확성이 필요한지 정합니다.

이 구현은 문서당1,024코드포인트·128단어,단어120글자,선택단어 최대128개,외부 숫자토큰256글자 등의 한계를 선언합니다. 작업예산을 넘으면 명시적으로 거절합니다. 큰 문서를 슬쩍 앞부분만 잘라 결과를 원문 전체 결과처럼 보이지 않습니다. 텍스트가 잘린 경우라면 그 규칙을 별도로 선언해야 합니다.

검증 후보마다 모든 시험문장에 대한 모든 중간곱을HTML에 넣을 필요는 없습니다. 선택 후 모형의 전체 핵심출력은CSV로 보존하고 본문에는 핵심표·오류·정확값 접근을 둡니다. 로그는 짧은 소수,정확분수는 펼침,원문은 읽을 수 있는 폭으로 나누면 모바일에서도 계산의 뜻을 읽을 수 있습니다.

자원한계 때문에 거절된 입력은 수학적으로 정의되지 않은 입력과 다릅니다. α=0은 현재 양의 평활모형의 밖이고,허용모형이더라도 매우 큰 정확 중간값은 구현예산 밖일 수 있습니다. 오류문구를 읽고 두 종류를 구분하는 것도 실무능력입니다.

Rationals retain integer numerators and denominators. Repeated multiplication grows their digit lengths, and reduction costs time. Even 128 tokens can involve large integers when probabilities have huge denominators. Floating-point speed and the usefulness of exact checks can both be true; assign precision where it matters.

This implementation declares limits including 1024 code points and 128 words per document, 120 characters per word, 128 selected vocabulary words and 256 characters per external numeric token. It rejects excessive work rather than quietly truncating a large document and reporting a result as if it covered the full text.

There is no need to embed every candidate-by-test-row intermediate product in HTML. Preserve selected-model core outputs in CSV; teach with compact tables, errors and access to exact values. Short log displays, expandable fractions and readable raw text make mobile inspection practical.

A resource rejection differs from an undefined mathematical input. Alpha zero lies outside our positive-smoothing model; a meaningful model can nevertheless exceed the implementation’s exact-arithmetic budget. Reading that distinction is part of practical numerical work.

학부Undergraduate

세 사례를 읽기 전에 가설을 적기Write questions before reading the three cases

국가 사례에서는 “숫자를 영어 문장처럼 배열하면 무엇이 남는가?”를 묻습니다. 성장률의 부호와 국가이름은 남지만 숫자크기는 사라지는 표현을 분석합니다. 다음 해 성장률이0이상인지라는 가상 분류목표를 정한 것과 실제 경제자료를 사용했다는 사실을 동시에 명확히 합니다. 국가의 여론·경제원인·실시간 정책효과를 측정하는 과제는 아닙니다.

개인 사례에서는 익명 리뷰문장 하나를 끝까지 추적합니다. 원 주소·제공 라벨·남긴 단어·OOV·클래스확률·예측·오답 여부를 연결합니다. 한 문장을 한 사람의 전체 감정으로 확장하지 않습니다. 실제로 틀린 문장이 있다는 것을 남겨야 입력표현의 한계를 배울 수 있습니다.

기업 사례에서는 상품훈련→식당시험의 영역이동을 묻습니다. 훈련·검증은Amazon,시험은Yelp라는 경계를 먼저 그립니다. 오류를 본 뒤Yelp단어를 추가해 같은 시험성적을 다시 자랑하지 않고,추가 훈련이 필요하면 새 평가설계를 제안합니다.

각 사례를 읽기 전 “항상 훈련 다수라벨을 내면 얼마나 맞힐까?”,“어떤 원정보가 버려졌을까?”,“어느 결론은 자료로 말할 수 없을까?”를 적으세요. 계산 후 예상과 비교합니다. 좋은 사례학습은 결과를 맞히는 게임보다 예상·관측·수정된 설명을 연결하는 과정입니다.

The country case asks what survives when numbers are serialized as English-like text. Sign words and country names survive, while magnitudes disappear. It combines observed economic inputs with a declared teaching classification target for nonnegative next-year growth. It does not measure public opinion, economic causes or real-time policy effects.

The person case traces one anonymous review sentence from native address through supplied label, retained words, OOV, probabilities, prediction and error. A sentence is not a complete psychological profile. Retaining real mistakes makes the representation’s limits teachable.

The company case asks about product-to-restaurant domain shift. Draw the Amazon training/validation and Yelp test boundary first. Adding Yelp vocabulary after inspecting mistakes changes the procedure; propose a new evaluation instead of celebrating reuse of the same test set.

Before each case, predict training-majority accuracy, identify discarded information and state a conclusion the data cannot support. Compare those expectations with actual calculations. Case learning connects predictions, evidence and revised explanations rather than merely guessing a final score.

학부Undergraduate

국가 사례: 수치에서 만든 텍스트의 한계Country case: limits of text constructed from numbers

독일·일본·한국·미국의 보존된 연간 GDP 성장률과 CPI 상승률을 읽습니다. 목표 연도 직전의 두 수치를 영어 단어와 원 숫자 토큰을 넣은 문장으로 직렬화합니다. 목표는 현재 연도 GDP 성장률이0이상인지입니다. 관측된 경제 수치는 실제 자료지만 문장은 분석자가 구성한 표현이며, 시민이 작성한 리뷰나 여론이 아닙니다.

1981~2024년의 네 나라에서176행을 만들고,1981~2005년100행은 훈련,2006~2014년36행은 검증,2015~2024년40행은 시험입니다. 같은2026-10-08 보존 빈티지의 값을 재독합니다. 입력 연도가 목표보다 앞선다는 사실과 당시 발표·수정 시점을 복원한 실시간 검증은 다릅니다. 이 사례는 후자를 수행하지 않았습니다.

단어 목록에는 나라 이름·growth·inflation·positive·negative 같은 단어가 남습니다. 그러나3.2와8.1의 크기 차이는 단어 규칙에서 사라집니다. 해당 원 수치와 행 주소는 장부에 남겨 표현 손실을 직접 볼 수 있게 합니다. 경제 자료를 썼다는 이유만으로 수치 시계열의 정보를 충분히 사용했다고 결론 내리지 않습니다.

선택된α는1/2이고 검증 오분류는5/36입니다. 시험40행에서32개를 맞혀4/5이지만 모두1로 예측합니다. TP32·FP8·TN0·FN0이므로 음의 성장8행은 모두 놓칩니다. 훈련 다수 라벨1을 항상 내는 기준도4/5입니다. 높은 정답률이 유용한 음의 성장 탐지력을 뜻하지 않는다는 실제 사례입니다.

국가 · 경제 수치의 선언된 텍스트 표현

보존 WDI 수치를 분석자가 영어 단어로 직렬화한 교육 자료입니다. 시민 리뷰·여론이 아니며 숫자 크기는 현재 ASCII 단어 표현에서 사라집니다. 모두1로 예측해 시험4/5을 얻은 결과는 훈련 다수기준과 같고,음의 성장8행은 모두 놓칩니다. 같은 빈티지의 과거 값이므로 실시간 발표·수정 복원을 한 것은 아닙니다.

자료와 모형 범위
항목정의
선택 코어176
훈련·검증·시험100 / 36 / 40
단어 선정훈련 DF내림차순·ASCII동률·최대32
후보·선택α 1/2,1,2 · 검증오류최소·먼저 나온 동률후보
예측 동률정확 J1>J0일 때1,그 외0
표시·계산정확 횟수·유리수 비교,로그와 Brier표시는 근사
검증으로만 고르는 평활
후보α오류/분모정답률Brier
01/25/3631/36≈0.117661
115/3631/36≈0.118186
225/3631/36≈0.119748
선택 모형과 훈련 다수기준
역할행 수TP / FP / TN / FN정답률정밀도재현율Brier기준 정답률
train10090 / 10 / 0 / 09/109/101/1≈0.0881649/10
validation3631 / 5 / 0 / 031/3631/361/1≈0.11766131/36
test4032 / 8 / 0 / 04/54/51/1≈0.1646034/5
선택 단어 전체 · 훈련 정보만 사용
단어DF클래스0횟수클래스1횟수P(word|0)P(word|1)
country10010901/151/15
cpi10010901/151/15
gdp10010901/151/15
growth10010901/151/15
inflation10010901/151/15
percent1002018041/315361/2715
previous1002018041/315361/2715
value1002018041/315361/2715
year10010901/151/15
positive991816237/31565/543
deu254211/3543/2715
jpn253221/453/181
kor251241/10549/2715
usa252231/6347/2715
negative192181/6337/2715

다음 표는 모든 시험 예측입니다. p는 이 모형 안의 사후확률이며 보정 인증이 아닙니다. 정확값 펼침은 원 분수를 보존하고,전체 원문·모든432코어의 결과는 CSV로 제공합니다.

모든 시험 행 · 오답을 삭제하지 않음
원 행 ID관측예측p(1)알려진/OOV정오
DEU:201511≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0정답
DEU:201611≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0정답
DEU:201711≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0정답
DEU:201811≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0정답
DEU:201911≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0정답
DEU:202001≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0오답
DEU:202111≈0.832249
정확값4913587296254947828461863287095/5903986572122978325056600932156
15 / 0정답
DEU:202211≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0정답
DEU:202301≈0.85484
정확값7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0오답
DEU:202401≈0.832249
정확값4913587296254947828461863287095/5903986572122978325056600932156
15 / 0오답
JPN:201511≈0.887939
정확값10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0정답
JPN:201611≈0.887939
정확값10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0정답
JPN:201711≈0.869714
정확값6611305166057321828993536980975/7601704441925352325588274626036
15 / 0정답
JPN:201811≈0.887939
정확값10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0정답
JPN:201901≈0.887939
정확값10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0오답
JPN:202001≈0.869714
정확값6611305166057321828993536980975/7601704441925352325588274626036
15 / 0오답
JPN:202111≈0.849028
정확값27848851607176841796591237313707/32800847986516994279564925539012
15 / 0정답
JPN:202211≈0.869714
정확값6611305166057321828993536980975/7601704441925352325588274626036
15 / 0정답
JPN:202311≈0.887939
정확값10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0정답
JPN:202401≈0.887939
정확값10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0오답
KOR:201511≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:201611≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:201711≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:201811≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:201911≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:202001≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0오답
KOR:202111≈0.944322
정확값16797612384871565832183579144255/17788011660739596328778316789316
15 / 0정답
KOR:202211≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:202311≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
KOR:202411≈0.952678
정확값27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0정답
USA:201511≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:201611≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:201711≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:201811≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:201911≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:202001≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0오답
USA:202111≈0.907071
정확값9667197331701595029950549629959/10657596607569625526545287275020
15 / 0정답
USA:202211≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:202311≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답
USA:202411≈0.920548
정확값15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0정답

첫 시험 문장 DEU:2015의 원문: country DEU previous year 2014 gdp growth positive value 2.18018602168017 percent previous cpi inflation positive value 0.906794000434245 percent

첫 시험 문장의 단어 증거
단어횟수알려짐P(word|0)P(word|1)한 토큰 로그비
country1예1/151/15≈0
deu1예1/3543/2715≈-0.589999
previous2예41/315361/2715≈0.0213313
year1예1/151/15≈0
gdp1예1/151/15≈0
growth1예1/151/15≈0
positive2예37/31565/543≈0.0189327
value2예41/315361/2715≈0.0213313
percent2예41/315361/2715≈0.0213313
cpi1예1/151/15≈0
inflation1예1/151/15≈0
실제 시험 행의 사후확률 · 모바일 웹 그래프와 원 벡터
실제 시험 행의 사후확률 · 모바일 웹 그래프와 원 벡터 · 원본 벡터
훈련 단어의 로그비 · 인과 기여 아님
훈련 단어의 로그비 · 인과 기여 아님 · 원본 벡터
보존 원문 카드 · 사진이나 원본 스캔 아님
보존 원문 카드 · 사진이나 원본 스캔 아님 · 원본 벡터

원문·계보·변환 정의: native3000-review-line-ledger.csv · native528-country-text-lineage.csv · source-text-classification-contract.json

actual360-four-country-growth-CPI-1980-2024.csv · README

선택표·예측·단어·비교지표 전체: class-counts.csv · core-frames.csv · role-metrics.csv · selected-explanations.csv · selected-predictions.csv · source-figure-observations.csv · study-metrics.csv · validation-candidates.csv · vocabulary-word-counts.csv

Python · base R · 공식 원 ZIP

Read retained annual GDP growth and CPI inflation for Germany, Japan, Korea and the United States. Serialize the previous year’s two values into declared English text containing sign words and native numerical tokens. The target is nonnegative current-year GDP growth. The economic observations are real; the sentences are constructed representations, not citizen reviews or public opinion.

The four countries over 1981–2024 provide 176 rows:100 training through 2005, 36 validation over 2006–2014 and 40 test over 2015–2024. We reread the same 2026-10-08 retained vintage. Prior-year inputs are not the same as reconstructing historical releases and revisions for a real-time evaluation; the latter is not performed.

Country names, growth, inflation and declared sign words can survive vocabulary selection. Numerical differences such as 3.2 versus 8.1 disappear from the ASCII word representation. Native values and row addresses remain in the ledger so that this loss is inspectable. Using economic data does not establish sufficient use of its numerical time-series information.

Selected alpha is one half, with 5/36 validation errors. On 40 test rows, the model gets 32 correct, accuracy 4/5, but predicts one throughout: TP 32, FP 8, TN 0, FN 0. It misses all eight negative-growth rows. The training-majority baseline also achieves 4/5. High accuracy here does not establish useful negative-growth detection.

Country · declared text representation of economic values

Analyst-constructed English serialization of retained WDI values, not citizen reviews or public opinion. Numerical magnitude is lost by the ASCII word representation. Predicting one throughout achieves test 4/5, matching the training-majority baseline and missing all eight negative-growth rows. A common retained vintage does not reconstruct real-time releases or revisions.

Data and model scope
ItemDefinition
Selected core176
Training / validation / test100 / 36 / 40
Vocabulary selectionTraining DF descending,ASCII ties,at most32
Candidates and selectionAlpha1/2,1,2 · minimum validation errors,earliest tie
Prediction tieOne iff exact J1>J0; otherwise zero
Display and arithmeticExact counts/rational comparisons; logs and Brier display approximate
Smoothing chosen on validation only
CandidateαErrors / rowsAccuracyBrier
01/25/3631/36≈0.117661
115/3631/36≈0.118186
225/3631/36≈0.119748
Selected model and training-majority baseline
RoleRowsTP / FP / TN / FNAccuracyPrecisionRecallBrierBaseline accuracy
train10090 / 10 / 0 / 09/109/101/1≈0.0881649/10
validation3631 / 5 / 0 / 031/3631/361/1≈0.11766131/36
test4032 / 8 / 0 / 04/54/51/1≈0.1646034/5
Every selected word · training information only
WordDFClass0 countClass1 countP(word|0)P(word|1)
country10010901/151/15
cpi10010901/151/15
gdp10010901/151/15
growth10010901/151/15
inflation10010901/151/15
percent1002018041/315361/2715
previous1002018041/315361/2715
value1002018041/315361/2715
year10010901/151/15
positive991816237/31565/543
deu254211/3543/2715
jpn253221/453/181
kor251241/10549/2715
usa252231/6347/2715
negative192181/6337/2715

The next table retains every test prediction. p is a posterior inside this model, not a calibration certificate. Exact-value disclosures preserve the fraction; full text and all 432 core outputs are available in CSV.

All test rows · errors retained
Native row IDObservedPredictedp(1)Known / OOVCorrect?
DEU:201511≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Correct
DEU:201611≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Correct
DEU:201711≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Correct
DEU:201811≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Correct
DEU:201911≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Correct
DEU:202001≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Error
DEU:202111≈0.832249
Exact value4913587296254947828461863287095/5903986572122978325056600932156
15 / 0Correct
DEU:202211≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Correct
DEU:202301≈0.85484
Exact value7984579356414290221250527841529375/9340435965077623971088723677617884
15 / 0Error
DEU:202401≈0.832249
Exact value4913587296254947828461863287095/5903986572122978325056600932156
15 / 0Error
JPN:201511≈0.887939
Exact value10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0Correct
JPN:201611≈0.887939
Exact value10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0Correct
JPN:201711≈0.869714
Exact value6611305166057321828993536980975/7601704441925352325588274626036
15 / 0Correct
JPN:201811≈0.887939
Exact value10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0Correct
JPN:201901≈0.887939
Exact value10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0Error
JPN:202001≈0.869714
Exact value6611305166057321828993536980975/7601704441925352325588274626036
15 / 0Error
JPN:202111≈0.849028
Exact value27848851607176841796591237313707/32800847986516994279564925539012
15 / 0Correct
JPN:202211≈0.869714
Exact value6611305166057321828993536980975/7601704441925352325588274626036
15 / 0Correct
JPN:202311≈0.887939
Exact value10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0Correct
JPN:202401≈0.887939
Exact value10743370894843147972114497594084375/12099227503506481721952693430172884
15 / 0Error
KOR:201511≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:201611≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:201711≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:201811≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:201911≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:202001≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Error
KOR:202111≈0.944322
Exact value16797612384871565832183579144255/17788011660739596328778316789316
15 / 0Correct
KOR:202211≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:202311≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
KOR:202411≈0.952678
Exact value27296120125416294477298316109414375/28651976734079628227136511945502884
15 / 0Correct
USA:201511≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:201611≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:201711≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:201811≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:201911≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:202001≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Error
USA:202111≈0.907071
Exact value9667197331701595029950549629959/10657596607569625526545287275020
15 / 0Correct
USA:202211≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:202311≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct
USA:202411≈0.920548
Exact value15709195664015091923669643148683375/17065052272678425673507838984771884
15 / 0Correct

First test sentence DEU:2015: country DEU previous year 2014 gdp growth positive value 2.18018602168017 percent previous cpi inflation positive value 0.906794000434245 percent

Word evidence for the first test sentence
WordCountKnown?P(word|0)P(word|1)Per-token log ratio
country1Yes1/151/15≈0
deu1Yes1/3543/2715≈-0.589999
previous2Yes41/315361/2715≈0.0213313
year1Yes1/151/15≈0
gdp1Yes1/151/15≈0
growth1Yes1/151/15≈0
positive2Yes37/31565/543≈0.0189327
value2Yes41/315361/2715≈0.0213313
percent2Yes41/315361/2715≈0.0213313
cpi1Yes1/151/15≈0
inflation1Yes1/151/15≈0
Actual test posteriors · responsive web chart and original vector
Actual test posteriors · responsive web chart and original vector · Original vector
Training word log ratios · not causal effects
Training word log ratios · not causal effects · Original vector
Retained-text card · not a photograph or original scan
Retained-text card · not a photograph or original scan · Original vector

Original text, lineage and transformation definitions: native 3000-review-line-ledger.csv · native 528-country-text-lineage.csv · source-text-classification-contract.json

actual 360-four-country-growth-CPI-1980-2024.csv · README

Complete selected frames, predictions, word counts and comparison metrics: class-counts.csv · core-frames.csv · role-metrics.csv · selected-explanations.csv · selected-predictions.csv · source-figure-observations.csv · study-metrics.csv · validation-candidates.csv · vocabulary-word-counts.csv

Python · base R · Retained official ZIP

학부Undergraduate

개인 사례: 익명 영화 문장을 끝까지 추적Person case: trace anonymous movie sentences

여기서 개인 단위라는 말은 한 익명 리뷰 문장을 자세히 살펴본다는 뜻입니다. 작성자의 실명·심리상태·나이·성별을 알고 있다는 뜻이 아닙니다. 원 IMDb1,000행에서 먼저 나온 정규화 문장을 남긴 뒤 라벨별48행을 원 순서에 걸쳐 고르게 뽑습니다. 각 라벨 선택 위치의6개 묶음에서4개는 훈련,1개는 검증,1개는 시험으로 정합니다.

총96문장 중64훈련·16검증·16시험이며 각 역할 안의 라벨 수는 균형입니다. 이 선택은 명시적인 작은 교육용 코어이지 원 전체 영화 리뷰의 확률 표본이 아닙니다. 작성자·원 리뷰 문서가 중복되는지 확인할 ID도 없습니다. 서로 다른 문장 키만으로 독립적인 사람 표본이라고 부르지 않습니다.

α=1/2 선택 후 시험 혼동표는TP5·FP4·TN4·FN3입니다. 정답률9/16은 다수 클래스 동률을0으로 푸는 기준의1/2보다 이 작은 표에서1개 더 맞힌 결과입니다. 표본16개에서 차이1개라는 크기를 숨기지 않습니다. 확률을 곱하는 계산이 정교해도 주장할 수 있는 근거는 이 정도의 관측입니다.

원문·라벨·OOV·기여 단어를 함께 보며 오답을 읽습니다. 불명확한 문장,부정 표현,어순,문화적 맥락을 사람이 설명할 수 있어도 곧바로 라벨을 바꾸어 높은 성적을 만들지 않습니다. 라벨 수정이 필요하면 별도 버전과 이유를 남깁니다. 원문 전체와 선택된 모든 시험 예측은 내려받아 같은 문장을 다시 찾을 수 있습니다.

개인 · 익명 문장의 원문과 오답

익명 IMDb 문장96개의 작은 균형 코어입니다. 관측 단위는 문장이며 사람의 실명·심리상태·독립된 원 리뷰를 확인할 ID가 없습니다. 시험16행의9개 정답은 상수기준보다1개 더 맞힌 결과입니다. 아래 전체 시험 행에서 오답도 그대로 읽습니다.

자료와 모형 범위
항목정의
선택 코어96
훈련·검증·시험64 / 16 / 16
단어 선정훈련 DF내림차순·ASCII동률·최대32
후보·선택α 1/2,1,2 · 검증오류최소·먼저 나온 동률후보
예측 동률정확 J1>J0일 때1,그 외0
표시·계산정확 횟수·유리수 비교,로그와 Brier표시는 근사
검증으로만 고르는 평활
후보α오류/분모정답률Brier
01/26/165/8≈0.354582
116/165/8≈0.337722
226/165/8≈0.316896
선택 모형과 훈련 다수기준
역할행 수TP / FP / TN / FN정답률정밀도재현율Brier기준 정답률
train6423 / 5 / 27 / 925/3223/2823/32≈0.1530351/2
validation166 / 4 / 4 / 25/83/53/4≈0.3545821/2
test165 / 4 / 4 / 39/165/95/8≈0.2276271/2
선택 단어 전체 · 훈련 정보만 사용
단어DF클래스0횟수클래스1횟수P(word|0)P(word|1)
the31203041/33461/480
a20131827/33437/480
of20101521/33431/480
and1961613/33411/160
in18111123/33423/480
this1810821/33417/480
to1761213/3345/96
is1581017/3347/160
it1451111/33423/480
i1271015/3347/160
movie126613/33413/480
that9367/33413/480
film8183/33417/480
but7163/33413/480
for7255/33411/480
on7357/33411/480
was75311/3347/480
with7163/33413/480
an6337/3347/480
it's6347/3343/160
or6429/3341/96
about5327/3341/96
even5327/3341/96
my5143/3343/160
were5327/3341/96
you5265/33413/480
also4409/3341/480
are4225/3341/96
be4041/3343/160
great4133/3347/480
not4225/3341/96
one4225/3341/96

다음 표는 모든 시험 예측입니다. p는 이 모형 안의 사후확률이며 보정 인증이 아닙니다. 정확값 펼침은 원 분수를 보존하고,전체 원문·모든432코어의 결과는 CSV로 제공합니다.

모든 시험 행 · 오답을 삭제하지 않음
원 행 ID관측예측p(1)알려진/OOV정오
imdb_labelled.txt:8811≈0.741888
정확값409378882441769009/551807016227369009
5 / 6정답
imdb_labelled.txt:11800≈0.183526
정확값110303049468406790890489/601020120968784902890489
8 / 16정답
imdb_labelled.txt:199001/20 / 2정답
imdb_labelled.txt:27611≈0.929933
정확값270393647432907396582588120202751814703/290766805596128809634160016522751814703
12 / 22정답
imdb_labelled.txt:330004657463/184814633 / 1정답
imdb_labelled.txt:39111≈0.937387
정확값12919790336480645360082818842210428635975608832257313/13782769906033770773808267122583365339975608832257313
16 / 39정답
imdb_labelled.txt:45701≈0.740092
정확값192458081839666188472427743/260046085948757004472427743
10 / 6오답
imdb_labelled.txt:54410≈0.437827
정확값660497302206028687967/1508581733217868687967
7 / 12오답
imdb_labelled.txt:55701≈0.665697
정확값1605021923897429426630993/2411041367131082162630993
8 / 6오답
imdb_labelled.txt:67511≈0.962886
정확값170624088693897309882427371377/177200766552376015751227371377
9 / 21정답
imdb_labelled.txt:69801≈0.607505
정확값9813456182057/16153695542057
4 / 7오답
imdb_labelled.txt:785104657463/184814633 / 2오답
imdb_labelled.txt:854001/20 / 2정답
imdb_labelled.txt:91610≈0.472977
정확값141814825411609/299834204611609
4 / 10오답
imdb_labelled.txt:9941123733539/408407392 / 4정답
imdb_labelled.txt:100001≈0.528509
정확값273687479461387673/517848285718027673
6 / 9오답

첫 시험 문장 imdb_labelled.txt:88의 원문: The Wind and the Lion is well written and superbly acted.

첫 시험 문장의 단어 증거
단어횟수알려짐P(word|0)P(word|1)한 토큰 로그비
the2예41/33461/480≈0.0346567
wind1OOV———
and2예13/33411/160≈0.568913
lion1OOV———
is1예17/3347/160≈-0.151336
well1OOV———
written1OOV———
superbly1OOV———
acted1OOV———
실제 시험 행의 사후확률 · 모바일 웹 그래프와 원 벡터
실제 시험 행의 사후확률 · 모바일 웹 그래프와 원 벡터 · 원본 벡터
훈련 단어의 로그비 · 인과 기여 아님
훈련 단어의 로그비 · 인과 기여 아님 · 원본 벡터
보존 원문 카드 · 사진이나 원본 스캔 아님
보존 원문 카드 · 사진이나 원본 스캔 아님 · 원본 벡터

원문·계보·변환 정의: native3000-review-line-ledger.csv · native528-country-text-lineage.csv · source-text-classification-contract.json

imdb_labelled.txt · README

선택표·예측·단어·비교지표 전체: class-counts.csv · core-frames.csv · role-metrics.csv · selected-explanations.csv · selected-predictions.csv · source-figure-observations.csv · study-metrics.csv · validation-candidates.csv · vocabulary-word-counts.csv

Python · base R · 공식 원 ZIP

The person-level perspective means inspecting an anonymous review sentence closely, not knowing a writer’s identity, mental state, age or sex. Retain the first canonical sentence within the 1000-row IMDb source, then evenly select 48 per label across native order. In each six selected positions per label, four train, one validates and one tests.

The 96-sentence core contains 64 training, 16 validation and 16 test rows, balanced by label within each role. It is a declared teaching core, not a probability sample of all film reviews. Author and parent-review IDs are absent; distinct canonical sentences do not establish independent people.

After selecting alpha one half, the test confusion is TP 5, FP 4, TN 4, FN 3. Accuracy 9/16 is one more correct sentence than the tie-to-zero majority baseline’s 1/2. Do not hide that the gain is one observation in a 16-row test. Sophisticated arithmetic does not enlarge the evidence.

Read errors with raw text, provided label, OOV and contributing words together. Human interpretations of negation, order or context do not justify quietly relabeling rows to improve the score. Version any label correction with its reason. Full originals and every selected test prediction remain downloadable by native address.

Person · native text and errors in anonymous sentences

A small balanced core of 96 anonymous IMDb sentences. The observation unit is a sentence; writer identity, psychological state and independent parent-review IDs are unavailable. Nine correct out of 16 test sentences is one more than the constant baseline. All test errors remain in the table below.

Data and model scope
ItemDefinition
Selected core96
Training / validation / test64 / 16 / 16
Vocabulary selectionTraining DF descending,ASCII ties,at most32
Candidates and selectionAlpha1/2,1,2 · minimum validation errors,earliest tie
Prediction tieOne iff exact J1>J0; otherwise zero
Display and arithmeticExact counts/rational comparisons; logs and Brier display approximate
Smoothing chosen on validation only
CandidateαErrors / rowsAccuracyBrier
01/26/165/8≈0.354582
116/165/8≈0.337722
226/165/8≈0.316896
Selected model and training-majority baseline
RoleRowsTP / FP / TN / FNAccuracyPrecisionRecallBrierBaseline accuracy
train6423 / 5 / 27 / 925/3223/2823/32≈0.1530351/2
validation166 / 4 / 4 / 25/83/53/4≈0.3545821/2
test165 / 4 / 4 / 39/165/95/8≈0.2276271/2
Every selected word · training information only
WordDFClass0 countClass1 countP(word|0)P(word|1)
the31203041/33461/480
a20131827/33437/480
of20101521/33431/480
and1961613/33411/160
in18111123/33423/480
this1810821/33417/480
to1761213/3345/96
is1581017/3347/160
it1451111/33423/480
i1271015/3347/160
movie126613/33413/480
that9367/33413/480
film8183/33417/480
but7163/33413/480
for7255/33411/480
on7357/33411/480
was75311/3347/480
with7163/33413/480
an6337/3347/480
it's6347/3343/160
or6429/3341/96
about5327/3341/96
even5327/3341/96
my5143/3343/160
were5327/3341/96
you5265/33413/480
also4409/3341/480
are4225/3341/96
be4041/3343/160
great4133/3347/480
not4225/3341/96
one4225/3341/96

The next table retains every test prediction. p is a posterior inside this model, not a calibration certificate. Exact-value disclosures preserve the fraction; full text and all 432 core outputs are available in CSV.

All test rows · errors retained
Native row IDObservedPredictedp(1)Known / OOVCorrect?
imdb_labelled.txt:8811≈0.741888
Exact value409378882441769009/551807016227369009
5 / 6Correct
imdb_labelled.txt:11800≈0.183526
Exact value110303049468406790890489/601020120968784902890489
8 / 16Correct
imdb_labelled.txt:199001/20 / 2Correct
imdb_labelled.txt:27611≈0.929933
Exact value270393647432907396582588120202751814703/290766805596128809634160016522751814703
12 / 22Correct
imdb_labelled.txt:330004657463/184814633 / 1Correct
imdb_labelled.txt:39111≈0.937387
Exact value12919790336480645360082818842210428635975608832257313/13782769906033770773808267122583365339975608832257313
16 / 39Correct
imdb_labelled.txt:45701≈0.740092
Exact value192458081839666188472427743/260046085948757004472427743
10 / 6Error
imdb_labelled.txt:54410≈0.437827
Exact value660497302206028687967/1508581733217868687967
7 / 12Error
imdb_labelled.txt:55701≈0.665697
Exact value1605021923897429426630993/2411041367131082162630993
8 / 6Error
imdb_labelled.txt:67511≈0.962886
Exact value170624088693897309882427371377/177200766552376015751227371377
9 / 21Correct
imdb_labelled.txt:69801≈0.607505
Exact value9813456182057/16153695542057
4 / 7Error
imdb_labelled.txt:785104657463/184814633 / 2Error
imdb_labelled.txt:854001/20 / 2Correct
imdb_labelled.txt:91610≈0.472977
Exact value141814825411609/299834204611609
4 / 10Error
imdb_labelled.txt:9941123733539/408407392 / 4Correct
imdb_labelled.txt:100001≈0.528509
Exact value273687479461387673/517848285718027673
6 / 9Error

First test sentence imdb_labelled.txt:88: The Wind and the Lion is well written and superbly acted.

Word evidence for the first test sentence
WordCountKnown?P(word|0)P(word|1)Per-token log ratio
the2Yes41/33461/480≈0.0346567
wind1OOV———
and2Yes13/33411/160≈0.568913
lion1OOV———
is1Yes17/3347/160≈-0.151336
well1OOV———
written1OOV———
superbly1OOV———
acted1OOV———
Actual test posteriors · responsive web chart and original vector
Actual test posteriors · responsive web chart and original vector · Original vector
Training word log ratios · not causal effects
Training word log ratios · not causal effects · Original vector
Retained-text card · not a photograph or original scan
Retained-text card · not a photograph or original scan · Original vector

Original text, lineage and transformation definitions: native 3000-review-line-ledger.csv · native 528-country-text-lineage.csv · source-text-classification-contract.json

imdb_labelled.txt · README

Complete selected frames, predictions, word counts and comparison metrics: class-counts.csv · core-frames.csv · role-metrics.csv · selected-explanations.csv · selected-predictions.csv · source-figure-observations.csv · study-metrics.csv · validation-candidates.csv · vocabulary-word-counts.csv

Python · base R · Retained official ZIP

학부Undergraduate

기업 사례: 상품에서 식당으로 옮겨 보기Company case: transfer from products to restaurants

Amazon 상품 문장에서 라벨별48개를 골라 선택 위치3개마다2개는 훈련,1개는 검증으로 둡니다. 따라서64훈련·32검증입니다. Yelp 식당 문장에서는 라벨별32개를 시험으로 고릅니다. 이미 선택한 Amazon 입력과 정규화 문장 키가 같은 Yelp 문장은 제외하지만,그 시험 라벨을 보고 Amazon 훈련표를 바꾸지는 않습니다.

회사 사례라고 해서 회사 자체를 관측 단위로 회귀한 것은 아닙니다. 실제 관측은 익명 문장이고,기업명은 출처 영역을 설명합니다. 상품 리뷰에서 학습한 단어 분포가 식당 리뷰에 얼마나 옮겨지는지라는 분류 과제입니다. 원3,000문장과 라벨을 보존하며 작은 선택표와 전체 자료를 구분합니다.

선택α=1/2,검증 오류12/32입니다. Yelp시험64행은TP21·FP11·TN21·FN11로 정답42/64=21/32입니다. 정밀도와 재현율도 이 표에서는 모두21/32이지만,그 이유는 예측·실제 양성 분모가 모두32이기 때문입니다. 다른 표에서도 세 지표가 같을 것이라고 일반화하지 않습니다.

이 결과는 균형 시험표의 상수 기준1/2보다10개를 더 맞혔습니다. 그러나 현재 소비자 의견,식당 전체 서비스,플랫폼의 매출이나 인과 효과를 측정하지 않습니다. OOV와 오류 문장을 읽고 영역에 특화한 표현이 필요한지,새 자료를 적법하게 확보해 별도 검증해야 하는지 계획합니다.

기업 · 상품에서 식당으로의 영역 이동

Amazon 상품64훈련·32검증 문장에서 맞춘 규칙을 Yelp 식당64시험 문장에 옮기는 사전 선언 영역이동입니다. Yelp와 겹친 입력 키를 조사해도 시험 라벨로 Amazon 훈련표를 바꾸지 않습니다. 시험42/64정답은 회사 이익·서비스 품질·인과효과를 측정한 수치가 아닙니다.

자료와 모형 범위
항목정의
선택 코어160
훈련·검증·시험64 / 32 / 64
단어 선정훈련 DF내림차순·ASCII동률·최대32
후보·선택α 1/2,1,2 · 검증오류최소·먼저 나온 동률후보
예측 동률정확 J1>J0일 때1,그 외0
표시·계산정확 횟수·유리수 비교,로그와 Brier표시는 근사
검증으로만 고르는 평활
후보α오류/분모정답률Brier
01/212/325/8≈0.254689
1112/325/8≈0.254538
2212/325/8≈0.254915
선택 모형과 훈련 다수기준
역할행 수TP / FP / TN / FN정답률정밀도재현율Brier기준 정답률
train6424 / 4 / 28 / 813/166/73/4≈0.1315871/2
validation328 / 4 / 12 / 85/82/31/2≈0.2546891/2
test6421 / 11 / 21 / 1121/3221/3221/32≈0.2366161/2
선택 단어 전체 · 훈련 정보만 사용
단어DF클래스0횟수클래스1횟수P(word|0)P(word|1)
i23131327/2909/124
the22131927/29013/124
it2114121/1025/372
and144119/29023/372
is148717/2905/124
this143117/29023/372
a12763/5813/372
my1151011/2907/124
to108317/2907/372
not9723/585/372
with9459/29011/372
of85311/2907/372
great7071/2905/124
phone75411/2903/124
was7251/5811/372
works7163/29013/372
in6439/2907/372
very6153/29011/372
excellent5143/2903/124
have5231/587/372
on5231/587/372
one5143/2903/124
product5419/2901/124
so5231/587/372
that5419/2901/124
work5327/2905/372
for4221/585/372
good4133/2907/372
headset4133/2907/372
these4133/2907/372
well4041/2903/124
also3123/2905/372

다음 표는 모든 시험 예측입니다. p는 이 모형 안의 사후확률이며 보정 인증이 아닙니다. 정확값 펼침은 원 분수를 보존하고,전체 원문·모든432코어의 결과는 CSV로 제공합니다.

모든 시험 행 · 오답을 삭제하지 않음
원 행 ID관측예측p(1)알려진/OOV정오
yelp_labelled.txt:1113335/46371 / 3정답
yelp_labelled.txt:200106701875/4348795313 / 1정답
yelp_labelled.txt:32012005385525/24107814533 / 3오답
yelp_labelled.txt:3511182307775/3174397513 / 4정답
yelp_labelled.txt:6211483575/7257472 / 5정답
yelp_labelled.txt:7500≈0.116818
정확값7524147552589410218505859375/64409169870591155178108234031
11 / 14정답
yelp_labelled.txt:90111063865/13752292 / 3정답
yelp_labelled.txt:11310≈0.356174
정확값249146363009375/699507185759423
5 / 8오답
yelp_labelled.txt:1170139875/744712 / 2오답
yelp_labelled.txt:14510≈0.380459
정확값3890516283915625/10225844160248233
6 / 13오답
yelp_labelled.txt:14700≈0.268192
정확값718332265625/2678428012361
4 / 10정답
yelp_labelled.txt:173113006575/39406672 / 3정답
yelp_labelled.txt:18200≈0.0385654
정확값8212262995929671123046875/212943748277994069138144731
10 / 13정답
yelp_labelled.txt:20111≈0.507464
정확값261861672955859375/516020120700496943
7 / 11정답
yelp_labelled.txt:21900911538875/24752088833 / 5정답
yelp_labelled.txt:233112544025/28553892 / 2정답
yelp_labelled.txt:24600149382625/7692737533 / 8정답
yelp_labelled.txt:26411≈0.768791
정확값5480101598125/7128209786557
4 / 4정답
yelp_labelled.txt:28800≈0.434568
정확값513291503725/1181152338253
5 / 12정답
yelp_labelled.txt:29311≈0.938476
정확값916702899397619140625/976799819632510260113
7 / 8정답
yelp_labelled.txt:31701≈0.979111
정확값11853990008524549725302734375/12106893607990629275791972903
10 / 15오답
yelp_labelled.txt:32410≈0.342344
정확값185042391625/540516706777
4 / 8오답
yelp_labelled.txt:34910273325/5846892 / 5오답
yelp_labelled.txt:36101≈0.748749
정확값2740609993103125/3660254362248181
5 / 7오답
yelp_labelled.txt:376101015/26891 / 5오답
yelp_labelled.txt:39700≈0.0447398
정확값17276323873262822265625/386151220275024513682969
8 / 8정답
yelp_labelled.txt:40510≈0.294907
정확값589893168123009761130859375/2000265622288342280790422383
11 / 14오답
yelp_labelled.txt:43100145/3311 / 3정답
yelp_labelled.txt:43511203/3891 / 2정답
yelp_labelled.txt:46311≈0.688414
정확값1314726192495625/1909790196060073
5 / 7정답
yelp_labelled.txt:47201≈0.67103
정확값373532778125/556655910173
4 / 7오답
yelp_labelled.txt:49110145/3311 / 6오답
yelp_labelled.txt:510001/20 / 2정답
yelp_labelled.txt:51511610334725/11315580613 / 5정답
yelp_labelled.txt:54011≈0.719641
정확값23012403819360921875/31977638097062895443
6 / 8정답
yelp_labelled.txt:55501≈0.771315
정확값418978676729375/543200791951583
6 / 6오답
yelp_labelled.txt:57511215964595/2738782993 / 8정답
yelp_labelled.txt:582001/20 / 2정답
yelp_labelled.txt:60411533509375/5356543273 / 3정답
yelp_labelled.txt:61700147175/5277312 / 6정답
yelp_labelled.txt:63811≈0.933358
정확값190399782250528509564632568359375/203994362336228149721631096193487
11 / 14정답
yelp_labelled.txt:646011595/21531 / 2오답
yelp_labelled.txt:665101/20 / 2오답
yelp_labelled.txt:68811≈0.544464
정확값6228659075234375/11439977167056359
5 / 6정답
yelp_labelled.txt:69700≈0.0224798
정확값2313525109984760546875/102915769583192494569787
8 / 16정답
yelp_labelled.txt:7171076531/1803192 / 4오답
yelp_labelled.txt:73601416875/7282392 / 6오답
yelp_labelled.txt:740101015/41771 / 6오답
yelp_labelled.txt:76811601315/9126792 / 2정답
yelp_labelled.txt:77401601315/9126792 / 6오답
yelp_labelled.txt:79711≈0.957494
정확값6119782114599278125/6391455880590247021
6 / 6정답
yelp_labelled.txt:81101≈0.890014
정확값4715485464063353387890625/5298212651773214103303617
9 / 11오답
yelp_labelled.txt:83300≈0.438096
정확값814214376483599609375/1858528332952884045599
8 / 12정답
yelp_labelled.txt:8401114234030125/250059790694 / 8정답
yelp_labelled.txt:86911≈0.979704
정확값4371272938999484375/4461830860996474007
6 / 7정답
yelp_labelled.txt:87100≈0.39213
정확값253384799658203125/646175127990824821
7 / 9정답
yelp_labelled.txt:899001276154425/42297533293 / 5정답
yelp_labelled.txt:91900≈0.471674
정확값5366229357125/11376976867877
5 / 11정답
yelp_labelled.txt:923108045321375/690863653914 / 9오답
yelp_labelled.txt:936013335/46371 / 3오답
yelp_labelled.txt:95200≈0.407598
정확값819065245099546279327128466796875/2009494843933670923366583835175243
11 / 12정답
yelp_labelled.txt:96800145/3311 / 5정답
yelp_labelled.txt:98400≈0.232678
정확값9153420727953125/39339394726949669
6 / 15정답
yelp_labelled.txt:100000≈0.097059
정확값128847574591310357275390625/1327517399710493848879915169
9 / 19정답

첫 시험 문장 yelp_labelled.txt:1의 원문: Wow... Loved this place.

첫 시험 문장의 단어 증거
단어횟수알려짐P(word|0)P(word|1)한 토큰 로그비
wow1OOV———
loved1OOV———
this1예7/29023/372≈0.940571
place1OOV———
실제 시험 행의 사후확률 · 모바일 웹 그래프와 원 벡터
실제 시험 행의 사후확률 · 모바일 웹 그래프와 원 벡터 · 원본 벡터
훈련 단어의 로그비 · 인과 기여 아님
훈련 단어의 로그비 · 인과 기여 아님 · 원본 벡터
보존 원문 카드 · 사진이나 원본 스캔 아님
보존 원문 카드 · 사진이나 원본 스캔 아님 · 원본 벡터

원문·계보·변환 정의: native3000-review-line-ledger.csv · native528-country-text-lineage.csv · source-text-classification-contract.json

amazon_cells_labelled.txt · yelp_labelled.txt · README

선택표·예측·단어·비교지표 전체: class-counts.csv · core-frames.csv · role-metrics.csv · selected-explanations.csv · selected-predictions.csv · source-figure-observations.csv · study-metrics.csv · validation-candidates.csv · vocabulary-word-counts.csv

Python · base R · 공식 원 ZIP

Select 48 Amazon product sentences per label; within each three selected positions, two train and one validates, giving 64 training and 32 validation rows. Select 32 Yelp restaurant sentences per label for test. Exclude Yelp text canonically matching selected Amazon inputs without changing Amazon training selection based on Yelp labels.

This is not a regression whose observation unit is a company. Observations are anonymous sentences; platform names describe source domains. The task tests transfer of product-review word distributions to restaurant reviews. Retain all 3000 originals and distinguish the small selected frame from the complete source.

Selected alpha is one half, with 12/32 validation errors. Yelp test confusion is TP 21, FP 11, TN 21, FN 11, giving 42/64=21/32 accuracy. Precision and recall happen to equal 21/32 here because both their denominators equal 32. They need not agree on another frame.

The model gets ten more test sentences correct than the balanced-frame constant baseline. It does not measure current consumer opinion, overall restaurant service, platform revenue or causal effects. Inspect OOV and errors, then plan domain-specific representations or newly sourced external validation.

Company · transfer from products to restaurants

A declared domain transfer from 64 Amazon training and 32 Amazon validation sentences to 64 Yelp test sentences. Input-key overlap checks do not change Amazon training based on Yelp labels. Test accuracy 42/64 does not measure company profit, overall service quality or causal effects.

Data and model scope
ItemDefinition
Selected core160
Training / validation / test64 / 32 / 64
Vocabulary selectionTraining DF descending,ASCII ties,at most32
Candidates and selectionAlpha1/2,1,2 · minimum validation errors,earliest tie
Prediction tieOne iff exact J1>J0; otherwise zero
Display and arithmeticExact counts/rational comparisons; logs and Brier display approximate
Smoothing chosen on validation only
CandidateαErrors / rowsAccuracyBrier
01/212/325/8≈0.254689
1112/325/8≈0.254538
2212/325/8≈0.254915
Selected model and training-majority baseline
RoleRowsTP / FP / TN / FNAccuracyPrecisionRecallBrierBaseline accuracy
train6424 / 4 / 28 / 813/166/73/4≈0.1315871/2
validation328 / 4 / 12 / 85/82/31/2≈0.2546891/2
test6421 / 11 / 21 / 1121/3221/3221/32≈0.2366161/2
Every selected word · training information only
WordDFClass0 countClass1 countP(word|0)P(word|1)
i23131327/2909/124
the22131927/29013/124
it2114121/1025/372
and144119/29023/372
is148717/2905/124
this143117/29023/372
a12763/5813/372
my1151011/2907/124
to108317/2907/372
not9723/585/372
with9459/29011/372
of85311/2907/372
great7071/2905/124
phone75411/2903/124
was7251/5811/372
works7163/29013/372
in6439/2907/372
very6153/29011/372
excellent5143/2903/124
have5231/587/372
on5231/587/372
one5143/2903/124
product5419/2901/124
so5231/587/372
that5419/2901/124
work5327/2905/372
for4221/585/372
good4133/2907/372
headset4133/2907/372
these4133/2907/372
well4041/2903/124
also3123/2905/372

The next table retains every test prediction. p is a posterior inside this model, not a calibration certificate. Exact-value disclosures preserve the fraction; full text and all 432 core outputs are available in CSV.

All test rows · errors retained
Native row IDObservedPredictedp(1)Known / OOVCorrect?
yelp_labelled.txt:1113335/46371 / 3Correct
yelp_labelled.txt:200106701875/4348795313 / 1Correct
yelp_labelled.txt:32012005385525/24107814533 / 3Error
yelp_labelled.txt:3511182307775/3174397513 / 4Correct
yelp_labelled.txt:6211483575/7257472 / 5Correct
yelp_labelled.txt:7500≈0.116818
Exact value7524147552589410218505859375/64409169870591155178108234031
11 / 14Correct
yelp_labelled.txt:90111063865/13752292 / 3Correct
yelp_labelled.txt:11310≈0.356174
Exact value249146363009375/699507185759423
5 / 8Error
yelp_labelled.txt:1170139875/744712 / 2Error
yelp_labelled.txt:14510≈0.380459
Exact value3890516283915625/10225844160248233
6 / 13Error
yelp_labelled.txt:14700≈0.268192
Exact value718332265625/2678428012361
4 / 10Correct
yelp_labelled.txt:173113006575/39406672 / 3Correct
yelp_labelled.txt:18200≈0.0385654
Exact value8212262995929671123046875/212943748277994069138144731
10 / 13Correct
yelp_labelled.txt:20111≈0.507464
Exact value261861672955859375/516020120700496943
7 / 11Correct
yelp_labelled.txt:21900911538875/24752088833 / 5Correct
yelp_labelled.txt:233112544025/28553892 / 2Correct
yelp_labelled.txt:24600149382625/7692737533 / 8Correct
yelp_labelled.txt:26411≈0.768791
Exact value5480101598125/7128209786557
4 / 4Correct
yelp_labelled.txt:28800≈0.434568
Exact value513291503725/1181152338253
5 / 12Correct
yelp_labelled.txt:29311≈0.938476
Exact value916702899397619140625/976799819632510260113
7 / 8Correct
yelp_labelled.txt:31701≈0.979111
Exact value11853990008524549725302734375/12106893607990629275791972903
10 / 15Error
yelp_labelled.txt:32410≈0.342344
Exact value185042391625/540516706777
4 / 8Error
yelp_labelled.txt:34910273325/5846892 / 5Error
yelp_labelled.txt:36101≈0.748749
Exact value2740609993103125/3660254362248181
5 / 7Error
yelp_labelled.txt:376101015/26891 / 5Error
yelp_labelled.txt:39700≈0.0447398
Exact value17276323873262822265625/386151220275024513682969
8 / 8Correct
yelp_labelled.txt:40510≈0.294907
Exact value589893168123009761130859375/2000265622288342280790422383
11 / 14Error
yelp_labelled.txt:43100145/3311 / 3Correct
yelp_labelled.txt:43511203/3891 / 2Correct
yelp_labelled.txt:46311≈0.688414
Exact value1314726192495625/1909790196060073
5 / 7Correct
yelp_labelled.txt:47201≈0.67103
Exact value373532778125/556655910173
4 / 7Error
yelp_labelled.txt:49110145/3311 / 6Error
yelp_labelled.txt:510001/20 / 2Correct
yelp_labelled.txt:51511610334725/11315580613 / 5Correct
yelp_labelled.txt:54011≈0.719641
Exact value23012403819360921875/31977638097062895443
6 / 8Correct
yelp_labelled.txt:55501≈0.771315
Exact value418978676729375/543200791951583
6 / 6Error
yelp_labelled.txt:57511215964595/2738782993 / 8Correct
yelp_labelled.txt:582001/20 / 2Correct
yelp_labelled.txt:60411533509375/5356543273 / 3Correct
yelp_labelled.txt:61700147175/5277312 / 6Correct
yelp_labelled.txt:63811≈0.933358
Exact value190399782250528509564632568359375/203994362336228149721631096193487
11 / 14Correct
yelp_labelled.txt:646011595/21531 / 2Error
yelp_labelled.txt:665101/20 / 2Error
yelp_labelled.txt:68811≈0.544464
Exact value6228659075234375/11439977167056359
5 / 6Correct
yelp_labelled.txt:69700≈0.0224798
Exact value2313525109984760546875/102915769583192494569787
8 / 16Correct
yelp_labelled.txt:7171076531/1803192 / 4Error
yelp_labelled.txt:73601416875/7282392 / 6Error
yelp_labelled.txt:740101015/41771 / 6Error
yelp_labelled.txt:76811601315/9126792 / 2Correct
yelp_labelled.txt:77401601315/9126792 / 6Error
yelp_labelled.txt:79711≈0.957494
Exact value6119782114599278125/6391455880590247021
6 / 6Correct
yelp_labelled.txt:81101≈0.890014
Exact value4715485464063353387890625/5298212651773214103303617
9 / 11Error
yelp_labelled.txt:83300≈0.438096
Exact value814214376483599609375/1858528332952884045599
8 / 12Correct
yelp_labelled.txt:8401114234030125/250059790694 / 8Correct
yelp_labelled.txt:86911≈0.979704
Exact value4371272938999484375/4461830860996474007
6 / 7Correct
yelp_labelled.txt:87100≈0.39213
Exact value253384799658203125/646175127990824821
7 / 9Correct
yelp_labelled.txt:899001276154425/42297533293 / 5Correct
yelp_labelled.txt:91900≈0.471674
Exact value5366229357125/11376976867877
5 / 11Correct
yelp_labelled.txt:923108045321375/690863653914 / 9Error
yelp_labelled.txt:936013335/46371 / 3Error
yelp_labelled.txt:95200≈0.407598
Exact value819065245099546279327128466796875/2009494843933670923366583835175243
11 / 12Correct
yelp_labelled.txt:96800145/3311 / 5Correct
yelp_labelled.txt:98400≈0.232678
Exact value9153420727953125/39339394726949669
6 / 15Correct
yelp_labelled.txt:100000≈0.097059
Exact value128847574591310357275390625/1327517399710493848879915169
9 / 19Correct

First test sentence yelp_labelled.txt:1: Wow... Loved this place.

Word evidence for the first test sentence
WordCountKnown?P(word|0)P(word|1)Per-token log ratio
wow1OOV———
loved1OOV———
this1Yes7/29023/372≈0.940571
place1OOV———
Actual test posteriors · responsive web chart and original vector
Actual test posteriors · responsive web chart and original vector · Original vector
Training word log ratios · not causal effects
Training word log ratios · not causal effects · Original vector
Retained-text card · not a photograph or original scan
Retained-text card · not a photograph or original scan · Original vector

Original text, lineage and transformation definitions: native 3000-review-line-ledger.csv · native 528-country-text-lineage.csv · source-text-classification-contract.json

amazon_cells_labelled.txt · yelp_labelled.txt · README

Complete selected frames, predictions, word counts and comparison metrics: class-counts.csv · core-frames.csv · role-metrics.csv · selected-explanations.csv · selected-predictions.csv · source-figure-observations.csv · study-metrics.csv · validation-candidates.csv · vocabulary-word-counts.csv

Python · base R · Retained official ZIP

학부Undergraduate

여섯 실습을 하나의 조사로 연결하기Connect six labs into one investigation

A에서는 원문이 어떤 토큰과 위치로 바뀌는지 봅니다. B에서는 훈련 DF와 단어 목록을 만들고,C에서는 α와 클래스 횟수로 확률을 맞춥니다. D는 고정된 모형으로 새 문장을 예측하고 정확 오즈·OOV·로그 설명을 보여줍니다. E는 중복·충돌·역할 경계를 조사합니다. F는 세 실제 코어를 원 행과 함께 다시 계산합니다.

처음에는 기본 설정으로 계산하고,예상한 결과와 비교한 뒤 변수 하나만 바꾸세요. 예를 들어 bright를 반복한 뒤 원문을 원래대로 복구하고 not을 추가합니다. 다음에는 α를 크게 바꾸어 정확한 반쪽 경계와 표시 소수를 비교합니다. 변경을 누적한 채 앞의 결과와 비교하면 원인을 잘못 짚을 수 있습니다.

F의 국가·개인·기업을 바꾸면 단위와 목표가 달라집니다. 선택한 원 행을 바꿔도 훈련과검증 선택은 그대로이며 해당문장의설명만달라져야 합니다. 언어·보기단위·페이지·정확값펼침은계산설정을바꾸지않는읽기기능입니다. 원문주소와예측ID가일치하는지도확인하세요.

마지막에는 실제 오답 하나와 단순 기준을 넘지 못한 사례 하나를 골라,무엇을 새로 측정해야 개선 주장을 할 수 있을지 적습니다. 결과가좋지않은자료를지우는대신질문을구체화하는것이실습의마무리입니다.

Lab A inspects text, tokens and positions. B builds training DF and vocabulary; C fits probabilities from alpha and class counts. D predicts new sentences with a fixed model and explains exact odds, OOV and approximate logs. E investigates duplicates, collisions and roles. F recomputes the three observed cores with native addresses.

Run defaults first, predict the outcome, and change one variable at a time. Repeat bright, restore the sentence, then add not. Next enlarge alpha and distinguish the exact half-boundary from its decimal display. Accumulating changes makes causal attribution within the experiment confusing.

Switching source cases changes units and targets. Changing the selected native row should change its explanation, not training or validation selection. Language, display units, pages and exact-value disclosures are reading controls, not retraining. Confirm agreement between the native address and prediction ID.

Finish with one actual error and one case that fails to beat a simple baseline. Specify what new measurement would support an improvement claim. Refine the question instead of deleting inconvenient results.

학부Undergraduate

학자·공식 강의·원문을 함께 읽기Read researchers, an official lecture and primary material together

Daniel Jurafsky·James H. Martin의 공개 Speech and Language Processing는 텍스트 분류의 정의·가정·평가를 연결해 읽는 자료입니다. 현재 공개 판본의 나이브베이즈는 부록B에 있으며,4장은 로지스틱회귀입니다. 오래된 장번호를 그대로 따라가지 말고 저자 공식 목차에서 판본을 확인하세요. 이 장의 예시 문장과 손계산은 별도로 구성했습니다.

저자 공식 부록B에서 조건부 독립·평활·OOV 설명을 읽고 이 장의 Jc가 무엇을 포함하는지 비교하세요. 부록의 모형카드 논의와 우리 자료의 작성자·원 리뷰 ID 부재도 연결해 보세요. 전체 교재를 읽었다는 주장 대신 실제로 공부한 절과 질문을 학습 일지에 남깁니다.

Andrew Ng의 Stanford CS229 공식5강은 GDA와 나이브베이즈를 다룹니다. 아래 영상은 본문에서 재생합니다. 조건부 독립 가정과 단어별 확률을 설명하는 부분을 보고,우리의 ASCII토큰화·작은DF목록·원자료설계 중 강의와 같은점과 다른점을 각각 적어보세요.

자료를 만든 Kotzias 외 연구자의2015년 From Group to Individual Labels using Deep Features는 원 README가 요청하는 인용입니다. 이 데이터로 단순 나이브베이즈를 계산한 실습을 그 논문의 모든방법·결과를재현했다고부르지않습니다. UCI 공식 자료 설명·원 README·공식 강의·자신의 계산을 구분해 읽습니다.

Daniel Jurafsky and James H. Martin connect text classification, assumptions and evaluation in their public Speech and Language Processing. In the current public edition, Naive Bayes is Appendix B, while chapter four is logistic regression. Check the authors’ official contents rather than reusing an old chapter number. Our worked toy sentences are independently constructed.

Read conditional independence, smoothing and OOV in the authors’ Appendix B, then compare what our Jc includes. Connect its model-card discussion to missing author and parent-review IDs. Record studied sections and questions instead of claiming to have read an entire book.

Andrew Ng’s official Stanford CS 229 lecture five covers GDA and Naive Bayes. Play it here in the page. After its treatment of conditional independence and word probabilities, list similarities and differences from our ASCII tokenizer, compact DF vocabulary and source design.

The native README requests citation of Kotzias and colleagues’2015 From Group to Individual Labels using Deep Features. Our Naive Bayes exercise is not a reproduction of every method or result in that paper. Distinguish the official UCI description, README, lecture and your own calculations.

학부Undergraduate

재현 보고서와 다음 질의응답 프로젝트A replication report and the next grounded QA project

보고서 첫 문장은 어떤 자료의 어떤 단위를 예측했는지 설명해야 합니다. 그다음 원본·분할·토큰화·단어목록·평활·선택기준을 적고,검증표와 시험표를 분리합니다. 정확한 분수·짧은 소수·분모·기준모형·오류문장을 같은결론의근거로연결하세요. 원자료를내려받지않아도핵심을읽을수있되독립재현할코드와전체자료는함께둡니다.

공개 Python·base R은 보존 원문과 WDI CSV를 읽고 선택표를 다시 만듭니다. 미리 계산한 엔진응답이나 modelJSON을 정답으로 읽는 방식이 아닙니다. 두 구현의 정수 비교와 표시 근사는 구분합니다. 실행결과가 같아도 동일자료를반복했을뿐새로운외부검증을한것은아닙니다.

확장과제는 세 가지입니다. 첫째,훈련에서만 정한 바이그램 모형을 같은 분할로 비교합니다. 둘째,작성자와 원문문서 단위를 알 수 있는 새 적법한 자료로 외부평가를설계합니다. 셋째,실제문장을근거로출처를보여주는질의응답시스템으로연결합니다. 각확장은새목표와평가셋을정한뒤진행합니다.

다음 장은 문서가 있는 질의응답 프로젝트입니다. 분류라벨 대신 답의 근거 문서와 평가 질문을 추적합니다. 이번 장에서 배운 원문바이트·주소·역할·정보손실·독립성·정확성과타당성의구분은그대로필요합니다. 그럴듯한문장보다다시찾을수있는근거를우선하는습관을다음프로젝트로가져갑니다.

Start the report with the source, observation unit and target. Then specify originals, splits, tokenizer, vocabulary, smoothing and selection; keep validation and test results separate. Connect fractions, short decimals, denominators, baselines and errors to an assessable conclusion. Readers should understand the core result without downloading everything, while full data and code permit independent replication.

Public Python and base R read the retained review texts and WDI CSV to rebuild the frames. They do not use cached engine responses or model JSON as an answer key. Distinguish integer decision comparisons from approximate displays. Agreement between implementations on the same source is replication, not new external validation.

Three extensions are useful: compare a training-only bigram representation under the same splits; design external validation using newly obtained appropriate author/document-level data; or build source-grounded question answering. Declare each new target and evaluation set before proceeding.

The next chapter builds a question-answering project with source documents and an evaluation set. Instead of sentence labels, we trace answer evidence. Native bytes, addresses, roles, information loss, dependence and the difference between exactness and validity remain essential. Carry the habit of retrievable evidence into that project.

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

공식 자료의 단위·라벨·이용 조건Units,labels and use conditions in the official source

UCI

3,000문장의 세 영역·균형 라벨·공개 연도·DOI·라이선스를 읽습니다.Read the three domains,balanced labels,release year,DOI and license for3000 sentences.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 500:500이면 현재 고객 만족도가50%인가요?Does500:500 establish50% current customer satisfaction?

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

아닙니다. 선택된 문장 라벨의 구성과 현재 모집단의 비율을 구분합니다.No. Distinguish the selected label composition from a present population rate.

나이브베이즈의 가정·평활·OOVNaive Bayes assumptions,smoothing and OOV

Jurafsky and Martin

현재 공개 판본의 부록B에서 조건부 독립·평활·단어 밖 입력과 모형카드를 연결해 읽습니다.Connect conditional independence,smoothing,OOV and model-card discussion in the current Appendix B.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading Jc는 조건부 가능도만인가요?Is Jc only a conditional likelihood?

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

사전확률까지 곱한 알려진 토큰열의 결합 점수입니다. 길이를 조건으로 두며 원문 전체의 확률은 아닙니다.It includes the prior and retained-token sequence likelihood,conditions on length and is not a probability for the complete raw text.

공식 강의와 우리 구현 비교Compare the official lecture with our implementation

Stanford CS229

공식5강의 나이브베이즈와 이 장의 ASCII·DF32·검증 선택을 비교합니다.Compare lecture-five Naive Bayes with our ASCII representation,DF32 vocabulary and validation selection.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 반복 단어는 왜 확신을 키우고 언제 과신할 수 있나요?Why can repeated words increase confidence and when can that be overconfidence?

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

조건부 확률을 횟수만큼 곱합니다. 실제 의존한 증거까지 독립처럼 세면 새 정보 없이 확신이 커질 수 있습니다.Conditional probabilities are multiplied by occurrence count; dependent evidence can increase confidence without new information.

원 README와 재현 명세The native README and replication specification

Native UCI archive README

원 형식 sentence<TAB>label과 명료한 비중립 문장 선택·원 논문 인용을 확인합니다.Inspect the native sentence<TAB>label format,selection of clear non-neutral sentences and requested citation.

공식 자료 읽기 ↗Read official resource ↗

보고 읽은 뒤 답하기Respond after watching/reading 새 다운로드가 새 관측을 뜻하나요?Does a new download mean new observations?

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

아닙니다. 기존2015자료의 확보 시점과 리뷰가 관측된 시점은 다릅니다. 원문·출처·분할을 보존합니다.No. Acquisition of an existing2015 corpus differs from observation time. Retain native text,provenance and splits.

생성적 분류와 나이브 베이즈Generative classification and naive Bayes

Stanford Engineering Everywhere / Andrew Ng, CS229 Lecture 5

본문 강의에서 분류 모형의 가정과 확률 계산을 연결합니다.Connect classification assumptions with probability calculations in the in-page lecture.

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

보고 읽은 뒤 답하기Respond after watching/reading 주어진 클래스 안에서 특성이 조건부 독립이라는 가정은 관측 자료에서 자동으로 참이 되나요?Is conditional independence of features given the class automatically true in observed data?

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

아닙니다. 나이브 베이즈가 사용하는 모형 가정입니다. 예측 평가와 가정의 타당성을 구분하고, 이 장의 훈련·검증·시험 정보 경계를 함께 확인하세요.No. It is a modeling assumption used by naive Bayes. Separate predictive evaluation from the validity of that assumption, and check the training, validation and test information boundaries.

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

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

1. 균형 자료의 뜻What a balanced corpus means

한 파일은 긍정500·부정500문장입니다. 이 자료로 현재 고객 만족도가50%라고 말할 수 있나요?

One source contains 500 positive and 500 negative sentences. Does this establish present customer satisfaction of 50%?

풀이와 확인할 이유Solution and explanation

아닙니다. 500:500은 자료 제작자가 고른 라벨 구성입니다. 모든 고객의 확률 표본인지, 중립 의견을 포함했는지, 현재 의견인지 확인되지 않습니다. 표 안의 라벨 비율1/2은 정확하지만 현재 모집단 만족도라는 해석은 별도 근거가 필요합니다.

No. The 500:500 ratio is a provider-selected label composition. It is not established as a probability sample of all current customers or as including neutral opinions. The within-table fraction 1/2 is exact; population satisfaction requires additional evidence.

2. 원행 경계를 지키기Respect native record boundaries

IMDb 파일을 splitlines로 읽어1002조각을 얻었습니다. 원LF행은1000개입니다. 두 조각을 그냥 버려도 될까요?

A generic splitlines call gives 1002 IMDb pieces but the native file has 1000 LF records. Should two pieces simply be discarded?

풀이와 확인할 이유Solution and explanation

아닙니다. 내부 유니코드 구분자가 문장 안에 들어 있기 때문인지 확인합니다. 원 LF 바이트로 나누고 마지막 탭에서 라벨을 분리하면 문장 내용과1000개 라벨을 보존할 수 있습니다. 단순히 두 조각을 버리면 다른 관측의 일부나 라벨 대응을 잃을 수 있습니다.

No. Check whether Unicode separator characters occur inside sentences. Split native LF bytes and the final tab to preserve all 1000 sentences and labels. Dropping two arbitrary pieces can lose sentence content or its label pairing.

3. 문장 주소와 사람 IDA sentence address is not a person ID

imdb_labelled.txt:17과 imdb_labelled.txt:18이 다른 사람의 독립 리뷰라는 결론이 가능한가요?

Do imdb_labelled.txt:17 and imdb_labelled.txt:18 establish independent reviews by different people?

풀이와 확인할 이유Solution and explanation

확인되는 것은 원 파일에서 서로 다른 두 행이라는 사실뿐입니다. 작성자와 부모 리뷰 문서 ID가 없어 같은 사람이 썼거나 같은 리뷰에서 나온 문장일 가능성을 배제할 수 없습니다. 행 ID는 자료를 찾는 주소로만 사용합니다.

They establish two different native rows only. Without author and parent-review IDs, the sentences could share an author or source review. Use row IDs as provenance addresses, not independence certificates.

4. 이모지 뒤 위치Positions after an emoji

A🍎B에서 B의 코드포인트 구간과 ASCII단어 목록을 구하세요.

Find the code-point span of B and the ASCII words in A🍎B.

풀이와 확인할 이유Solution and explanation

A·사과·B는 각각 코드포인트0·1·2이므로 B는[2,3)입니다. ASCII소문자화 후 단어는 a와 b입니다. 사과는 원문에 남지만 단어 입력에 포함되지 않습니다. UTF-16 코드단위 위치로 답한[3,4)와 혼동하지 않습니다.

A, the apple and B occupy code-point positions 0, 1, 2. B has span [2, 3), and the words are a and b. The apple remains in the raw string but not in the word input. Do not substitute its UTF-16 code-unit span [3, 4).

5. 중복인가 표현 충돌인가Duplicate or representation collision?

GOOD film/good film과 rating 1/rating 5를 구분하세요.

Distinguish GOOD film/good film from rating 1/rating 5.

풀이와 확인할 이유Solution and explanation

첫 쌍은 원문이 다르지만 ASCII대소문자·공백 정규화 키가 같습니다. 두 번째는 정규화 키가 다르지만 숫자를 버리는 단어 표현이 rating으로 같습니다. 첫 쌍은 정규화 중복, 두 번째는 이 표현에서의 충돌입니다. 둘을 모두 원문 복제로 부르면 원인을 놓칩니다.

The first pair differs in raw text but shares an ASCII-case/space canonical key. The second has different canonical keys but the same rating word representation after digit removal. Call them canonical duplication and representation collision, respectively. Neither description alone establishes copied authorship.

6. 시험 단어를 먼저 본다면Inspecting test words first

훈련에 없는 단어를 시험 문장에서 찾아 단어 목록에 추가했습니다. 시험 라벨을 안 봤으니 항상 안전한가요?

You add a word found only in test sentences to the vocabulary without viewing their labels. Is that always a clean held-out evaluation?

풀이와 확인할 이유Solution and explanation

이 장의 사전 선언은 훈련 문장만으로 단어 목록을 고르는 것입니다. 시험 입력을 보고 목록을 바꾸면 그 설계에서 벗어납니다. 비지도 전이적 평가를 별도 설계할 수는 있으나, 훈련 전용의 처음 본 입력 평가와 같은 결과라고 보고해서는 안 됩니다.

Our declared design selects vocabulary from training text alone. Changing it after seeing test inputs violates that design. A separate transductive evaluation may be possible, but it must not be reported as the same training-only held-out-input experiment.

7. 분모를 먼저 적기Write the denominator first

IMDb시험16문장 중9개를 맞혔습니다. 정답률과 “전체영화리뷰 성능” 표현의 문제를 설명하세요.

Nine of 16 IMDb test sentences are correct. Give accuracy and explain the problem with calling it performance on all movie reviews.

풀이와 확인할 이유Solution and explanation
accuracy^=9/16=0.5625\widehat{\mathrm{accuracy}}=9/16=0.5625

정확한 표 안의 정답률은56.25%입니다. 시험표는 미리 뽑은16문장이며 전체1,000문장도 모든영화리뷰도 아닙니다. 표본 선택·문서 독립성·기간·중립 문장 제외의 한계를 함께 적고 이 분모를 바꾸지 않습니다.

accuracy^=9/16=0.5625\widehat{\mathrm{accuracy}}=9/16=0.5625

Within this declared table, accuracy is 56.25%. The test frame contains 16 selected sentences, not all 1000 source sentences or all movie reviews. State the selection, dependence, time and non-neutral-label limitations beside that denominator.

8. 단어 횟수 벡터A token-count vector

목록[bright,film,dull]에 대해 bright film bright의 벡터를 쓰고 무엇을 잃는지 설명하세요.

For vocabulary[bright, film, dull], encode bright film bright and state what is lost.

풀이와 확인할 이유Solution and explanation

벡터는(2,1,0)입니다. 각 단어의 횟수는 남지만 어순은 사라집니다. film bright bright도 같은 벡터가 됩니다. 단어 목록 밖의 원문 기호·단어도 이 벡터에는 남지 않습니다.

The vector is(2, 1, 0). Counts survive but order does not; film bright bright has the same vector. Symbols and words outside the vocabulary also disappear from this vector.

9. DF와 횟수DF versus token count

네 훈련문장에서 bright·dull·film의 DF와 총횟수를 구하세요.

Find document frequency and total count of bright, dull, film in the four training sentences.

풀이와 확인할 이유Solution and explanation

bright는 p1에 두 번 있어 DF1·횟수2, dull은 n1·n2에 한 번씩 있어 DF2·횟수2, film은 네 문장에 한 번씩 있어 DF4·횟수4입니다. DF순 단어 목록에서는 film,dull이 bright보다 앞섭니다.

Bright occurs twice within p1: DF 1, count 2. Dull occurs once in n1 and n2: DF 2, count 2. Film occurs once in all four documents: DF 4, count 4. Thus film and dull precede bright in the DF ordering.

10. 평활의 분모The smoothing denominator

V=5,T1=5,α=1일 때 bright의 클래스1확률과 film의 확률을 구하세요. bright횟수2,film횟수2입니다.

With V=5, T 1=5, alpha 1 and counts bright 2, film 2, compute both class-one word probabilities.

풀이와 확인할 이유Solution and explanation
(2+1)/(5+1⋅5)=3/10(2+1)/(5+1\cdot5)=3/10

두 단어 모두3/10입니다. 분모에 α만 한 번 더하는 것이 아니라 다섯 항목에1씩 더한 합5를 더합니다. 나머지 단어 확률까지 합하면1이 됩니다.

(2+1)/(5+1⋅5)=3/10(2+1)/(5+1\cdot5)=3/10

Both probabilities are 3/10. The denominator adds alpha for all five vocabulary items, not just once. All five class-conditional probabilities sum to one.

11. 한 단어의 사후확률A one-word posterior

동일사전확률에서 bright의 클래스1·0확률은3/10·1/10입니다. 사후확률을 구하세요.

With equal priors and bright probabilities 3/10 versus 1/10, compute the positive posterior.

풀이와 확인할 이유Solution and explanation
(1/2)(3/10)(1/2)(3/10)+(1/2)(1/10)=34\frac{(1/2)(3/10)}{(1/2)(3/10)+(1/2)(1/10)}=\frac34

분자는 결합 점수3/20이고 두 점수 합은4/20입니다. 조건부 단어 확률3/10을 곧바로 사후확률이라고 답하면 라벨 간 비교와 사전확률을 생략한 것입니다.

(1/2)(3/10)(1/2)(3/10)+(1/2)(1/10)=34\frac{(1/2)(3/10)}{(1/2)(3/10)+(1/2)(1/10)}=\frac34

The numerator is joint score 3/20 and the total is 4/20. Returning 3/10 would confuse a class-conditional word probability with the posterior across classes.

12. 반복된 단어A repeated word

같은 모형으로 bright가두 번 나오면 사후확률은? 첫 예측3/4를 두 배 하면 되나요?

What is the posterior for two bright tokens? Can one double the previous 3/4?

풀이와 확인할 이유Solution and explanation
(1/2)(3/10)2(1/2)(3/10)2+(1/2)(1/10)2=910\frac{(1/2)(3/10)^2}{(1/2)(3/10)^2+(1/2)(1/10)^2}=\frac9{10}

확률을 두 배 하지 않고 조건부 확률을 곱한 뒤 다시 정규화합니다. 반복은 조건부 독립 가정 아래 점수를 강화합니다. 같은 단어를 복사한 것이 현실의 독립 증거 두 개임을 뜻하지는 않습니다.

(1/2)(3/10)2(1/2)(3/10)2+(1/2)(1/10)2=910\frac{(1/2)(3/10)^2}{(1/2)(3/10)^2+(1/2)(1/10)^2}=\frac9{10}

Multiply the conditional probabilities and renormalize; do not double a posterior. Repetition strengthens the score under the model assumption, without establishing independent real-world evidence.

13. OOV만 있는 문장An all-OOV sentence

π1=3/4,π0=1/4이고 모든 단어가 OOV입니다. 사후확률과 결정은?

The priors are π1=3/4,π0=1/4 and all words are OOV. Find posterior and prediction.

풀이와 확인할 이유Solution and explanation

알려진 토큰의 빈 곱은1이므로 J1=3/4,J0=1/4입니다. 사후확률3/4,예측1입니다. 원문에 긍정 단어가 검출된 결과가 아니라 훈련 문장 구성의 사전확률을 그대로 낸 것입니다.

The empty retained-token product is one, giving J 1=3/4 and J 0=1/4. Posterior is 3/4 and prediction one. This reflects the training prior, not detected positive evidence in the raw sentence.

14. 길이와 다항계수Length and the multinomial coefficient

횟수(2,1)인 단어 주머니의 다항계수와 두 라벨 사후확률에서의 역할을 설명하세요.

Find the multinomial coefficient for counts(2, 1) and explain its role in a two-class posterior.

풀이와 확인할 이유Solution and explanation
3!2!1!=3\frac{3!}{2!1!}=3

같은 횟수 사건에 대한 두 라벨의 조건부 가능도에 모두3이 곱해져 사후확률에서 약분됩니다. 그렇다고 원문 전체 확률을 계산한 것은 아닙니다. 길이를 고정하고 OOV·기호·어순 정보를 버린 제한된 모형의 계산입니다.

3!2!1!=3\frac{3!}{2!1!}=3

Both class scores for this same count event receive the same factor three, which cancels in the posterior. This still is not a probability for the complete raw text: length is conditioned on and OOV, symbols and order are discarded.

15. 오즈에서 확률로From odds to probability

사후오즈가9이면 사후확률은 얼마인가요?

Convert posterior odds nine into a probability.

풀이와 확인할 이유Solution and explanation
p=O/(1+O)=9/10p=O/(1+O)=9/10

오즈9는 긍정 대 부정의 비가9:1이라는 뜻입니다. 확률9나9%가 아닙니다. 로그오즈는 log9로 양수이므로 고정 경계에서는1을 예측합니다.

p=O/(1+O)=9/10p=O/(1+O)=9/10

Odds nine mean a 9:1 ratio of positive to negative mass, not probability nine or 9%. Log odds log 9 are positive, so the fixed classifier chooses one.

16. 비용 경계 도출Derive a cost boundary

CFP=3,CFN=1일 때 비용최소화 경계와 p=0.6에서의 두 기대비용을 구하세요.

For CFP=3, CFN=1, derive the cost boundary and the two expected costs at p=0.6.

풀이와 확인할 이유Solution and explanation

1을 택할 비용은3(1−0.6)=1.2,0을 택할 비용은1×0.6=0.6이므로0을 택합니다. 경계는3/(3+1)=3/4입니다. 확률이 해당 환경의 비용 계산에 적합하다는 전제가 필요하며 현재 실습의 고정1/2분류와 다른 가정입니다.

Choosing one costs 3(1−0.6)=1.2; choosing zero costs 1×0.6=0.6, so zero is cheaper. The boundary is 3/(3+1)=3/4. This assumes usable probabilities in that setting and differs from the lab’s fixed one-half rule.

17. 표시된 동률A displayed tie

정확 p>1/2인데 화면에는0.5가 보입니다. 이 장의 예측은?

Exact p exceeds one half but displays 0.5. What does this chapter predict?

풀이와 확인할 이유Solution and explanation

정확 J1>J0이므로1입니다. 표시 소수를 재입력해 동률로 바꾸지 않습니다. 정확 분수와 mathematicallyAboveHalf/표시 반올림 표지를 확인합니다. 정확 p=1/2인 경우에만 동률 규칙으로0입니다.

It predicts one because exact J 1>J 0. Do not reclassify the rounded decimal as a tie. Inspect the exact fraction and side-of-half/display-rounding flags. Only an exact half invokes the tie-to-zero rule.

18. 작은 두 점수Two tiny scores

J0=J1=10의−1000제곱입니다. 두 표시값이0이어도 사후확률을 구할 수 있나요?

J 0=J 1=10 to the power−1000. Can their posterior be found if both displays are zero?

풀이와 확인할 이유Solution and explanation
10−100010−1000+10−1000=12\frac{10^{-1000}}{10^{-1000}+10^{-1000}}=\frac12

공통 양수인10의−1000제곱을 약분하면1/2입니다. 표시값0/0은 원 수를 대체할 수 없습니다. 정확 동률이므로 예측0입니다. 수학적 정의와 유한 구현의 자원한계는 별도로 확인합니다.

10−100010−1000+10−1000=12\frac{10^{-1000}}{10^{-1000}+10^{-1000}}=\frac12

Cancel the common positive factor to obtain one half. Displayed 0/0 cannot replace the underlying values. This is an exact tie and predicts zero; resource limits of a particular implementation are a separate issue.

19. 서로 다른 세 지표Three different ratios

TP5,FP4,TN4,FN3의 정답률·정밀도·재현율을 구하세요.

Compute accuracy, precision, recall for TP 5, FP 4, TN 4, FN 3.

풀이와 확인할 이유Solution and explanation
Acc=9/16,Prec=5/9,Rec=5/8\mathrm{Acc}=9/16,\quad\mathrm{Prec}=5/9,\quad\mathrm{Rec}=5/8

전체 분모16,양성예측 분모9,실제양성 분모8을 각각 사용합니다. 5를 같은 분모로 나누지 않습니다. 실제 IMDb 작은 시험표의 이 수치가 모든 영화 문장의 성능을 보증하지는 않습니다.

Acc=9/16,Prec=5/9,Rec=5/8\mathrm{Acc}=9/16,\quad\mathrm{Prec}=5/9,\quad\mathrm{Rec}=5/8

The denominators are all 16 rows, nine positive predictions and eight positive observed labels, respectively. These observed IMDb core rates do not certify performance on all movie sentences.

20. 미정의와0을 구분Distinguish undefined from zero

TP0,FP0,TN8,FN8에서 정밀도·재현율·정답률은?

For TP 0, FP 0, TN 8, FN 8, give precision, recall, accuracy.

풀이와 확인할 이유Solution and explanation

정밀도0/0은 미정의입니다. 재현율0/8=0,정답률8/16=1/2입니다. 양성예측을 하나도 하지 않아 정밀도에 대한 관측 지지가 없다는 사실을0%라고 채워 숨기지 않습니다.

Precision 0/0 is undefined; recall 0/8 is zero; accuracy 8/16 is one half. No positive predictions support a precision estimate. Displaying 0% would hide that missing denominator.

21. 검증 동률 규칙The validation tie rule

후보[1/2,1,2]의 검증오류수가[6,6,7]입니다. 선택과 시험자료의 역할은?

Candidates[1/2, 1, 2] have validation errors[6, 6, 7]. Which is selected, and what role do test data play?

풀이와 확인할 이유Solution and explanation

최소 오류6의 첫 후보1/2을 고릅니다. 시험 라벨·시험 정답률·시험 Brier를 보고 후보1로 바꾸지 않습니다. 시험은 선택을 마친 모형의 평가에 쓰며,후보목록 순서도 선택 규칙의 일부로 기록합니다.

Choose the earliest minimum-error candidate, one half. Test labels, accuracy and Brier do not switch the choice to candidate one. Test data evaluate the already selected model; candidate ordering is part of the rule.

22. 감사의 역할The role of an audit

훈련·시험에서같은정규화문장을찾았습니다. 어떤정보를보존하고어떤결론을피해야하나요?

You find a canonical text shared across training and test. What should be retained, and what conclusion should be avoided?

풀이와 확인할 이유Solution and explanation

두 원행ID·역할·원문·라벨·정규화 규칙과 발견 시점을 보존합니다. 수정 평가를 만들면 이전 버전도 남깁니다. 해당 중복만 제거했다고 작성자·문서의 독립성 전체를 인증하지 않으며 유리한 결과만 남기지 않습니다.

Retain both native IDs, roles, text, labels, the normalization rule and when the issue was found. Keep the previous evaluation when creating a corrected version. Removing one duplication does not certify all writer/document independence or justify retaining only a favorable result.

23. 시험라벨 음성 대조A test-label negative control

시험라벨만0↔1로바꿨을때반드시같아야할출력과달라질수있는출력을구분하세요.

Flip test labels only. Which outputs must stay fixed, and which may change?

풀이와 확인할 이유Solution and explanation

훈련 단어목록·클래스 문장 수·단어 수·검증 후보 오류·선택α·모든 모형확률·예측은 같아야 합니다. 바뀐 시험 라벨에 대한 혼동표·정답률·Brier는 달라질 수 있습니다. 원 관측을 교체하는 실험이 아니라 별도 복사본의 의존성 검사입니다.

Vocabulary, class document/token counts, validation candidate errors, selected alpha, all model probabilities and predictions must stay fixed. Confusion counts, accuracy and Brier against the altered test labels may change. This is a dependency check on a private copy, not a replacement of observations.

24. 선형 로그오즈의 계수Coefficients of linear log odds

동일사전확률과bright확률3/10대1/10에서bright의로그오즈가중치와절편은?

With equal priors and bright probabilities 3/10 versus 1/10, give its log-odds weight and intercept.

풀이와 확인할 이유Solution and explanation
b=log⁡1=0,wbright=log⁡3b=\log1=0,\qquad w_{\mathrm{bright}}=\log3

bright 횟수n은 nlog3을 더합니다. 이는 단어 횟수 공간의 선형식이며 실제 단어의 독립성이나 인과효과를 뜻하지 않습니다.

b=log⁡1=0,wbright=log⁡3b=\log1=0,\qquad w_{\mathrm{bright}}=\log3

Count n contributes n log 3. This is linear in count space, without establishing independent real-world words or causal effects.

25. 사후평균과MAPPosterior mean versus MAP

Dirichlet(1,1)와횟수(2,0)에서첫항목사후평균을구하세요. 내부MAP공식을무조건같다고쓸수있나요?

For Dirichlet(1, 1) and counts(2, 0), find the first posterior mean. Is the same expression universally an interior MAP formula?

풀이와 확인할 이유Solution and explanation
E[θ1∣T]=(2+1)/(2+2)=3/4E[\theta_1\mid T]=(2+1)/(2+2)=3/4

사후는 Dirichlet(3,1)입니다. 평균3/4와 경계 최빈위치를 같다고 보면 안 됩니다. 내부 MAP조건이 여기서는 성립하지 않으며 첫 항목1인 경계를 따로 검토합니다. 평균 평활식을 모든MAP이라고 부르지 않습니다.

E[θ1∣T]=(2+1)/(2+2)=3/4E[\theta_1\mid T]=(2+1)/(2+2)=3/4

The posterior is Dirichlet(3, 1). Its mean 3/4 differs from its boundary mode. Interior-mode conditions fail here; examine the endpoint with first component one separately. Do not label the smoothing mean universally MAP.

26. 복제한 증거Duplicated evidence

항상함께나오는두특징의클래스비율이각각3입니다. 독립모형에서두기여를곱하면?

Two always-cooccurring features each have class likelihood ratio three. What does the independence model do?

풀이와 확인할 이유Solution and explanation

곱해서9를 만듭니다. 사전오즈1이면 사후확률9/10입니다. 실제로 하나의 증거를 복제한 것이라면 독립 증거가 늘지 않아도 모형이 과신할 수 있습니다. 정답률이 같아도 Brier와 보정이 달라질 수 있습니다.

It multiplies the ratios to nine, giving posterior 9/10 with prior odds one. If the features duplicate a single source of evidence, confidence can increase without new independent information. Accuracy can stay unchanged while Brier and calibration change.

27. 숫자를 버린 텍스트A text representation that drops magnitudes

growth positive value 3.2와growth positive value 8.1의숫자차이를현재단어모형이쓰나요?

Does the current word model use the magnitude difference between growth positive value 3.2 and growth positive value 8.1?

풀이와 확인할 이유Solution and explanation

아닙니다. 두 문장의 추출 단어가 growth,positive,value로 같습니다. 원 숫자는CSV와 원문에 남지만 입력표현에서는 빠집니다. 이를 성장률 전체를 이해하는 모형으로 해석할 수 없고 숫자를 쓰는 별도 기준모형과 비교할 수 있습니다.

No. Both yield growth, positive, value. The native numbers remain in the CSV/raw text but not in this representation. Do not describe it as understanding the full numerical observation; compare a separately declared numeric baseline if appropriate.

28. 도메인 이동의 분모The denominator under domain shift

Yelp64문장중42개정답을회사이익65.625%개선이라고적어도되나요?

Can 42 correct predictions among 64 Yelp sentences be called a 65.625% improvement in company profit?

풀이와 확인할 이유Solution and explanation
42/64=21/32=0.6562542/64=21/32=0.65625

아닙니다. 이는 선택된 문장 라벨 정답률입니다. 이익자료도 개입도 비교 전후도 없습니다. 회사 이익 변화와 단위·대상·식별조건이 전혀 다릅니다. 교육용 영역이동 분류의 범위로 보고합니다.

42/64=21/32=0.6562542/64=21/32=0.65625

No. This is accuracy on selected sentence labels. There are no profit observations, intervention or before/after profit comparison. Units, target and identification differ completely. Report it as a domain-shift classification exercise.

29. 미시·거시 평균Micro and macro averages

집단A는9/10,B는1/2정답입니다. 미시·거시정답률을구하세요.

Group A has 9/10 correct and B 1/2. Find micro and macro accuracy.

풀이와 확인할 이유Solution and explanation
micro=10/12=5/6,macro=(9/10+1/2)/2=7/10\mathrm{micro}=10/12=5/6,\quad\mathrm{macro}=(9/10+1/2)/2=7/10

미시는 행 비중,거시는 집단 동일비중입니다. 어느 숫자가 더 크다고 그 가중방식을 사후 선택하지 않습니다. 집단별 분모10과2도 함께 제시합니다.

micro=10/12=5/6,macro=(9/10+1/2)/2=7/10\mathrm{micro}=10/12=5/6,\quad\mathrm{macro}=(9/10+1/2)/2=7/10

Micro weights rows; macro weights groups equally. Do not choose the weighting after observing which looks better. Report group denominators ten and two as well.

30. 이항 가정The binomial assumption

정답지시변수16개로이항구간을붙이려면행ID가서로다르다는것으로충분한가요?

Are distinct row IDs sufficient for a binomial interval on 16 correctness indicators?

풀이와 확인할 이유Solution and explanation

충분하지 않습니다. 독립성·공통 성공확률·표본 선택 대상을 검토해야 합니다. 다른 행이 같은 사람이나 원 리뷰에서 왔을 수 있고 현재ID로는 확인할 수 없습니다. 9/16의 관측 비율은 보고하되 추론 가정을 자동 보증하지 않습니다.

No. Consider independence, common success probability and the sampling target. Distinct rows can share a writer or parent review, and current IDs cannot resolve that. Report the observed 9/16 fraction without automatically certifying inferential assumptions.

31. 정확성과 보정Exactness versus calibration

사후확률을정확분수로계산했습니다. 실제긍정확률의보정도증명됐나요?

A posterior was computed as an exact fraction. Does that prove real-world calibration?

풀이와 확인할 이유Solution and explanation

아닙니다. 분수의 정확성은 선언한 횟수모형의 산술에 관한 것입니다. 라벨 타당성·표본 대표성·독립성·영역이동·보정은 추가 자료와 가정을 요구합니다. 계산오차를 줄인 것과 모형오류를 없앤 것을 구분합니다.

No. Exactness concerns arithmetic under the declared count model. Label validity, representativeness, dependence, domain shift and calibration need additional evidence. Reducing numerical error does not eliminate model error.

32. 해시의 의미The meaning of a hash

다운로드해시가같으면라벨도사실이고작성자도독립이라고할수있나요?

If the download hash matches, are labels true and writers independent?

풀이와 확인할 이유Solution and explanation

아닙니다. 해시는 보존 바이트 동일성을 검사합니다. 라벨의 의미·정확성·저작자 관계는 자료설명과 별도 근거로 검토해야 합니다. 같은 잘못된 파일도 같은 해시를 가질 수 있습니다.

No. The hash checks retained byte identity. Label meaning, accuracy and authorship relationships require separate evidence. The same erroneous file can still have a matching hash.

33. 거절의 두 종류Two kinds of rejection

α=0거절과아주긴정확곱의작업예산거절을구분하세요.

Distinguish rejecting alpha zero from rejecting excessive exact-arithmetic work.

풀이와 확인할 이유Solution and explanation

α=0은 현재 양의 평활모형 계약 밖입니다. 작업예산 거절은 입력이 수학적으로 의미 있더라도 구현의 유한자원을 넘을 수 있다는 뜻입니다. 둘 다 몰래 근삿값이나 잘린 원문으로 대체하지 않고 이유를 명시합니다.

Alpha zero violates the positive-smoothing contract. A work-budget rejection can occur for a mathematically meaningful calculation beyond finite implementation resources. Neither should silently substitute approximations or truncated text.

34. 모형 카드 초안Draft a model card

“리뷰분류성공”을평가가능한두문장으로다시쓰세요.

Rewrite “review classification succeeded” as two assessable sentences.

풀이와 확인할 이유Solution and explanation

예: 원 UCI IMDb에서 선택한64훈련·16검증·16시험 문장에 훈련DF32단어 나이브베이즈를 적용하고 검증 오분류 최소로α를 골랐다. 시험 정답은9/16이며 작성자·원 리뷰 독립성과 대표성·확률 보정은 확인하지 못했다. 분모와 제한이 들어가야 성공이라는 평가를 독자가 검토할 수 있습니다.

Example: Fit a training-DF 32-word Naive Bayes model on 64 selected UCI IMDb training sentences and choose alpha by errors on 16 validation sentences. It gets 9/16 test sentences correct; writer/source-review independence, representativeness and calibration are not established. These facts let the reader assess the result.

35. 같은 관측을 다시 계산Recomputing the same observations

Python과R이각각432행을읽었습니다. 관측이864개가됐나요?

Python and R each read 432 rows. Are there now 864 observations?

풀이와 확인할 이유Solution and explanation

아닙니다. 같은432개 핵심 관측을 두 프로그램으로 재현한 것입니다. 실행 횟수2와 관측 수432를 분리합니다. 새 다운로드도 기존 자료를 확보한 것이면 새 관측을 추가하지 않습니다.

No. Two programs reproduced the same 432 core records. Separate two executions from 432 observations. A fresh download of an existing dataset also does not create new observations.

36. 국가 기준 모형The country baseline

국가시험에서모두1로예측해TP32·FP8입니다. 정답률·재현율·음성탐지와기준모형을설명하세요.

The country test predicts one throughout: TP 32, FP 8. Explain accuracy, recall, negative detection and baseline.

풀이와 확인할 이유Solution and explanation

정답률32/40=4/5,양성재현율32/32=1입니다. 그러나 TN0이므로 실제 음성8행을 하나도 맞히지 못합니다. 훈련 다수라벨1의 상수기준도4/5입니다. 높은 정답률을 경기위축 탐지 성공이라고 바꾸어 말할 수 없습니다.

Accuracy is 32/40=4/5 and positive recall 32/32=1. Yet TN 0 means all eight negative rows are missed. The training-majority constant baseline also gets 4/5. Do not translate high accuracy into successful negative-growth detection.

37. 국가 시간 경계The country time boundary

1981~2005·2006~2014·2015~2024의네나라행수를구하고실시간검증한계를설명하세요.

Count rows for four countries over 1981–2005, 2006–2014, 2015–2024, and state the real-time limitation.

풀이와 확인할 이유Solution and explanation

25×4=100훈련,9×4=36검증,10×4=40시험으로176행입니다. 목표 직전 해 수치만 입력하지만 같은 보존 빈티지를 쓰므로 당시 발표 시차·수정 이력까지 복원한 실시간 예측검증은 아닙니다.

There are 25×4=100 training, 9×4=36 validation and 10×4=40 test rows, 176 total. Inputs precede targets, but a common retained vintage does not reconstruct historical releases and revisions for real-time forecasting.

38. IMDb 개선 크기The size of the IMDb gain

16시험문장정답9개와상수기준8개의차이를설명하세요.

Explain the difference between nine correct and a constant baseline’s eight on 16 test sentences.

풀이와 확인할 이유Solution and explanation
9/16−8/16=1/16=0.06259/16-8/16=1/16=0.0625

관측 정답1개·6.25퍼센트포인트 차이입니다. 독립 모집단의 일반 개선을 증명한 것이 아니며 작은 선택표·문서 독립성 부재를 함께 남깁니다. 좋은 예시만 골라 표를 바꾸지 않습니다.

9/16−8/16=1/16=0.06259/16-8/16=1/16=0.0625

This is one observed sentence, or 6.25 percentage points. It is not proof of a general population gain. Retain the small selected frame and unavailable document-independence information rather than choosing favorable examples.

39. 같은 세 지표의 우연Why three rates happen to agree

회사시험TP21,FP11,TN21,FN11에서세지표가같은이유는?

Why do accuracy, precision and recall agree for company-test TP 21, FP 11, TN 21, FN 11?

풀이와 확인할 이유Solution and explanation
42/64=21/(21+11)=21/(21+11)=21/3242/64=21/(21+11)=21/(21+11)=21/32

정답 수와 전체 수가 각각42·64이고 양성예측과 실제양성이 모두32이기 때문입니다. 이는 현재 표의 대칭적 개수 때문이며 지표 정의가 같아서가 아닙니다. 다른 표에서는 서로 달라질 수 있습니다.

42/64=21/(21+11)=21/(21+11)=21/3242/64=21/(21+11)=21/(21+11)=21/32

Correct/all counts are 42/64, and both positive-prediction and observed-positive denominators are 32. The equality comes from this table’s symmetric counts, not identical metric definitions. Another frame can produce different values.

40. 최적α의 일반화Generalizing the chosen alpha

세사례가모두α1/2을택했습니다. 모든텍스트문제에권할수있나요?

All three cases select alpha one half. Is it universally recommended for text tasks?

풀이와 확인할 이유Solution and explanation

아닙니다. 작은 검증표와 선언된 후보·단어목록·동률 규칙에서 나온 선택입니다. 다른 라벨·영역·표본·기준에서 다를 수 있습니다. 후보별 오류 수와 기준을 보존하고 새 환경은 별도 검증합니다.

No. This choice depends on small validation frames, candidates, vocabulary and tie rules. Other labels, domains, samples or criteria can differ. Retain candidate error counts and validate a new setting separately.

41. 읽기 전 질문 세 가지Three questions before reading

공식나이브베이즈강의를보기전에이장과연결할질문세개를적으세요.

Write three questions connecting the official Naive Bayes lecture to this chapter.

풀이와 확인할 이유Solution and explanation

예: 조건부 독립이 구체적으로 어느 변수 사이의 가정인가? 평활 분모에 Vα가 들어가는 이유는? 원문 길이·OOV·숫자를 버리면 무엇의 확률을 계산하는가? 영상을 본 뒤 네 문장 손계산과 실제 오류를 근거로 답을 고쳐 씁니다.

For example: Which variables are assumed conditionally independent? Why does smoothing add V alpha to the denominator? What probability remains after conditioning on length and dropping OOV/numbers? Revise the answers using the four-document calculation and actual errors after watching.

42. 개선 실험 계획Plan an improvement experiment

not을보존한바이그램을추가하고싶습니다. 누출없이비교하는계획을쓰세요.

Plan a leakage-aware comparison that adds negation-sensitive bigrams.

풀이와 확인할 이유Solution and explanation

훈련 문장만으로 바이그램 후보·빈도 규칙을 정하고 검증으로 사전 선언한 설정을 고릅니다. 기존 단어모형과 같은 시험표에서 전체 짝예측·분모·Brier·오류를 보존합니다. 시험 결과를 본 뒤 추가 조정하면 그 표를 재사용한 탐색으로 밝히고 새 외부시험을 계획합니다.

Build bigram candidates/frequency rules from training text only and select declared settings on validation. Preserve paired predictions, denominators, Brier and errors for both models on the same test frame. Further tuning after viewing test results is exploratory reuse; plan a new external test.

자료와 출처Data and sources

실습에 추가한 실제 입력과 출처Additional observed lab inputs and provenance

실제 자료 사례Actual-data cases · 원자료·단위·결측·변환·출처Inputs, units, missingness, transformations and sources

자료별 확보일·원행 식별·단위·이용 조건은 출처 기록을 확인하세요. 학습 사본은 제공처의 현재 최신 자료와 다를 수 있습니다.Consult each source record for retrieval dates, row identifiers, units and terms. Teaching copies can differ from current provider releases.

자료사전·출처·이용 조건Data dictionary, sources and terms