pdstools.ih.Aggregates

Classes

Module Contents

class Aggregates(ih: pdstools.ih.IH.IH)

Bases: pdstools.utils.namespaces.LazyNamespace

Parameters:

ih (pdstools.ih.IH.IH)

ih
_summary_interactions(by: str | List[str] | None = None, every: str | datetime.timedelta | None = None, query: pdstools.utils.types.QUERY | None = None) polars.LazyFrame
Parameters:
Return type:

polars.LazyFrame

summary_success_rates(by: str | List[str] | None = None, every: str | datetime.timedelta | None = None, query: pdstools.utils.types.QUERY | None = None) polars.LazyFrame

Groups the IH data summarizing into success rates (SuccessRate) and standard error (StdErr).

It optionally groups by one or more dimensions (e.g. Experiment, Channel, Issue etc). When given, the ‘every’ argument is used to divide the timerange into buckets. It uses the same string language as Polars.

Every interaction is considered to have only one outcome: positive, negative or none. When any outcome in the interaction is in the positive labels, the outcome is considered positive. Next, when any is in the negative labels, the outcome of the interaction is considered negative. Otherwise there is no defined outcome and the interaction is ignored in calculations of success rate or error.

Parameters:
  • by (Optional[Union[str, List[str]]], optional) – Grouping keys, by default None

  • every (Optional[str], optional) – Every interval start and period length, by default None

  • query (Optional[pdstools.utils.types.QUERY])

Returns:

A polars frame with the grouping keys and columns for the total number of Positives, Negatives, number of Interactions, success rate (SuccessRate) and standard error (StdErr).

Return type:

pl.LazyFrame

summary_outcomes(by: str | List[str] | None = None, every: str | datetime.timedelta | None = None, query: pdstools.utils.types.QUERY | None = None)
Parameters: