dynsight.trajectory.ClusterInsight

class dynsight.trajectory.ClusterInsight(labels)[source]

Contains a clustering analysis.

Parameters:

labels (NDArray[np.int64])

labels

The labels assigned by the clustering algorithm.

Type:

NDArray[np.int64]

Methods

dump_to_json

Save the ClusterInsight to a JSON file and .npy file.

load_from_json

Load the ClusterInsight object from JSON and associated .npy file.

Attributes

dump_to_json(file_path)[source]

Save the ClusterInsight to a JSON file and .npy file.

Parameters:

file_path (Path)

Return type:

None

classmethod load_from_json(file_path, mmap_mode=None)[source]

Load the ClusterInsight object from JSON and associated .npy file.

Parameters:
  • file_path (Path) – Path to the .json file.

  • mmap_mode (Literal['r', 'r+', 'w+', 'c'] | None) – If given, used as np.load(…, mmap_mode=mmap_mode) for memory mapping.

Raises:

ValueError – if required keys are missing.

Return type:

ClusterInsight