Metrics
Datadynamics contains several metrics for comparing similarity between simulations.
Optimal Transport Dataset Distance (OTDD)
otdd(d1_collections_filename, d2_collections_filename, include_timestamps=True)
Optimal transport dataset distance between two collections over time.
The collections must be of equal length and created using datadynamics.utils.post_processing.save_collections. We use Microsoft's OTDD library to compute the distance between the collections for each timestamp to see how the distance changes over time during the simulation.
Warning
This function requires the OTDD library to be installed which is not included by default in datadynamics.
Note
We skip any timestamps for which the distance cannot be computed. Also, the OTDD values will likely not be affected by whether or not timestamps are included in the input features.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d1_collections_filename |
str
|
The filename of the first collection. |
required |
d2_collections_filename |
str
|
The filename of the second collection. |
required |
include_timestamps |
bool
|
Whether to include timestamps in the input features. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
tuple | A tuple of two lists. The first list contains the timestamps for which the distance was computed. The second list contains the distances for each timestamp. |