data metrics

deeptime.clustering.metrics = <deeptime.clustering._metric.MetricRegistry object>

Registry of available metrics. Per default this contains only the Euclidean metric. If a custom metric is implemented, it can be registered through a call to register.

Note

The registry should not be instantiated directly but rather be accessed through the metrics singleton.

Adding a new metric

A new metric may be added by linking against the deeptime clustering c++ library (directory is provided by deeptime.capi_includes(inc_clustering=True)) and subsequently exposing the clustering algorithms with your custom metric like

#include "register_clustering.h"

PYBIND11_MODULE(_clustering_bindings, m) {
    m.doc() = "module containing clustering algorithms.";
    auto customModule = m.def_submodule("custom");
    deeptime::clustering::registerClusteringImplementation<Custom>(customModule);
}

and registering it with the deeptime library through

import deeptime
import bindings  # this is your compiled extension, rename as appropriate

deeptime.clustering.metrics.register("custom", bindings.custom)