Message Boards Message Boards

0
|
1514 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

FindClusters Error: Distance Function does not work

Posted 1 year ago

Hi there! When I try the following code

data = {1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5}
FindClusters[data]

I get the error

FindClusters::wrgdist: The distance function EuclideanDistance cannot be comuputed on the data. 

Any other distance function gives a similar error. Same error for more complicated data. Does anyone know, what is wrong here?

In the end I would like to cluster data of the form {a,b}, where a means the number of hours a teacher works per week and b means the number of hours in the afternoon, or the number of free days etc. If you have any valuable ideas, you are very welcome to point them out to me (since I am only a sparse user of Mathematica). Thank you!

POSTED BY: Juri Rolf
2 Replies
Posted 1 year ago

Thank You! I have tried it again and voila: Now it works!

POSTED BY: Juri Rolf
data = {1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 5, 5, 5} ;
FindClusters[data]

(*{{1, 1}, {2, 2, 2}, {3, 3, 3, 3, 3, 3}, {4, 4}, {5, 5, 5}}*)

Executed on Mathematica 13.2.0

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract