我有学生数据,我想根据这些属性对它们进行聚类。问题是不应该在聚类过程中使用student_id,因为它与聚类无关,我不能简单地删除student_id,因为我不能知道每个学生对应的集群是什么。My Array的结构如下:
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);有一个解决方案是在聚类过程之后搜索每个学生的参数,然后找到他的聚类,但这并不实用,也很耗时,我正在处理大量的条目。
发布于 2018-03-09 18:57:31
PR刚刚在主分支上合并,因此您可以使用键作为某种标签;) http://php-ml.readthedocs.io/en/latest/machine-learning/clustering/k-means/
https://stackoverflow.com/questions/48924533
复制相似问题