user3379482
user3379482

Reputation: 567

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. 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.

Upvotes: 0

Views: 222

Answers (1)

Ivana Momcilovic
Ivana Momcilovic

Reputation: 1

PR just merged on master branch, so you can use keys as some kind of label ;) http://php-ml.readthedocs.io/en/latest/machine-learning/clustering/k-means/

Upvotes: 0

Related Questions