dyad¶
- class AnnotatedDyad(trajectory, trajectory_other, *, observations, categories, background_category)¶
Bases:
Dyad,AnnotatedSampleableMixinAnnotated dyad.
- Parameters:
trajectory (
Trajectory) – The trajectory of the actor.trajectory_other (
Trajectory) – The other trajectory of the recipient.observations (
DataFrame) – Observations for the dyad.categories (
tuple[str,...]) – Categories of the observations.background_category (
str) – Background category of the observations.
- class Dyad(trajectory, trajectory_other)¶
Bases:
BaseSampleableA dyad is a sampleable pair of trajectories (
Trajectory).- Parameters:
trajectory (
Trajectory) – The first trajectory in the dyad (i.e., the actor of social behaviors).trajectory_other (
Trajectory) – The second trajectory in the dyad (i.e., the recipient).
- annotate(observations, *, categories, background_category)¶
Annotates the dyad with the given observations.
- classmethod prepare_paired_trajectories(trajectory, trajectory_other)¶
Helper function to prepare paired trajectories for a dyad.
The trajectories are temporally aligned with slicing (see
slice_window()) and returned as a view. Note that the trajectories should already be complete and sorted.- Parameters:
trajectory (
Trajectory) – The trajectory of the actor (first individual of the dyad)trajectory_other (
Trajectory) – The trajectory of the recipient (second individual of the dyad)
- Return type:
- Returns:
The aligned trajectories.
See also
Trajectoryfor more details on handling trajectory data.