Ignore:
Timestamp:
03/02/12 16:56:57 (2 years ago)
Author:
anzeh <anze.staric@…>
Branch:
default
Message:

Fixed some backward compatibility issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/evaluation/scoring.py

    r10426 r10429  
    775775                         or list of :obj:`ConfusionMatrix`. 
    776776    :rtype: list of scores, one for each learner.""" 
     777    def __new__(cls, test_results, **kwargs): 
     778        self = list.__new__(cls) 
     779        if isinstance(test_results, ConfusionMatrix): 
     780            self.__init__(test_results, **kwargs) 
     781            return self[0] 
     782        return self 
     783 
     784 
    777785    @deprecated_keywords({"confm": "test_results"}) 
    778786    def __init__(self, test_results=None): 
Note: See TracChangeset for help on using the changeset viewer.