用户工具

站点工具


zh:courses:textmining2026:ch05

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
后一修订版
前一修订版
zh:courses:textmining2026:ch05 [2026/10/12 15:14]
pzczxs [AP聚类方法]
zh:courses:textmining2026:ch05 [2026/10/20 07:27] (当前版本)
pzczxs [AP聚类方法]
行 1: 行 1:
 ====== 第五章:文本聚类 ====== ====== 第五章:文本聚类 ======
 ===== 课件 ===== ===== 课件 =====
-下载:文本聚类+下载:{{ :​zh:​courses:​textmining2026:​ch05.pptx |文本聚类}}
  
 ===== 数据集 ===== ===== 数据集 =====
-下载:+下载:{{ :​zh:​courses:​textmining2026:​chapter5.zip |}}
  
 ===== 工具类 ===== ===== 工具类 =====
行 1141: 行 1141:
 } }
 </​file>​ </​file>​
 +
 +<file java AffinityPropagationDemo.java>​
 +package cn.edu.bjut.textmining.chapter5;​
 +
 +import cn.edu.bjut.textmining.chapter5.support.SampleNews;​
 +
 +/** 在同一TF-IDF空间中传播消息并选取新闻代表。 */
 +public class AffinityPropagationDemo {
 +    public static void main(String[] args) {
 +        try {
 +            double[][] vectors = SampleNews.vectors();​
 +            AffinityPropagation.Result result = AffinityPropagation.fit(vectors,​ 0.7, 300, 20);
 +            System.out.printf(
 +                    "​偏好值=%.9f,迭代轮数=%d,收敛=%s%n",​
 +                    result.preference,​ result.iterations,​ result.converged);​
 +            System.out.print("​代表点:"​);​
 +            for (int i : result.exemplars) {
 +                System.out.print("​N"​ + (i + 1) + " ");
 +            }
 +            System.out.println();​
 +            SampleNews.printClusters(result.labels);​
 +        } catch (Exception e) {
 +            e.printStackTrace();​
 +        }
 +    }
 +}
 +</​file>​
 +
 +===== 上机作业 =====
 +  * 完成每类(内部度量法、外部度量法和基于聚类稳定性的方法)聚类性能评价中的至少一种。
 +
 +~~DISCUSSION~~
zh/courses/textmining2026/ch05.1791789289.txt.gz · 最后更改: 2026/10/12 15:14 由 pzczxs