Skip to content

test that degree-0 VR equals single-linkage clustering #42

@corybrunson

Description

@corybrunson

As a check against bugs that are consistent within the behavior of the Vietoris–Rips computation, a simple test should compare the result to that of hclust() using method = "single". Here is an example, though note that the tolerance must be specified (and this should be re-checked once {ripserr} converts value_t from float to double):

library(phutil)
library(ripserr)
library(testthat)

d <- dist(UScitiesD)
hc <- hclust(d, method = "single")
hc_ <- as_persistence(hc)
ph <- vietoris_rips(d)
ph_ <- as_persistence(ph)

expect_equivalent(as.data.frame(hc_), as.data.frame(ph_), tolerance = 1e-7)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions