You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some use cases predict and score functions would be helpful.
The predict function should return the assigned clusters for a set of observations like this for kmeans:
function predict(kmresult, X)
dmat = Distances.pairwise(Distances.SqEuclidean(), kmresult.centers, X)
mod(findmin(dmat, 1)[2] .- 1, size(dmat, 1)) .+ 1
end
The score function should assign given observations and return the 1/totalcost for these observations and could look like this for kmeans:
function score(kmresult, X)
dmat = Distances.pairwise(Distances.SqEuclidean(), kmresult.centers, X)
sum(findmin(dmat, 1)[1])
end
Of course, it would be great to have those functions for all of the available clustering algorithms.
The text was updated successfully, but these errors were encountered:
For some use cases predict and score functions would be helpful.
The predict function should return the assigned clusters for a set of observations like this for kmeans:
The score function should assign given observations and return the 1/totalcost for these observations and could look like this for kmeans:
Of course, it would be great to have those functions for all of the available clustering algorithms.
The text was updated successfully, but these errors were encountered: