简体   繁体   English

如何从 PHP-ML 中的聚类中排除属性?

[英]How to exclude attributes from clustering in PHP-ML?

I have students data and I want to cluster them according to there attributes.我有学生数据,我想根据那里的属性对它们进行聚类。 The problem is that the student_id shouldn't be used in the clustering process, because it has nothing to do with the clustering, and I cannot just remove the student_id, because I won't be able then to know what is the according cluster to each student.问题是在聚类过程中不应该使用 student_id,因为它与聚类无关,我不能只删除 student_id,因为我将无法知道相应的聚类是什么每个学生。 My Array has the following structure:我的数组具有以下结构:

    Student_id  |   movies  |   chess   |   football    | ....
    ---------------------------------------------------------
    19324857        1           0           1           ...

Code代码

    $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);

There's a solution to search after the clustering process for each student's parameters, and then find his cluster, but it's not practical and time consuming, and I'm working with a lot of entries.有一个解决方案,在聚类过程后搜索每个学生的参数,然后找到他的聚类,但不实用且耗时,而且我正在处理大量条目。

PR 刚刚合并到 master 分支,因此您可以使用密钥作为某种标签;) http://php-ml.readthedocs.io/en/latest/machine-learning/clustering/k-means/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM