簡體   English   中英

如何從 PHP-ML 中的聚類中排除屬性?

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

我有學生數據,我想根據那里的屬性對它們進行聚類。 問題是在聚類過程中不應該使用 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);

有一個解決方案,在聚類過程后搜索每個學生的參數,然后找到他的聚類,但不實用且耗時,而且我正在處理大量條目。

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