【发布时间】:2018-08-02 03:12:06
【问题描述】:
我有学生数据,我想根据那里的属性对它们进行聚类。问题是student_id不应该在集群过程中使用,因为它与集群无关,我不能只删除student_id,因为我将无法知道相应的集群是什么每个学生。我的数组具有以下结构:
Student_id | movies | chess | football | ....
---------------------------------------------------------
19324857 1 0 1 ...
代码
$studentsInfo = [[1,1,0,0,1,1], [1,1,1,1,0,0], [0,1,1,0,0,1], ....];
$kmeans = new KMeans(6);
$kmeans->cluster(studentsInfo);
有一个解决方案是在聚类过程之后搜索每个学生的参数,然后找到他的聚类,但这并不实用且耗时,而且我正在处理大量条目。
【问题讨论】:
标签: php machine-learning cluster-analysis k-means php-ml