Liking cljdoc? Tell your friends :D

active-analytics.clustering.k-medoids


choose-initial-medoids-randomlyclj

(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.
sourceraw docstring

clusterclj

(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.
sourceraw docstring

contributionclj

(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.
sourceraw docstring

dissimilarityclj

(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.
sourceraw docstring

dissimilarity-functionclj

(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.
sourceraw docstring

dissimilarity-mapclj

(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.
sourceraw docstring

dissimilarity-sumclj

(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.
sourceraw docstring

find-medoidclj

(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.
sourceraw docstring

gainclj

(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.
sourceraw docstring

k-medoidsclj

(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.
  • If :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.
sourceraw docstring

min-medoid-distanceclj

(min-medoid-distance x medoids dissimilarity-fn)

Calculates the distance to the closest medoid.

Calculates the distance to the closest medoid.
sourceraw docstring

nearest-medoidclj

(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`.
sourceraw docstring

next-pam-medoidclj

(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.
sourceraw docstring

pam-buildclj

(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.
sourceraw docstring

stepclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close