paradance.evaluation.BaseCalculator
- class paradance.evaluation.BaseCalculator(df: DataFrame, selected_columns: List[str], overall_score_lower_bound: float | None, overall_score_upper_bound: float | None, rerank_eval_str: str | None = None)[source]
A base class for calculators that provides partial methods to calculate different evaluation metrics.
This class is designed to be subclassed by specific calculator implementations that compute an overall score based on a combination of the metrics.
- __init__(df: DataFrame, selected_columns: List[str], overall_score_lower_bound: float | None, overall_score_upper_bound: float | None, rerank_eval_str: str | None = None) None[source]
Initializes the BaseCalculator.
Methods
__init__(df, selected_columns, ...[, ...])Initializes the BaseCalculator.
calculate_auc_triple_parameters(grid_interval)calculate_corrcoef(mask_column, ...)calculate_cumulative_deviation(mask_column, ...)calculate_distinct_count_portfolio_concentration(...)calculate_distinct_top_coverage(mask_column, ...)calculate_inverse_pair(target_column[, ...])calculate_log_mse(target_column[, ...])calculate_mean(mask_column, target_column, ...)calculate_neg_rank_ratio([label_column])calculate_portfolio_concentration(...)calculate_proportion(mask_column, ...)calculate_standard_deviation(mask_column, ...)calculate_tau(target_column, groupby[, ...])calculate_top_coverage(mask_column, ...)calculate_woauc(groupby, target_column[, ...])calculate_wuauc(mask_column, target_column, ...)clip_max(left, right)Clips the values in the right array or scalar to a maximum value specified by left.
clip_min(left, right)Clips the values in the right array or scalar to a minimum value specified by left.
get_overall_score(weights_for_equation)Calculates the overall score based on the weights provided for each evaluation metric.
initialize_local_dict(weights_for_equation, ...)Initializes a dictionary that can be used for additional calculations.
Reranks the rows in the DataFrame based on side information.
- abstract get_overall_score(weights_for_equation: List[float]) None[source]
Calculates the overall score based on the weights provided for each evaluation metric.
- static clip_max(left: ndarray | float | int, right: ndarray | float | int) ndarray[source]
Clips the values in the right array or scalar to a maximum value specified by left.
- static clip_min(left: ndarray | float | int, right: ndarray | float | int) ndarray[source]
Clips the values in the right array or scalar to a minimum value specified by left.