TF-IDF Document Similarity and Clustering
TF-IDF document similarity and clustering represents documents as weighted term vectors, finds the most similar pairs by cosine similarity and groups documents with k-means.
TF-IDF 문서 유사도·군집 분석은 문서를 가중 단어 벡터로 나타내 코사인 유사도로 가장 비슷한 쌍을 찾고 k-평균으로 문서를 묶습니다.
Which of these 800 open-ended survey answers say nearly the same thing, and what main groups of answers are there?
개방형 설문 응답 800개 중에서 거의 같은 말을 하는 응답은 어떤 것이고, 응답이 크게 어떤 묶음으로 나뉘나요?
Convert each document to a TF-IDF vector, compute cosine similarities to list the closest pairs, and run k-means on the normalised vectors with k chosen by the silhouette. Describe each cluster by the terms with the largest centroid weights.
When to use TF-IDF Document Similarity and Clustering
- You want to find near-duplicate or closely related documents.
- You need a quick grouping of short texts with interpretable top terms.
- Documents share a vocabulary (same language and domain).
When to use something else
- Documents mix several themes each; use LDA topic modeling.
- Similar meaning is expressed with different words; use sentence embeddings.
Assumptions and requirements
- Shared words indicate shared content.
- Clusters are roughly spherical in TF-IDF space.
- Very short or empty documents are few.
What the analysis reports
- Most similar document pairs with cosine similarity
- Similarity heatmap of up to 60 documents
- Clusters with sizes and top terms
- Silhouette by number of clusters
How to report it
TF-IDF vectors of [n] documents gave a highest pairwise cosine similarity of [value] and were grouped by k-means into [k] clusters (cosine silhouette = [value]).
Related methods
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with scikit-learn.
독립 계산. scikit-learn 대조 참조 시험 1건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run TF-IDF Document Similarity and Clustering on Quorant
- Data you need
- a table (CSV or Excel) with predictor (feature) columns
- Price
- 150 credits for one analysis up to 10,000 rows (complexity level 1); larger or wider data costs more. Optional methodologist review: 900 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.