Changeset 8054:3391f26a4ecc in orange


Ignore:
Timestamp:
07/01/11 14:11:28 (3 years ago)
Author:
anze <anze.staric@…>
Branch:
default
Convert:
fdca160e654ea83cc7cf5493dd5f01c175347ad9
Message:

Modified PcaClassifier so it can accept example instead of data.Table.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orange/Orange/projection/pca.py

    r8042 r8054  
    2727     
    2828    def __new__(cls, dataset = None, **kwds): 
    29         learner = object.__new__(cls, **kwds) 
     29        learner = object.__new__(cls) 
    3030        learner.__init__(**kwds) 
    3131         
     
    3535            return learner 
    3636     
    37     def __init__(self, standardize = False, 
     37    def __init__(self, standardize = True, 
    3838                 max_components = 0, variance_covered = 1): 
    3939        self.standardize = standardize 
     
    146146     
    147147    def __call__(self, dataset): 
     148        if type(dataset) != Orange.data.Table: 
     149            dataset = Orange.data.Table(self.input_domain, [dataset]) 
     150 
    148151        X = dataset.to_numpy_MA("a")[0] 
    149152        Xm, U = self.mean, self.eigen_vectors 
     
    361364        else: 
    362365            plt.show() 
     366             
Note: See TracChangeset for help on using the changeset viewer.