【问题标题】:How to exclude attributes from clustering in PHP-ML?如何在 PHP-ML 中从集群中排除属性?
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-08
      • 2017-11-23
      • 2014-04-04
      • 2022-11-02
      • 2016-08-12
      • 2018-04-15
      • 1970-01-01
      • 2018-03-04
      相关资源
      最近更新 更多