Crate flame_clustering

source ·
Expand description

An implementation of the FLAME data clustering algorithm.

Fuzzy clustering by Local Approximation of MEmberships (FLAME) is a data clustering algorithm that defines clusters in the dense parts of a dataset and performs cluster assignment solely based on the neighborhood relationships among objects.

The algorithm was first described in: “FLAME, a novel fuzzy clustering method for the analysis of DNA microarray data”, BMC Bioinformatics, 2007, 8:3. Available from: http://www.biomedcentral.com/1471-2105/8/3

This Rust library was adapted from the original C implementation: https://code.google.com/archive/p/flame-clustering/

Example

use flame_clustering::DistanceGraph;

let data: Vec<f64> = vec![0.12, 0.23, 0.15, 0.19, 100.0];
let (clusters, outliers) = DistanceGraph::build(&data, |a, b| (a - b).abs())
    .find_supporting_objects(2, -1.0)
    .approximate_fuzzy_memberships(100, 1e-6)
    .make_clusters(-1.0);

assert_eq!(format!("{clusters:?}"), "[[0, 1, 3, 2]]");
assert_eq!(format!("{outliers:?}"), "[4]");

Modules

  • A collection of useful distance measures.

Structs

Enums