safeai.rga.compare_rga
- safeai.rga.compare_rga(models, y_true, *, x=None, n_segments=10, positive_class=1, curve_method='auto', normalize_to_perfect=True, save_path=None, show=False, verbose=True)[source]
Compare multiple models or probability arrays using RGA curves.
- Parameters:
models (dict) – Dictionary where values can be: - score array - probability matrix - fitted model with predict_proba - tuple of (probability_matrix, class_order)
y_true (array-like) – True labels.
x (array-like or DataFrame, optional) – Required if model objects are passed.
n_segments (int, default=10) – Number of curve segments.
positive_class (int or str, default=1) – Positive class for binary classification.
curve_method ({'auto', 'partial', 'removal'}, default='auto') – Method used to construct RGA curves.
normalize_to_perfect (bool, default=True) – If True, return normalized AURGA as the main ‘aurga’ value.
save_path (str or None, default=None) – If provided, save the comparison plot to this path.
show (bool, default=False) – If True, display the comparison plot with plt.show().
verbose (bool, default=True) – Whether to print summary.
- Returns:
Mapping from model name to RGA curve result.
- Return type:
dict