pdstools.decision_analyzer.utils¶
Attributes¶
Functions¶
|
Apply a global set of filters. Kept outside of the DecisionData class as |
|
Returns a DataFrame with action counts filtered based on the given propensity and priority thresholds. |
|
|
|
|
|
Returns some first level stats of a dataframe. Used to |
|
Binary search algorithm to find lever given a desired win percentage |
|
|
|
|
|
|
|
Module Contents¶
- NBADScope_Mapping¶
- apply_filter(df: polars.LazyFrame, filters: polars.Expr | List[polars.Expr] | None = None)¶
Apply a global set of filters. Kept outside of the DecisionData class as this is really more of a utility function, not bound to that class at all.
- Parameters:
df (polars.LazyFrame)
filters (Optional[Union[polars.Expr, List[polars.Expr]]])
- filtered_action_counts(df: polars.LazyFrame, groupby_cols: list, propensityTH: float = None, priorityTH: float = None) polars.LazyFrame ¶
Returns a DataFrame with action counts filtered based on the given propensity and priority thresholds.
- Parameters:
- Returns:
A DataFrame with action counts filtered based on the given propensity and priority thresholds.
- Return type:
pl.LazyFrame
- get_first_level_stats(interaction_data: polars.LazyFrame, filters: List[polars.Expr] = None)¶
Returns some first level stats of a dataframe. Used to show effects of user data filters.
- Parameters:
interaction_data (polars.LazyFrame)
filters (List[polars.Expr])
- get_git_version_and_date()¶
- find_lever_value(decision_data, action, target_win_percentage, win_rank, low=0, high=100, precision=0.01, ranking_stages=['Arbitration'])¶
Binary search algorithm to find lever given a desired win percentage
- determine_extract_type(raw_data)¶
- process(df: polars.LazyFrame, table: Literal['decision_analyzer', 'explainability_extract'], subset: bool = True, include_cols: Iterable[str] | None = None, drop_cols: Iterable[str] | None = None, raise_on_unknown: bool = True) polars.LazyFrame ¶