Ignore:
Timestamp:
02/28/12 12:58:10 (2 years ago)
Author:
anzeh <anze.staric@…>
Branch:
default
rebase_source:
78529dea1a742bd9d150ce8087965ff36624ce95
Message:

Emmit a warning when AUC could not be computed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/evaluation/scoring.py

    r10367 r10422  
    16621662    # over all folds or even this failed; 
    16631663    # in these cases the result is returned immediately 
    1664     @deprecated_keywords({"AUCcomputer": "auc_computer", 
    1665                           "computerArgs": "computer_args"}) 
    16661664    def _compute_for_multiple_folds(self, auc_computer, iterations, 
    16671665                                 computer_args): 
     
    16711669            aucs, foldsUsed = auc_computer(*(ite, ) + computer_args) 
    16721670            if not aucs: 
    1673                 return None 
     1671                import warnings 
     1672                warnings.warn("AUC cannot be computed (all instances belong to the same class).") 
     1673                return 
    16741674            if not foldsUsed: 
     1675                self[:] = aucs 
    16751676                return aucs 
    16761677            subsum_aucs = map(add, subsum_aucs, aucs) 
     
    17951796    return auc 
    17961797 
     1798 
     1799@deprecated_keywords({"AUCcomputer": "auc_computer", 
     1800                      "computerArgs": "computer_args"}) 
    17971801def AUC_iterations(auc_computer, iterations, computer_args): 
    17981802    auc = deprecated_function_name(AUC)() 
Note: See TracChangeset for help on using the changeset viewer.