| Did you know ... | Search Documentation: |
| Pack logtalk -- logtalk-3.100.1/docs/handbook/_sources/libraries/agglomerative_clusterer.rst.txt |
.. _library_agglomerative_clusterer:
agglomerative_clustererAgglomerative clusterer.
The library implements the clusterer_protocol defined in the
clustering_protocols library. It provides predicates for learning a
clusterer from a dataset, assigning new instances to clusters, and
exporting the learned clusterer as a list of predicate clauses or to a
file.
Datasets are represented as objects implementing the
clustering_dataset_protocol protocol from the
clustering_protocols library.
Open the `../../apis/library_index.html#agglomerative_clusterer <../../apis/library_index.html#agglomerative_clusterer>`__ link in a web browser.
To load this library, load the loader.lgt file:
::
| ?- logtalk_load(agglomerative_clusterer(loader)).
To test this library predicates, load the tester.lgt file:
::
| ?- logtalk_load(agglomerative_clusterer(tester)).
To run the performance benchmark suite, load the
tester_performance.lgt file:
::
| ?- logtalk_load(agglomerative_clusterer(tester_performance)).
single, complete, and
average linkage.euclidean and manhattan
distances.The following options can be passed to the learn/3 predicate:
k(K): Number of clusters to retain after merging. Default is
2.linkage(Linkage): Linkage strategy to use. Options: single,
complete, or average (default).distance_metric(Metric): Distance metric to use. Options:
euclidean (default) or manhattan.feature_scaling(FeatureScaling): Whether to standardize continuous
attributes before clustering. Options: on (default) or off.The learned clusterer is represented as a compound term with the functor chosen by the user when exporting the clusterer and arity 4. For example:
::
agglomerative_clusterer(Encoders, Clusters, Prototypes, Options, Diagnostics)
Where:
Encoders: List of continuous attribute encoders storing attribute
name, mean, and scale.Clusters: List of cluster(Id, Points) terms in cluster-id
order.Prototypes: List of average vectors used for display, diagnostics,
and export metadata.Options: Effective training options used to learn the clusterer.Diagnostics: Training metadata including heap and prediction
details.The diagnostics/2 predicate returns metadata including:
pair_selection(priority_queue)prediction_strategy(cluster_member_linkage_distance)tie_breaking(node_id_order)