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
[Affinity Propagation](https://en.wikipedia.org/wiki/Affinity_propagation) is a clustering algorithm based on the concept of "message passing" between data points. More information is available at the [Clustering.jl documentation](https://juliastats.org/Clustering.jl/stable/index.html). Use `predict` to get cluster assignments. Indices of the exemplars, their values, etc, are accessed from the machine report (see below).
689
+
690
+
This is a static implementation, i.e., it does not generalize to new data instances, and
691
+
there is no training data. For clusterers that do generalize, see [`KMeans`](@ref) or
692
+
[`KMedoids`](@ref).
693
+
694
+
In MLJ or MLJBase, create a machine with
695
+
696
+
mach = machine(model)
697
+
698
+
# Hyper-parameters
699
+
700
+
- `damp = 0.5`: damping factor
701
+
702
+
- `maxiter = 200`: maximum number of iteration
703
+
704
+
- `tol = 1e-6`: tolerance for converenge
705
+
706
+
- `preference = nothing`: the (single float) value of the diagonal elements of the similarity matrix. If unspecified, choose median (negative) similarity of all pairs as mentioned [here](https://en.wikipedia.org/wiki/Affinity_propagation#Algorithm)
707
+
708
+
- `metric = Distances.SqEuclidean()`: metric (see `Distances.jl` for available metrics)
709
+
710
+
# Operations
711
+
712
+
- `predict(mach, X)`: return cluster label assignments, as an unordered
713
+
`CategoricalVector`. Here `X` is any table of input features (eg, a `DataFrame`) whose
714
+
columns are of scitype `Continuous`; check column scitypes with `schema(X)`.
715
+
716
+
# Report
717
+
718
+
After calling `predict(mach)`, the fields of `report(mach)` are:
719
+
720
+
- exemplars: indices of the data picked as exemplars in `X`
721
+
722
+
- centers: positions of the exemplars in the feature space
723
+
724
+
- cluster_labels: labels of clusters given to each datum in `X`
725
+
726
+
- iterations: the number of iteration run by the algorithm
727
+
728
+
- converged: whether or not the algorithm converges by the maximum iteration
0 commit comments