(choose-initial-medoids-randomly xs k)
Randomly chooses a set of medoids to start out with.
Randomly chooses a set of medoids to start out with.
(cluster xs medoids dissimilarity-fn)
Groups the data points xs
by assigning each to its
nearest medoid.
Groups the data points `xs` by assigning each to its nearest medoid.
(contribution candidate x medoids dissimilarity-fn)
Calculates the contribution of x
to the change in gain
when adding candidate
as additional medoid.
Calculates the contribution of `x` to the change in gain when adding `candidate` as additional medoid.
(dissimilarity x y dissimilarities)
Looks up the dissimilarity of two points
x
and y
in a dissimilarity map.
Looks up the dissimilarity of two points `x` and `y` in a dissimilarity map.
(dissimilarity-function xs distance-fn cache?)
Returns a function to calculate the dissimilarity
between two data points. If cache?
is true
, a map
of dissimilarities is built and the resulting function
will be a closure that does lookups inside the map.
Otherwise distance-fn
is returned.
Returns a function to calculate the dissimilarity between two data points. If `cache?` is `true`, a map of dissimilarities is built and the resulting function will be a closure that does lookups inside the map. Otherwise `distance-fn` is returned.
(dissimilarity-map xs distance-fn)
Calculates a map of dissimilarities which is indexed by all combinations (pairs) of points.
Calculates a map of dissimilarities which is indexed by all combinations (pairs) of points.
(dissimilarity-sum x xs dissimilarity-fn)
Calculates the sum of dissimilarities of a point to all other points.
Calculates the sum of dissimilarities of a point to all other points.
(find-medoid xs dissimilarity-fn)
Finds the medoid of a set of data points xs
, that is,
the point with the lowest sum of dissimilarities.
Finds the medoid of a set of data points `xs`, that is, the point with the lowest sum of dissimilarities.
(gain candidate xs medoids dissimilarity-fn)
Calculates the gain associated with the choice of a medoid candidate.
Calculates the gain associated with the choice of a medoid candidate.
(k-medoids xs
distance-fn
k
&
{:keys [medoid-init-mode cache?]
:or {medoid-init-mode :random cache? true}})
Performs k-medoid clustering on the data points xs
,
given the desired number of clusters k
and a function
distance-fn
that computes the distance between two
points.
Accepts the keyword arguments :medoid-init-mode
and
:cache?
.
:medoid-init-mode
determines the way the initial set
of medoids is created. The default value, :random
,
corresponds to random choice of initial medoids, while
:pam
utilizes the PAM BUILD algorithm to greedily
choose k
'good' starting medoids.:cache?
is true
(the default), a map of dissimilarities
is built which is then used to perform lookups instead
of distance recalculations.Performs k-medoid clustering on the data points `xs`, given the desired number of clusters `k` and a function `distance-fn` that computes the distance between two points. Accepts the keyword arguments `:medoid-init-mode` and `:cache?`. - `:medoid-init-mode` determines the way the initial set of medoids is created. The default value, `:random`, corresponds to random choice of initial medoids, while `:pam` utilizes the PAM BUILD algorithm to greedily choose `k` 'good' starting medoids. - If `:cache?` is `true` (the default), a map of dissimilarities is built which is then used to perform lookups instead of distance recalculations.
(min-medoid-distance x medoids dissimilarity-fn)
Calculates the distance to the closest medoid.
Calculates the distance to the closest medoid.
(nearest-medoid x medoids dissimilarity-fn)
Finds the medoid that is closest to a point x
.
Finds the medoid that is closest to a point `x`.
(next-pam-medoid xs medoids dissimilarity-fn)
Determines the best additional medoid, that is, the point with maximal gain w.r.t. the currently chosen medoids.
Determines the best additional medoid, that is, the point with maximal gain w.r.t. the currently chosen medoids.
(pam-build xs dissimilarity-fn k)
Performs the PAM BUILD initialization. That is, this greedily finds an initial set of medoids by iteratively choosing points which minimize dissimilarity.
Performs the PAM BUILD initialization. That is, this greedily finds an initial set of medoids by iteratively choosing points which minimize dissimilarity.
(step xs medoids dissimilarity-fn)
Calculates the next generation of medoids from the current one.
Calculates the next generation of medoids from the current one.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close