Ignore:
Files:
3 added
3 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r10159 r10545  
    2020MANIFEST 
    2121Orange.egg-info 
     22Orange/version.py 
    2223 
    2324# Ignore dot files. 
  • Orange/OrangeWidgets/Data/OWPreprocess.py

    r9671 r10542  
    1717import math 
    1818 
    19 from Orange.preprocess import * 
     19from Orange.data import preprocess 
    2020 
    2121def _gettype(obj): 
     
    7676    def getDiscretizer(self): 
    7777        if self.discInd == 0: 
    78             preprocessor = Preprocessor_discretizeEntropy(method=orange.EntropyDiscretization()) 
     78            preprocessor = preprocess.DiscretizeEntropy(method=orange.EntropyDiscretization()) 
    7979        elif self.discInd in [1, 2]: 
    8080            name, disc, kwds = self.DISCRETIZERS[self.discInd] 
    81             preprocessor = Preprocessor_discretize(method=disc(**dict([(key, getattr(self, key, val)) for key, val in kwds.items()]))) 
     81            preprocessor = preprocess.Discretize(method=disc(**dict([(key, getattr(self, key, val)) for key, 
     82                                                                                              val in kwds.items()]))) 
    8283        elif self.discInd == 3: 
    83             preprocessor = Preprocessor_removeContinuous() 
     84            preprocessor = preprocess.RemoveContinuous() 
    8485        return preprocessor 
    8586     
     
    120121    def getContinuizer(self): 
    121122        if self.contInd in [0, 1, 2, 4, 5]: 
    122             preprocessor = Preprocessor_continuize(multinomialTreatment=self.CONTINUIZERS[self.contInd][1]) 
     123            preprocessor = preprocess.Continuize(multinomialTreatment=self.CONTINUIZERS[self.contInd][1]) 
    123124        elif self.contInd == 3: 
    124             preprocessor = Preprocessor_removeDiscrete() 
     125            preprocessor = preprocess.RemoveDiscrete() 
    125126        return preprocessor 
    126127     
    127128    def setContinuizer(self, continuizer): 
    128         if isinstance(continuizer, Preprocessor_removeDiscrete): 
     129        if isinstance(continuizer, preprocess.RemoveDiscrete): 
    129130            self.contInd = 3 #Ignore all discrete 
    130         elif isinstance(continuizer,Preprocessor_continuize): 
     131        elif isinstance(continuizer,preprocess.Continuize): 
    131132            self.contInd = self.TREATMENT_TO_IND.get(continuizer.multinomialTreatment, 3) 
    132133     
    133     data = _pyqtProperty(Preprocessor_continuize, 
     134    data = _pyqtProperty(preprocess.Continuize, 
    134135                        fget=getContinuizer, 
    135136                        fset=setContinuizer, 
     
    155156        if self.methodInd in [0, 1, 2]: 
    156157            learner = self.IMPUTERS[self.methodInd][1]() 
    157             imputer = Preprocessor_imputeByLearner(learner=learner) 
     158            imputer = preprocess.ImputeByLearner(learner=learner) 
    158159        elif self.methodInd == 3: 
    159             imputer = orange.Preprocessor_dropMissing() 
     160            imputer = preprocess.DropMissing() 
    160161        return imputer 
    161162             
     
    163164    def setImputer(self, imputer): 
    164165        self.methodInd = 0 
    165         if isinstance(imputer, Preprocessor_imputeByLearner): 
     166        if isinstance(imputer, preprocess.ImputeByLearner): 
    166167            learner = imputer.learner 
    167168            dd = dict([(t, i) for i, (_, t) in enumerate(self.IMPUTERS)]) 
    168169            self.methodInd = dd.get(_gettype(learner), 0) 
    169         elif isinstance(imputer, orange.Preprocessor_dropMissing): 
     170        elif isinstance(imputer, preprocess.DropMissing): 
    170171            self.methodInd = 3 
    171172             
    172     data = _pyqtProperty(Preprocessor_imputeByLearner, 
     173    data = _pyqtProperty(preprocess.ImputeByLearner, 
    173174                        fget=getImputer, 
    174175                        fset=setImputer, 
     
    183184                ("Linear SVM weights", orngSVM.MeasureAttribute_SVMWeights)] 
    184185     
    185     FILTERS = [Preprocessor_featureSelection.bestN, 
    186                Preprocessor_featureSelection.bestP] 
     186    FILTERS = [preprocess.FeatureSelection.bestN, 
     187               preprocess.FeatureSelection.bestP] 
    187188     
    188189    def __init__(self, parent=None): 
     
    235236     
    236237    def getFeatureSelection(self): 
    237         return Preprocessor_featureSelection(measure=self.MEASURES[self.measureInd][1], 
     238        return preprocess.FeatureSelection(measure=self.MEASURES[self.measureInd][1], 
    238239                                             filter=self.FILTERS[self.selectBy], 
    239240                                             limit=self.bestP if self.selectBy  else self.bestN) 
    240241     
    241     data = _pyqtProperty(Preprocessor_featureSelection, 
     242    data = _pyqtProperty(preprocess.FeatureSelection, 
    242243                        fget=getFeatureSelection, 
    243244                        fset=setFeatureSelection, 
     
    245246         
    246247class SampleEditor(BaseEditor): 
    247     FILTERS = [Preprocessor_sample.selectNRandom, 
    248                Preprocessor_sample.selectPRandom] 
     248    FILTERS = [preprocess.Sample.selectNRandom, 
     249               preprocess.Sample.selectPRandom] 
    249250    def __init__(self, parent=None): 
    250251        BaseEditor.__init__(self, parent) 
     
    278279         
    279280    def getSampler(self): 
    280         return Preprocessor_sample(filter=self.FILTERS[self.methodInd], 
     281        return preprocess.Sample(filter=self.FILTERS[self.methodInd], 
    281282                                   limit=self.sampleN if self.methodInd == 0 else self.sampleP) 
    282283     
     
    291292        self.updateSpinStates() 
    292293             
    293     data = _pyqtProperty(Preprocessor_sample, 
     294    data = _pyqtProperty(preprocess.Sample, 
    294295                        fget=getSampler, 
    295296                        fset=setSampler, 
     
    302303         
    303304    #Preprocessor name replacement rules 
    304     REPLACE = {Preprocessor_discretize: "Discretize ({0.method})", 
    305                Preprocessor_discretizeEntropy: "Discretize (entropy)", 
    306                Preprocessor_removeContinuous: "Discretize (remove continuous)", 
    307                Preprocessor_continuize: "Continuize ({0.multinomialTreatment})", 
    308                Preprocessor_removeDiscrete: "Continuize (remove discrete)", 
    309                Preprocessor_impute: "Impute ({0.model})", 
    310                Preprocessor_imputeByLearner: "Impute ({0.learner})", 
    311                Preprocessor_dropMissing: "Remove missing", 
    312                Preprocessor_featureSelection: "Feature selection ({0.measure}, {0.filter}, {0.limit})", 
    313                Preprocessor_sample: "Sample ({0.filter}, {0.limit})", 
     305    REPLACE = {preprocess.Discretize: "Discretize ({0.method})", 
     306               preprocess.DiscretizeEntropy: "Discretize (entropy)", 
     307               preprocess.RemoveContinuous: "Discretize (remove continuous)", 
     308               preprocess.Continuize: "Continuize ({0.multinomialTreatment})", 
     309               preprocess.RemoveDiscrete: "Continuize (remove discrete)", 
     310               preprocess.Impute: "Impute ({0.model})", 
     311               preprocess.ImputeByLearner: "Impute ({0.learner})", 
     312               preprocess.DropMissing: "Remove missing", 
     313               preprocess.FeatureSelection: "Feature selection ({0.measure}, {0.filter}, {0.limit})", 
     314               preprocess.Sample: "Sample ({0.filter}, {0.limit})", 
    314315               orange.EntropyDiscretization: "entropy", 
    315316               orange.EquiNDiscretization: "freq, {0.numberOfIntervals}", 
     
    447448     
    448449    # Default preprocessors 
    449     preprocessors =[("Discretize", Preprocessor_discretizeEntropy, {}), 
    450                     ("Continuize", Preprocessor_continuize, {}), 
    451                     ("Impute", Preprocessor_impute, {}), 
    452                     ("Feature selection", Preprocessor_featureSelection, {}), 
    453                     ("Sample", Preprocessor_sample, {})] 
     450    preprocessors =[("Discretize", preprocess.DiscretizeEntropy, {}), 
     451                    ("Continuize", preprocess.Continuize, {}), 
     452                    ("Impute", preprocess.Impute, {}), 
     453                    ("Feature selection", preprocess.FeatureSelection, {}), 
     454                    ("Sample", preprocess.Sample, {})] 
    454455     
    455456    # Editor widgets for preprocessors 
    456     EDITORS = {Preprocessor_discretize: DiscretizeEditor, 
    457                Preprocessor_discretizeEntropy: DiscretizeEditor, 
    458                Preprocessor_removeContinuous: DiscretizeEditor, 
    459                Preprocessor_continuize: ContinuizeEditor, 
    460                Preprocessor_removeDiscrete: ContinuizeEditor, 
    461                Preprocessor_impute: ImputeEditor, 
    462                Preprocessor_imputeByLearner: ImputeEditor, 
    463                Preprocessor_dropMissing: ImputeEditor, 
    464                Preprocessor_featureSelection: FeatureSelectEditor, 
    465                Preprocessor_sample: SampleEditor, 
     457    EDITORS = {preprocess.Discretize: DiscretizeEditor, 
     458               preprocess.DiscretizeEntropy: DiscretizeEditor, 
     459               preprocess.RemoveContinuous: DiscretizeEditor, 
     460               preprocess.Continuize: ContinuizeEditor, 
     461               preprocess.RemoveDiscrete: ContinuizeEditor, 
     462               preprocess.Impute: ImputeEditor, 
     463               preprocess.ImputeByLearner: ImputeEditor, 
     464               preprocess.DropMissing: ImputeEditor, 
     465               preprocess.FeatureSelection: FeatureSelectEditor, 
     466               preprocess.Sample: SampleEditor, 
    466467               type(None): QWidget} 
    467468     
     
    476477         
    477478#        self.allSchemas = [PreprocessorSchema("Default" , [Preprocessor_discretize(method=orange.EntropyDiscretization()), Preprocessor_dropMissing()])] 
    478         self.allSchemas = [("Default" , [Preprocessor_discretizeEntropy(method=orange.EntropyDiscretization()), Preprocessor_dropMissing()], 0)] 
     479        self.allSchemas = [("Default" , [preprocess.DiscretizeEntropy(method=orange.EntropyDiscretization()), 
     480                                         preprocess.DropMissing()], 0)] 
    479481         
    480482        self.lastSelectedSchemaIndex = 0 
  • Orange/OrangeWidgets/Prototypes/OWCSVFileImport.py

    r10529 r10533  
    1616#from OWFile import FileNameContextHandler as PathContextHandler 
    1717from OWDataTable import ExampleTableModel 
    18  
    19 DEFAULT_OPTIONS = {"delimiter":",",  
    20                    "quote":"'",  
    21                    "has_header": True, 
    22                    "has_orange_definitions": False, 
    23                    } 
    2418 
    2519Slot = pyqtSlot 
     
    4236     
    4337     
    44              
    45              
    4638class OWCSVFileImport(OWWidget): 
    4739#    contextHandlers = {"": PathContextHandler("")} 
     
    5446                  ("Others", None), 
    5547                  ] 
     48     
    5649    def __init__(self, parent=None, signalManager=None,  
    5750                 title="CSV File Import"): 
     
    6558        # Settings 
    6659        self.delimiter = "," 
     60        self.other_delimiter = None 
    6761        self.quote = '"' 
    68          
     62        self.missing = "" 
     63         
     64        self.skipinitialspace = True 
    6965        self.has_header = True 
    7066        self.has_orange_header = True 
    7167         
    7268        self.recent_files = [] 
     69         
     70        # Hints for the recent files  
    7371        self.hints = {} 
    7472         
    7573        self.loadSettings() 
    7674         
    77         self.recent_file = filter(os.path.exists, self.recent_files) 
    78          
    79         self.csv_options = dict(DEFAULT_OPTIONS) 
     75        self.recent_files = filter(os.path.exists, self.recent_files) 
    8076         
    8177        layout = QHBoxLayout() 
     
    10096#        layout.addWidget(self.reload_button) 
    10197 
    102         form_left = QFormLayout() 
    103         form_right = QFormLayout() 
    104         h_layout = QHBoxLayout() 
     98        ################# 
     99        # Cell separators 
     100        ################# 
    105101        grid_layout = QGridLayout() 
    106102        grid_layout.setVerticalSpacing(4) 
     
    112108        QObject.connect(button_group,  
    113109                        SIGNAL("buttonPressed(int)"), 
    114                         self.delimiter_changed) 
    115 #        button_group.buttonPressed.connect(self.delimiter_changed) 
     110                        self.delimiter_changed 
     111                        ) 
    116112         
    117113        for i, (name, char) in  enumerate(self.DELIMITERS[:-1]): 
     
    130126             
    131127        self.delimiter_edit = QLineEdit(objectName="delimiter_edit", 
    132                                         text=self.delimiter, 
     128                                        text=self.other_delimiter or self.delimiter, 
    133129                                        editingFinished=self.delimiter_changed, 
    134130                                        toolTip="Cell delimiter character.") 
     131         
    135132        grid_layout.addWidget(self.delimiter_edit, i / 3 + 1, 1, -1, -1) 
     133         
     134        preset = [d[1] for d in self.DELIMITERS[:-1]] 
     135        if self.delimiter in preset: 
     136            index = preset.index(self.delimiter) 
     137            b = button_group.button(index) 
     138            b.setChecked(True) 
     139            self.delimiter_edit.setEnabled(False) 
     140        else: 
     141            button.setChecked(True) 
     142            self.delimiter_edit.setEnabled(True) 
     143         
     144        ############### 
     145        # Other options 
     146        ############### 
     147        form = QFormLayout() 
     148        box = OWGUI.widgetBox(self.controlArea, "Other Options", 
     149                              orientation=form) 
    136150         
    137151        self.quote_edit = QLineEdit(objectName="quote_edit", 
     
    140154                                    toolTip="Text quote character.") 
    141155         
    142         form = QFormLayout() 
    143         box = OWGUI.widgetBox(self.controlArea, "Other Options", 
    144                               orientation=form) 
    145          
    146 #        form_left.addRow("Delimiter", self.delimiter_edit) 
    147156        form.addRow("Quote", self.quote_edit) 
    148157         
     158        self.missing_edit = QLineEdit(objectName="missing_edit", 
     159                                      text=self.missing, 
     160                                      editingFinished=self.missing_changed, 
     161                                      toolTip="Missing value flags (separated by a comma)." 
     162                                      ) 
     163         
     164        form.addRow("Missing values", self.missing_edit) 
     165         
     166        self.skipinitialspace_check = \ 
     167                QCheckBox(objectName="skipinitialspace_check", 
     168                          checked=self.skipinitialspace, 
     169                          text="Skip initial whitespace", 
     170                          toolTip="Skip any whitespace at the beginning of each cell.", 
     171                          toggled=self.skipinitialspace_changed 
     172                          ) 
     173                 
     174        form.addRow(self.skipinitialspace_check) 
     175                 
    149176        self.has_header_check = \ 
    150177                QCheckBox(objectName="has_header_check", 
     
    176203        self.data = None 
    177204         
    178         self.resize(400, 350) 
     205        self.resize(450, 500) 
     206        if self.recent_files: 
     207            QTimer.singleShot(1, lambda: self.set_selected_file(self.recent_files[0])) 
    179208         
    180209    def on_select_recent(self, recent): 
     
    191220            basedir, name = os.path.split(path) 
    192221            self.recent_combo.insertItem(0, name) 
     222            self.recent_combo.setCurrentIndex(0) 
    193223            self.recent_files.insert(0, path) 
    194224            self.set_selected_file(path) 
     
    206236            self.update_preview() 
    207237             
     238    def missing_changed(self): 
     239        self.missing = str(self.missing_edit.text()) 
     240        self.update_preview() 
     241             
    208242    def has_header_changed(self): 
    209243        self.has_header = self.has_header_check.isChecked() 
     
    212246    def has_orange_header_changed(self): 
    213247        self.has_orange_header = self.has_orange_header_check.isChecked() 
     248        self.update_preview() 
     249         
     250    def skipinitialspace_changed(self): 
     251        self.skipinitialspace = self.skipinitialspace_check.isChecked() 
    214252        self.update_preview() 
    215253             
     
    222260         
    223261        delimiter = hints["delimiter"] 
     262         
     263        # Update the widget state (GUI) from the saved hints for the file 
    224264        preset = [d[1] for d in self.DELIMITERS[:-1]] 
    225265        if delimiter not in preset: 
    226266            self.delimiter = None 
    227267            self.other_delimiter = delimiter 
     268            index = len(self.DELIMITERS) - 1 
     269            button = self.delimiter_button_group.button(index) 
     270            button.setChecked(True) 
    228271            self.delimiter_edit.setText(self.other_delimiter) 
    229272            self.delimiter_edit.setEnabled(True) 
    230273        else: 
     274            self.delimiter = delimiter 
    231275            index = preset.index(delimiter) 
    232276            button = self.delimiter_button_group.button(index) 
     
    237281        self.quote_edit.setText(self.quote) 
    238282         
     283        self.missing = hints["DK"] or "" 
     284        self.missing_edit.setText(self.missing) 
     285         
    239286        self.has_header = hints["has_header"] 
    240287        self.has_header_check.setChecked(self.has_header) 
     
    242289        self.has_orange_header = hints["has_orange_header"] 
    243290        self.has_orange_header_check.setChecked(self.has_orange_header) 
     291         
     292        self.skipinitialspace = hints["skipinitialspace"] 
     293        self.skipinitialspace_check.setChecked(self.skipinitialspace) 
    244294         
    245295        self.selected_file = filename 
     
    252302         
    253303    def update_preview(self): 
     304        self.error(0) 
    254305        if self.selected_file: 
    255306            head = StringIO("".join(self.selected_file_head)) 
    256307            hints = self.hints[self.selected_file] 
    257308             
     309            # Save hints for the selected file 
    258310            hints["quote"] = self.quote 
    259311            hints["delimiter"] = self.delimiter or self.other_delimiter 
    260312            hints["has_header"] = self.has_header 
    261             hints["has_orange_header"] = self.has_orange_header  
    262              
     313            hints["has_orange_header"] = self.has_orange_header 
     314            hints["skipinitialspace"] = self.skipinitialspace  
     315            hints["DK"] = self.missing or None 
    263316            try: 
    264317                data = Orange.data.io.load_csv(head, delimiter=self.delimiter, 
     
    267320                                               has_types=self.has_orange_header, 
    268321                                               has_annotations=self.has_orange_header, 
     322                                               skipinitialspace=self.skipinitialspace, 
     323                                               DK=self.missing or None 
    269324                                               ) 
    270325            except Exception, ex: 
    271326                self.error(0, "Cannot parse (%r)" % ex) 
    272                 self.data = None 
    273                 return 
    274             model = ExampleTableModel(data, None, self) 
     327                data = None 
     328                 
     329            if data is not None: 
     330                model = ExampleTableModel(data, None, self) 
     331            else: 
     332                model = None 
    275333            self.preview_view.setModel(model) 
     334             
     335    def send_data(self): 
     336        self.error(0) 
     337        if self.selected_file: 
     338            hints = self.hints[self.selected_file] 
     339            try: 
     340                data = Orange.data.io.load_csv(self.selected_file, 
     341                                               delimiter=self.delimiter, 
     342                                               quotechar=self.quote, 
     343                                               has_header=self.has_header, 
     344                                               has_annotations=self.has_orange_header, 
     345                                               skipinitialspace=self.skipinitialspace, 
     346                                               DK=self.missing or None 
     347                                               ) 
     348            except Exception, ex: 
     349                self.error(0, "An error occurred while loading the file:\n\t%r" % ex) 
     350                data = None 
    276351            self.data = data 
    277              
    278     def send_data(self): 
    279352        self.send("Data", self.data) 
    280353         
     
    296369            "skipinitialspace": dialect.skipinitialspace, 
    297370            "has_header": has_header, 
    298             "has_orange_header": False} 
     371            "has_orange_header": False, 
     372            "skipinitialspace": True, 
     373            "DK": None, 
     374            } 
    299375     
    300376if __name__ == "__main__": 
  • Orange/OrangeWidgets/Visualize Qt/OWLinProj3DPlot.py

    r9671 r10542  
    55from plot import OWPoint 
    66 
    7 from Orange.preprocess.scaling import ScaleLinProjData3D, get_variable_values_sorted 
     7from Orange.data.preprocess.scaling import ScaleLinProjData3D, get_variable_values_sorted 
    88import orange 
    99Discrete = orange.VarTypes.Discrete 
  • Orange/OrangeWidgets/Visualize Qt/OWScatterPlot3D.py

    r9671 r10542  
    1616Continuous = orange.VarTypes.Continuous 
    1717 
    18 from Orange.preprocess.scaling import get_variable_values_sorted 
     18from Orange.data.preprocess.scaling import get_variable_values_sorted 
    1919 
    2020import OWGUI 
  • Orange/OrangeWidgets/plot/owtools.py

    r9671 r10542  
    4141from owpalette import OWPalette 
    4242 
    43 from Orange.preprocess.scaling import get_variable_values_sorted 
     43from Orange.data.preprocess.scaling import get_variable_values_sorted 
    4444import orangeom 
    4545import ColorPalette 
  • Orange/__init__.py

    r10540 r10549  
    3131_import("data.sample") 
    3232_import("data.outliers") 
     33_import("data.preprocess") 
     34_import("data.preprocess.scaling") 
    3335_import("data.utils") 
    3436_import("data.discretization") 
     
    104106_import("associate") 
    105107 
    106 _import("preprocess") 
    107 _import("preprocess.scaling") 
    108  
    109108_import("distance") 
    110109 
  • Orange/classification/logreg.py

    r10387 r10542  
    11import Orange 
    22from Orange.misc import deprecated_keywords, deprecated_members 
     3from Orange.data import preprocess 
    34import math 
     5 
     6 
    47from numpy import dot, array, identity, reshape, diagonal, \ 
    58    transpose, concatenate, sqrt, sign 
     
    746749        examples = self.imputer(examples)(examples) 
    747750    if getattr(self, "removeMissing", 0): 
    748         examples = Orange.core.Preprocessor_dropMissing(examples) 
    749     continuizer = Orange.preprocess.DomainContinuizer(zeroBased=1, 
    750         continuousTreatment=Orange.preprocess.DomainContinuizer.Leave, 
    751                                            multinomialTreatment = Orange.preprocess.DomainContinuizer.FrequentIsBase, 
    752                                            classTreatment = Orange.preprocess.DomainContinuizer.Ignore) 
     751        examples = preprocess.DropMissing(examples) 
     752    continuizer = preprocess.DomainContinuizer(zeroBased=1, 
     753        continuousTreatment=preprocess.DomainContinuizer.Leave, 
     754                                           multinomialTreatment = preprocess.DomainContinuizer.FrequentIsBase, 
     755                                           classTreatment = preprocess.DomainContinuizer.Ignore) 
    753756    attr = [] 
    754757    remain_attr = examples.domain.features[:] 
  • Orange/classification/svm/__init__.py

    r10369 r10542  
    1818                        SVMClassifierSparse 
    1919 
    20 from Orange.preprocess import Preprocessor_impute, \ 
    21                               Preprocessor_continuize, \ 
    22                               Preprocessor_preprocessorList, \ 
    23                               DomainContinuizer 
     20from Orange.data import preprocess 
    2421 
    2522from Orange import feature as variable 
     
    243240 
    244241    def _normalize(self, data): 
    245         dc = Orange.core.DomainContinuizer() 
    246         dc.class_treatment = Orange.core.DomainContinuizer.Ignore 
    247         dc.continuous_treatment = Orange.core.DomainContinuizer.NormalizeBySpan 
    248         dc.multinomial_treatment = Orange.core.DomainContinuizer.NValues 
     242        dc = preprocess.DomainContinuizer() 
     243        dc.class_treatment = preprocess.DomainContinuizer.Ignore 
     244        dc.continuous_treatment = preprocess.DomainContinuizer.NormalizeBySpan 
     245        dc.multinomial_treatment = preprocess.DomainContinuizer.NValues 
    249246        newdomain = dc(data) 
    250247        return data.translate(newdomain) 
     
    308305    def _normalize(self, data): 
    309306        if self.use_non_meta: 
    310             dc = Orange.core.DomainContinuizer() 
    311             dc.class_treatment = Orange.core.DomainContinuizer.Ignore 
    312             dc.continuous_treatment = Orange.core.DomainContinuizer.NormalizeBySpan 
    313             dc.multinomial_treatment = Orange.core.DomainContinuizer.NValues 
     307            dc = preprocess.DomainContinuizer() 
     308            dc.class_treatment = preprocess.DomainContinuizer.Ignore 
     309            dc.continuous_treatment = preprocess.DomainContinuizer.NormalizeBySpan 
     310            dc.multinomial_treatment = preprocess.DomainContinuizer.NValues 
    314311            newdomain = dc(data) 
    315312            data = data.translate(newdomain) 
     
    332329 
    333330    def learn_classifier(self, data): 
    334         transformer = Orange.core.DomainContinuizer() 
    335         transformer.multinomialTreatment = Orange.core.DomainContinuizer.NValues 
     331        transformer = preprocess.DomainContinuizer() 
     332        transformer.multinomialTreatment = preprocess.DomainContinuizer.NValues 
    336333        transformer.continuousTreatment = \ 
    337             Orange.core.DomainContinuizer.NormalizeBySpan 
    338         transformer.classTreatment = Orange.core.DomainContinuizer.Ignore 
     334            preprocess.DomainContinuizer.NormalizeBySpan 
     335        transformer.classTreatment = preprocess.DomainContinuizer.Ignore 
    339336        newdomain = transformer(data) 
    340337        newexamples = data.translate(newdomain) 
     
    371368    # Construct and return a default preprocessor for use by 
    372369    # Orange.core.LinearLearner learner. 
    373     impute = Preprocessor_impute() 
    374     cont = Preprocessor_continuize(multinomialTreatment= 
    375                                    DomainContinuizer.AsOrdinal) 
    376     preproc = Preprocessor_preprocessorList(preprocessors= 
     370    impute = preprocess.Impute() 
     371    cont = preprocess.Continuize(multinomialTreatment= 
     372                                   preprocess.DomainContinuizer.AsOrdinal) 
     373    preproc = preprocess.PreprocessorList(preprocessors= 
    377374                                            [impute, cont]) 
    378375    return preproc 
  • Orange/clustering/mixture.py

    r9976 r10542  
    290290         
    291291    def __call__(self, data, weight_id=None): 
    292         from Orange.preprocess import Preprocessor_impute, DomainContinuizer 
     292        from Orange.data import preprocess 
     293        #import Preprocessor_impute, DomainContinuizer 
    293294#        data = Preprocessor_impute(data) 
    294         dc = DomainContinuizer() 
    295         dc.multinomial_treatment = DomainContinuizer.AsOrdinal 
    296         dc.continuous_treatment = DomainContinuizer.NormalizeByVariance 
    297         dc.class_treatment = DomainContinuizer.Ignore 
     295        dc = preprocess.DomainContinuizer() 
     296        dc.multinomial_treatment = preprocess.DomainContinuizer.AsOrdinal 
     297        dc.continuous_treatment = preprocess.DomainContinuizer.NormalizeByVariance 
     298        dc.class_treatment = preprocess.DomainContinuizer.Ignore 
    298299        domain = dc(data) 
    299300        data = data.translate(domain) 
     
    308309#        array /= std.reshape((1, -1)) 
    309310#        means /= std.reshape((1, -1)) 
    310         solver = EMSolver(array, numpy.ones((self.n)) / self.n, 
     311        solver = EMSolver(array, numpy.ones(self.n) / self.n, 
    311312                          means, correlations) 
    312313        solver.run() 
  • Orange/data/io.py

    r10528 r10532  
    531531            specifier = "class" 
    532532            items = items[1:] 
     533        elif items[0] == "multiclass": 
     534            specifier = "multiclass" 
     535            items = items[1:] 
     536        elif items[0] in ["i", "ignore"]: 
     537            specifier = "ignore" 
     538            items = items[1:] 
    533539        return specifier, dict(map(_var_attribute_label_parse, items)) 
    534540    else: 
     
    536542 
    537543def var_attributes(row): 
    538     """ Return variable specifiers and label definitions for row 
     544    """ Return variable specifiers and label definitions for row. 
    539545    """ 
    540546    return map(var_attribute, row) 
     
    583589def load_csv(file, create_new_on=MakeStatus.Incompatible,  
    584590             delimiter=None, quotechar=None, escapechar=None, 
    585              has_header=None, has_types=None, has_annotations=None, **kwargs): 
     591             skipinitialspace=None, has_header=None,  
     592             has_types=None, has_annotations=None, DK=None, **kwargs): 
    586593    """ Load an Orange.data.Table from s csv file. 
    587594    """ 
     
    604611    fmtparam = kwparams(delimiter=delimiter, 
    605612                        quotechar=quotechar, 
    606                         escapechar=escapechar) 
     613                        escapechar=escapechar, 
     614                        skipinitialspace=skipinitialspace) 
    607615     
    608616    reader = csv.reader(file, dialect=dialect, 
     
    661669    variables = [] 
    662670    undefined_vars = [] 
     671    # Missing value flags  
     672    missing_flags = DK.split(",") if DK is not None else ["?", "", "NA", "~", "*"] 
     673    missing_map = dict.fromkeys(missing_flags, "?") 
     674    missing_translate = lambda val: missing_map.get(val, val) 
     675        
     676    # Create domain variables or corresponding place holders 
    663677    for i, (name, var_t) in enumerate(zip(header, types)): 
    664         if var_t == variable.Discrete:# We do not have values yet. 
     678        if var_t == variable.Discrete: 
     679            # We do not have values yet 
    665680            variables.append(_disc_placeholder(name)) 
    666681            undefined_vars.append((i, variables[-1])) 
     
    674689            var_t, values = var_t 
    675690            if var_t == variable.Discrete: 
     691                # We have values for discrete variable 
    676692                variables.append(make(name, Orange.feature.Type.Discrete, values, [], create_new_on)) 
    677693            elif var_t == variable.Python: 
     694                # Python variables are not supported yet 
    678695                raise NotImplementedError() 
    679696        elif var_t is None: 
     697            # Unknown variable type, to be deduced at the end 
    680698            variables.append(_var_placeholder(name)) 
    681699            undefined_vars.append((i, variables[-1])) 
    682700 
    683701    data = [] 
     702    # Read all the rows 
    684703    for row in reader: 
    685         data.append(row) 
    686         for ind, var_def in undefined_vars: 
    687             var_def.values.add(row[ind]) 
    688  
     704        # check for final newline. 
     705        if row: 
     706            row = map(missing_translate, row) 
     707            data.append(row) 
     708            # For undefined variables collect all their values 
     709            for ind, var_def in undefined_vars: 
     710                var_def.values.add(row[ind]) 
     711     
     712    # Process undefined variables now that we can deduce their type  
    689713    for ind, var_def in undefined_vars: 
    690714        values = var_def.values - set(["?", ""]) # TODO: Other unknown strings? 
     
    702726                raise ValueError("Strange column in the data") 
    703727 
    704     vars = [] 
    705     vars_load_status = [] 
    706728    attribute_load_status = [] 
    707729    meta_attribute_load_status = {} 
    708730    class_var_load_status = [] 
    709     for var, status in vars: 
    710         vars.append(var) 
    711         vars_load_status.append(status) 
     731    multiclass_var_load_status = [] 
    712732 
    713733    attributes = [] 
    714734    class_var = [] 
     735    class_vars = [] 
    715736    metas = {} 
    716737    attribute_indices = [] 
    717738    variable_indices = [] 
    718739    class_indices = [] 
     740    multiclass_indices = [] 
    719741    meta_indices = [] 
     742    ignore_indices = [] 
    720743    for i, ((var, status), var_attr) in enumerate(zip(variables, var_attrs)): 
    721744        if var_attr: 
     
    725748                class_var_load_status.append(status) 
    726749                class_indices.append(i) 
     750            elif flag == "multiclass": 
     751                class_vars.append(var) 
     752                multiclass_var_load_status.append(status) 
     753                multiclass_indices.append(i) 
    727754            elif flag == "meta": 
    728755                mid = Orange.feature.Descriptor.new_meta_id() 
     
    730757                meta_attribute_load_status[mid] = status 
    731758                meta_indices.append((i, var)) 
     759            elif flag == "ignore": 
     760                ignore_indices.append(i) 
    732761            else: 
    733762                attributes.append(var) 
     
    742771    if len(class_var) > 1: 
    743772        raise ValueError("Multiple class variables defined") 
     773    if class_var and class_vars: 
     774        raise ValueError("Both 'class' and 'multiclass' used.") 
    744775 
    745776    class_var = class_var[0] if class_var else None 
    746  
     777     
    747778    attribute_load_status += class_var_load_status 
    748779    variable_indices = attribute_indices + class_indices 
    749     domain = Orange.data.Domain(attributes, class_var) 
     780    domain = Orange.data.Domain(attributes, class_var, class_vars=class_vars) 
    750781    domain.add_metas(metas) 
    751782    normal = [[row[i] for i in variable_indices] for row in data] 
    752783    meta_part = [[row[i] for i, _ in meta_indices] for row in data] 
     784    multiclass_part = [[row[i] for i in multiclass_indices] for row in data] 
    753785    table = Orange.data.Table(domain, normal) 
    754     for ex, m_part in zip(table, meta_part): 
     786    for ex, m_part, mc_part in zip(table, meta_part, multiclass_part): 
    755787        for (column, var), val in zip(meta_indices, m_part): 
    756788            ex[var] = var(val) 
     789        if mc_part: 
     790            ex.set_classes(mc_part) 
    757791 
    758792    table.setattr("metaAttributeLoadStatus", meta_attribute_load_status) 
  • Orange/doc/extend-widgets/owplot_example.py

    r9671 r10542  
    55import random 
    66import orange 
    7 from Orange.preprocess.scaling import get_variable_values_sorted 
     7from Orange.data.preprocess.scaling import get_variable_values_sorted 
    88 
    99class BasicPlot(OWPlot): 
  • Orange/evaluation/scoring.py

    r10429 r10548  
    18161816                                "classIndex2": "class_index2"})( 
    18171817           deprecated_function_name(AUC_for_pair_of_classes))) 
    1818 AUC_matrix = replace_use_weights(deprecated_function_name(AUC_matrix)) 
     1818AUC_matrix = replace_use_weights(AUC_matrix) 
    18191819 
    18201820 
  • Orange/feature/discretization.py

    r9944 r10544  
    3131    """ 
    3232    orange.setrandseed(0) 
    33     data_new = orange.Preprocessor_discretize(data, method=Entropy()) 
     33    data_new = Orange.data.preprocess.Discretize(data, method=Entropy()) 
    3434     
    3535    attrlist = [] 
     
    109109    def __call__(self, data, weight=None): 
    110110        # filter the data and then learn 
    111         from Orange.preprocess import Preprocessor_discretize 
    112         ddata = Preprocessor_discretize(data, method=self.discretizer) 
     111        from Orange.data.preprocess import Discretize 
     112        ddata = Discretize(data, method=self.discretizer) 
    113113        if weight<>None: 
    114114            model = self.baseLearner(ddata, weight) 
  • Orange/feature/scoring.py

    r10524 r10543  
    1 import Orange.core as orange 
    2 import Orange.misc 
    3  
    4 from orange import MeasureAttribute as Score 
    5 from orange import MeasureAttributeFromProbabilities as ScoreFromProbabilities 
    6 from orange import MeasureAttribute_info as InfoGain 
    7 from orange import MeasureAttribute_gainRatio as GainRatio 
    8 from orange import MeasureAttribute_gini as Gini 
    9 from orange import MeasureAttribute_relevance as Relevance  
    10 from orange import MeasureAttribute_cost as Cost 
    11 from orange import MeasureAttribute_relief as Relief 
    12 from orange import MeasureAttribute_MSE as MSE 
     1from Orange import core, feature 
     2from Orange.statistics import contingency, distribution 
     3 
     4from Orange.misc import deprecated_keywords, deprecated_members 
     5 
     6Score = core.MeasureAttribute 
     7ScoreFromProbabilities = core.MeasureAttributeFromProbabilities 
     8InfoGain = core.MeasureAttribute_info 
     9GainRatio = core.MeasureAttribute_gainRatio 
     10Gini = core.MeasureAttribute_gini 
     11Relevance = core.MeasureAttribute_relevance 
     12Cost = core.MeasureAttribute_cost 
     13Relief = core.MeasureAttribute_relief 
     14MSE = core.MeasureAttribute_MSE 
    1315 
    1416###### 
     
    3133 
    3234        :param data: a data table used to score features 
    33         :type data: Orange.data.Table 
     35        :type data: :obj:`~Orange.data.Table` 
    3436 
    3537        :param weight: meta attribute that stores weights of instances 
    36         :type weight: Orange.feature.Descriptor 
     38        :type weight: :obj:`~Orange.feature.Descriptor` 
    3739 
    3840        """ 
     
    4648        return [x[0] for x in measured] 
    4749 
    48 OrderAttributes = Orange.misc.deprecated_members({ 
     50OrderAttributes = deprecated_members({ 
    4951          "measure": "score", 
    5052}, wrap_methods=[])(OrderAttributes) 
     
    5961    """ 
    6062 
    61     @Orange.misc.deprecated_keywords({"aprioriDist": "apriori_dist"}) 
     63    @deprecated_keywords({"aprioriDist": "apriori_dist"}) 
    6264    def __new__(cls, attr=None, data=None, apriori_dist=None, weightID=None): 
    6365        self = Score.__new__(cls) 
    64         if attr != None and data != None: 
     66        if attr is not None and data is not None: 
    6567            #self.__init__(**argkw) 
    6668            return self.__call__(attr, data, apriori_dist, weightID) 
     
    6870            return self 
    6971 
    70     @Orange.misc.deprecated_keywords({"aprioriDist": "apriori_dist"}) 
     72    @deprecated_keywords({"aprioriDist": "apriori_dist"}) 
    7173    def __call__(self, attr, data, apriori_dist=None, weightID=None): 
    7274        """Score the given feature. 
    7375 
    7476        :param attr: feature to score 
    75         :type attr: Orange.feature.Descriptor 
     77        :type attr: :obj:`~Orange.feature.Descriptor` 
    7678 
    7779        :param data: a data table used to score features 
    78         :type data: Orange.data.table 
     80        :type data: :obj:`~Orange.data.Table` 
    7981 
    8082        :param apriori_dist:  
     
    8284         
    8385        :param weightID: meta feature used to weight individual data instances 
    84         :type weightID: Orange.feature.Descriptor 
     86        :type weightID: :obj:`~Orange.feature.Descriptor` 
    8587 
    8688        """ 
    8789        import numpy 
    88         from orngContingency import Entropy 
     90        from orngContingency import Entropy #TODO: Move to new hierarchy 
    8991        if attr in data.domain:  # if we receive attr as string we have to convert to variable 
    9092            attr = data.domain[attr] 
    91         attrClassCont = orange.ContingencyAttrClass(attr, data) 
     93        attrClassCont = contingency.VarClass(attr, data) 
    9294        dist = [] 
    9395        for vals in attrClassCont.values(): 
     
    116118    """ 
    117119 
    118     @Orange.misc.deprecated_keywords({"aprioriDist": "apriori_dist"}) 
     120    @deprecated_keywords({"aprioriDist": "apriori_dist"}) 
    119121    def __new__(cls, attr=None, data=None, apriori_dist=None, weightID=None): 
    120122        self = Score.__new__(cls) 
    121         if attr != None and data != None: 
     123        if attr is not None and data is not None: 
    122124            #self.__init__(**argkw) 
    123125            return self.__call__(attr, data, apriori_dist, weightID) 
     
    125127            return self 
    126128 
    127     @Orange.misc.deprecated_keywords({"aprioriDist": "apriori_dist"}) 
     129    @deprecated_keywords({"aprioriDist": "apriori_dist"}) 
    128130    def __call__(self, attr, data, apriori_dist=None, weightID=None): 
    129131        """Score the given feature. 
    130132 
    131133        :param attr: feature to score 
    132         :type attr: Orange.feature.Descriptor 
     134        :type attr: :obj:`~Orange.feature.Descriptor` 
    133135 
    134136        :param data: a data table used to score the feature 
    135         :type data: Orange.data.table 
     137        :type data: :obj:`~Orange.data.Table` 
    136138 
    137139        :param apriori_dist:  
     
    139141         
    140142        :param weightID: meta feature used to weight individual data instances 
    141         :type weightID: Orange.feature.Descriptor 
     143        :type weightID: :obj:`~Orange.feature.Descriptor` 
    142144 
    143145        """ 
    144         attrClassCont = orange.ContingencyAttrClass(attr, data) 
    145         classDist = orange.Distribution(data.domain.classVar, data).values() 
     146        attrClassCont = contingency.VarClass(attr, data) 
     147        classDist = distribution.Distribution(data.domain.classVar, data).values() 
    146148        nCls = len(classDist) 
    147149        nEx = len(data) 
     
    177179 
    178180 
    179 @Orange.misc.deprecated_keywords({"attrList": "attr_list", "attrMeasure": "attr_score", "removeUnusedValues": "remove_unused_values"}) 
     181@deprecated_keywords({"attrList": "attr_list", "attrMeasure": "attr_score", "removeUnusedValues": "remove_unused_values"}) 
    180182def merge_values(data, attr_list, attr_score, remove_unused_values = 1): 
    181183    import orngCI 
     
    183185    newData = data.select(attr_list + [data.domain.class_var]) 
    184186    newAttr = orngCI.FeatureByCartesianProduct(newData, attr_list)[0] 
    185     dist = orange.Distribution(newAttr, newData) 
     187    dist = distribution.Distribution(newAttr, newData) 
    186188    activeValues = [] 
    187189    for i in range(len(newAttr.values)): 
     
    213215        return newAttr 
    214216 
    215     reducedAttr = orange.EnumVariable(newAttr.name, values = [newAttr.values[i] for i in activeValues]) 
     217    reducedAttr = feature.Discrete.EnumVariable(newAttr.name, values = [newAttr.values[i] for i in activeValues]) 
    216218    reducedAttr.get_value_from = newAttr.get_value_from 
    217219    reducedAttr.get_value_from.class_var = reducedAttr 
     
    220222###### 
    221223# from orngFSS 
    222 @Orange.misc.deprecated_keywords({"measure": "score"}) 
     224@deprecated_keywords({"measure": "score"}) 
    223225def score_all(data, score=Relief(k=20, m=50)): 
    224226    """Assess the quality of features using the given measure and return 
     
    226228 
    227229    :param data: data table should include a discrete class. 
    228     :type data: :obj:`Orange.data.Table` 
     230    :type data: :obj:`~Orange.data.Table` 
    229231    :param score:  feature scoring function. Derived from 
    230232      :obj:`~Orange.feature.scoring.Score`. Defaults to  
    231233      :obj:`~Orange.feature.scoring.Relief` with k=20 and m=50. 
    232     :type measure: :obj:`~Orange.feature.scoring.Score`  
    233     :rtype: :obj:`list`; a sorted (by descending score) list of 
    234       tuples (feature name, score) 
     234    :type score: :obj:`~Orange.feature.scoring.Score` 
     235    :rtype: :obj:`list`; a sorted list of tuples (feature name, score) 
    235236 
    236237    """ 
  • Orange/fixes/fix_changed_names.py

    r10378 r10542  
    472472           "orngLR.zprob":"Orange.classification.logreg.zprob", 
    473473 
    474            "orange.Preprocessor": "Orange.preprocess.Preprocessor", 
    475            "orange.Preprocessor_addCensorWeight": "Orange.preprocess.Preprocessor_addCensorWeight", 
    476            "orange.Preprocessor_addClassNoise": "Orange.preprocess.Preprocessor_addClassNoise", 
    477            "orange.Preprocessor_addClassWeight": "Orange.preprocess.Preprocessor_addClassWeight", 
    478            "orange.Preprocessor_addGaussianClassNoise": "Orange.preprocess.Preprocessor_addGaussianClassNoise", 
    479            "orange.Preprocessor_addGaussianNoise": "Orange.preprocess.Preprocessor_addGaussianNoise", 
    480            "orange.Preprocessor_addMissing": "Orange.preprocess.Preprocessor_addMissing", 
    481            "orange.Preprocessor_addMissingClasses": "Orange.preprocess.Preprocessor_addMissingClasses", 
    482            "orange.Preprocessor_addNoise": "Orange.preprocess.Preprocessor_addNoise", 
    483            "orange.Preprocessor_discretize": "Orange.preprocess.Preprocessor_discretize", 
    484            "orange.Preprocessor_drop": "Orange.preprocess.Preprocessor_drop", 
    485            "orange.Preprocessor_dropMissing": "Orange.preprocess.Preprocessor_dropMissing", 
    486            "orange.Preprocessor_dropMissingClasses": "Orange.preprocess.Preprocessor_dropMissingClasses", 
    487            "orange.Preprocessor_filter": "Orange.preprocess.Preprocessor_filter", 
    488            "orange.Preprocessor_ignore": "Orange.preprocess.Preprocessor_ignore", 
    489            "orange.Preprocessor_imputeByLearner": "Orange.preprocess.Preprocessor_imputeByLearner", 
    490            "orange.Preprocessor_removeDuplicates": "Orange.preprocess.Preprocessor_removeDuplicates", 
    491            "orange.Preprocessor_select": "Orange.preprocess.Preprocessor_select", 
    492            "orange.Preprocessor_shuffle": "Orange.preprocess.Preprocessor_shuffle", 
    493            "orange.Preprocessor_take": "Orange.preprocess.Preprocessor_take", 
    494            "orange.Preprocessor_takeMissing": "Orange.preprocess.Preprocessor_takeMissing", 
    495            "orange.Preprocessor_takeMissingClasses": "Orange.preprocess.Preprocessor_takeMissingClasses", 
     474           "orange.Preprocessor": "Orange.data.preprocess.Preprocessor", 
     475           "orange.Preprocessor_addCensorWeight": "Orange.data.preprocess.AddCensorWeight", 
     476           "orange.Preprocessor_addClassNoise": "Orange.data.preprocess.AddClassNoise", 
     477           "orange.Preprocessor_addClassWeight": "Orange.data.preprocess.AddClassWeight", 
     478           "orange.Preprocessor_addGaussianClassNoise": "Orange.data.preprocess.AddGaussianClassNoise", 
     479           "orange.Preprocessor_addGaussianNoise": "Orange.data.preprocess.AddGaussianNoise", 
     480           "orange.Preprocessor_addMissing": "Orange.data.preprocess.AddMissing", 
     481           "orange.Preprocessor_addMissingClasses": "Orange.data.preprocess.AddMissingClasses", 
     482           "orange.Preprocessor_addNoise": "Orange.data.preprocess.AddNoise", 
     483           "orange.Preprocessor_discretize": "Orange.data.preprocess.Discretize", 
     484           "orange.Preprocessor_drop": "Orange.data.preprocess.Drop", 
     485           "orange.Preprocessor_dropMissing": "Orange.data.preprocess.DropMissing", 
     486           "orange.Preprocessor_dropMissingClasses": "Orange.data.preprocess.DropMissingClasses", 
     487           "orange.Preprocessor_filter": "Orange.data.preprocess.Filter", 
     488           "orange.Preprocessor_ignore": "Orange.data.preprocess.Ignore", 
     489           "orange.Preprocessor_imputeByLearner": "Orange.data.preprocess.ImputeByLearner", 
     490           "orange.Preprocessor_removeDuplicates": "Orange.data.preprocess.RemoveDuplicates", 
     491           "orange.Preprocessor_select": "Orange.data.preprocess.Select", 
     492           "orange.Preprocessor_shuffle": "Orange.data.preprocess.Shuffle", 
     493           "orange.Preprocessor_take": "Orange.data.preprocess.Take", 
     494           "orange.Preprocessor_takeMissing": "Orange.data.preprocess.TakeMissing", 
     495           "orange.Preprocessor_takeMissingClasses": "Orange.data.preprocess.TakeMissingClasses", 
    496496 
    497497           "orange.Discretizer": "Orange.feature.discretization.Discretizer", 
     
    573573           "orngEnviron.addOrangeDirectoriesToPath": "Orange.misc.environ.add_orange_directories_to_path", 
    574574 
    575            "orngScaleData.getVariableValuesSorted": "Orange.preprocess.scaling.get_variable_values_sorted", 
    576            "orngScaleData.getVariableValueIndices": "Orange.preprocess.scaling.get_variable_value_indices", 
    577            "orngScaleData.discretizeDomain": "Orange.preprocess.scaling.discretize_domain", 
    578            "orngScaleData.orngScaleData": "Orange.preprocess.scaling.ScaleData", 
    579            "orngScaleLinProjData.orngScaleLinProjData": "Orange.preprocess.scaling.ScaleLinProjData", 
    580            "orngScalePolyvizData.orngScalePolyvizData": "Orange.preprocess.scaling.ScalePolyvizData", 
    581            "orngScaleScatterPlotData.orngScaleScatterPlotData": "Orange.preprocess.scaling.ScaleScatterPlotData", 
     575           "orngScaleData.getVariableValuesSorted": "Orange.data.preprocess.scaling.get_variable_values_sorted", 
     576           "orngScaleData.getVariableValueIndices": "Orange.data.preprocess.scaling.get_variable_value_indices", 
     577           "orngScaleData.discretizeDomain": "Orange.data.preprocess.scaling.discretize_domain", 
     578           "orngScaleData.orngScaleData": "Orange.data.preprocess.scaling.ScaleData", 
     579           "orngScaleLinProjData.orngScaleLinProjData": "Orange.data.preprocess.scaling.ScaleLinProjData", 
     580           "orngScalePolyvizData.orngScalePolyvizData": "Orange.data.preprocess.scaling.ScalePolyvizData", 
     581           "orngScaleScatterPlotData.orngScaleScatterPlotData": "Orange.data.preprocess.scaling.ScaleScatterPlotData", 
    582582 
    583583           "orngEvalAttr.mergeAttrValues": "Orange.feature.scoring.merge_values", 
  • Orange/misc/testing.py

    r10305 r10542  
    8686 
    8787import orange 
    88 from Orange.preprocess import Preprocessor_discretize, Preprocessor_continuize 
     88from Orange.data import preprocess 
    8989 
    9090TEST_CLASSIFICATION = 1 
     
    108108    dataset = orange.ExampleTable(os.path.join(datasetsdir, name)) 
    109109    if flags & CONTINUIZE_DOMAIN: 
    110         preprocessor = Preprocessor_continuize() 
     110        preprocessor = preprocess.Continuize() 
    111111        dataset = preprocessor(dataset) 
    112112    elif flags & DISCRETIZE_DOMAIN: 
    113         preprocessor = Preprocessor_discretize(method=orange.EquiNDiscretization(), 
     113        preprocessor = preprocess.Discretize(method=orange.EquiNDiscretization(), 
    114114                                               discretize_class=False) 
    115115        dataset = preprocessor(dataset) 
  • Orange/orng/orngScaleData.py

    r9671 r10542  
    1 from Orange.preprocess.scaling import get_variable_values_sorted as getVariableValuesSorted 
    2 from Orange.preprocess.scaling import get_variable_value_indices as getVariableValueIndices 
    3 from Orange.preprocess.scaling import discretize_domain as discretizeDomain 
    4 from Orange.preprocess.scaling import ScaleData as orngScaleData 
     1from Orange.data.preprocess.scaling import get_variable_values_sorted as getVariableValuesSorted 
     2from Orange.data.preprocess.scaling import get_variable_value_indices as getVariableValueIndices 
     3from Orange.data.preprocess.scaling import discretize_domain as discretizeDomain 
     4from Orange.data.preprocess.scaling import ScaleData as orngScaleData 
  • Orange/orng/orngScaleLinProjData.py

    r10475 r10542  
    11from orngScaleData import * 
    2 from Orange.preprocess.scaling import ScaleLinProjData as orngScaleLinProjData 
    3 from Orange.preprocess.scaling import graph_deprecator 
     2from Orange.data.preprocess.scaling import ScaleLinProjData as orngScaleLinProjData 
     3from Orange.data.preprocess.scaling import graph_deprecator 
  • Orange/orng/orngScalePolyvizData.py

    r9671 r10542  
    11from orngScaleLinProjData import * 
    2 from Orange.preprocess.scaling import ScalePolyvizData as orngScalePolyvizData 
     2from Orange.data.preprocess.scaling import ScalePolyvizData as orngScalePolyvizData 
  • Orange/orng/orngScaleScatterPlotData.py

    r9671 r10542  
    11from orngScaleData import * 
    2 from Orange.preprocess.scaling import ScaleScatterPlotData as orngScaleScatterPlotData 
     2from Orange.data.preprocess.scaling import ScaleScatterPlotData as orngScaleScatterPlotData 
  • Orange/orng/orngVizRank.py

    r9671 r10542  
    114114                graph.normalize_examples = 1 
    115115            elif visualizationMethod == SCATTERPLOT3D: 
    116                 from Orange.preprocess.scaling import ScaleScatterPlotData3D 
     116                from Orange.data.preprocess.scaling import ScaleScatterPlotData3D 
    117117                graph = ScaleScatterPlotData3D() 
    118118            elif visualizationMethod == SPHEREVIZ3D: 
    119                 from Orange.preprocess.scaling import ScaleLinProjData3D 
     119                from Orange.data.preprocess.scaling import ScaleLinProjData3D 
    120120                graph = ScaleLinProjData3D() 
    121121                graph.normalize_examples = 1 
    122122            elif visualizationMethod == LINEAR_PROJECTION3D: 
    123                 from Orange.preprocess.scaling import ScaleLinProjData3D 
     123                from Orange.data.preprocess.scaling import ScaleLinProjData3D 
    124124                graph = ScaleLinProjData3D() 
    125125                graph.normalize_examples = 0 
  • Orange/projection/linear.py

    r10490 r10542  
    88import numpy 
    99 
    10 from Orange.preprocess.scaling import ScaleLinProjData 
     10from Orange.data.preprocess.scaling import ScaleLinProjData 
    1111from Orange.orng import orngVisFuncts as visfuncts 
    1212from Orange.misc import deprecated_keywords 
  • Orange/regression/earth.py

    r10420 r10542  
    5555from Orange.feature import Discrete, Continuous 
    5656from Orange.data import Table, Domain 
    57 from Orange.preprocess import Preprocessor_continuize, \ 
    58                               Preprocessor_impute, \ 
    59                               Preprocessor_preprocessorList, \ 
     57from Orange.data.preprocess import Continuize as Preprocessor_continuize, \ 
     58                              Impute as Preprocessor_impute, \ 
     59                              PreprocessorList as Preprocessor_preprocessorList, \ 
    6060                              DomainContinuizer 
    6161 
  • Orange/testing/unit/tests/test_preprocessors.py

    r10278 r10542  
    44    import unittest 
    55 
    6 from Orange.preprocess import (Preprocessor_addCensorWeight, 
    7          Preprocessor_addClassNoise, 
    8          Preprocessor_addClassWeight, 
    9          Preprocessor_addGaussianClassNoise, 
    10          Preprocessor_addGaussianNoise, 
    11          Preprocessor_addMissing, 
    12          Preprocessor_addMissingClasses, 
    13          Preprocessor_addNoise, 
    14          Preprocessor_discretize, 
    15          Preprocessor_drop, 
    16          Preprocessor_dropMissing, 
    17          Preprocessor_dropMissingClasses, 
    18          Preprocessor_filter, 
    19          Preprocessor_ignore, 
    20          Preprocessor_imputeByLearner, 
    21          Preprocessor_removeDuplicates, 
    22          Preprocessor_select, 
    23          Preprocessor_shuffle, 
    24          Preprocessor_take, 
    25          Preprocessor_takeMissing, 
    26          Preprocessor_takeMissingClasses, 
    27          Preprocessor_discretizeEntropy, 
    28          Preprocessor_removeContinuous, 
    29          Preprocessor_removeDiscrete, 
    30          Preprocessor_continuize, 
    31          Preprocessor_impute, 
    32          Preprocessor_featureSelection, 
    33          Preprocessor_RFE, 
    34          Preprocessor_sample, 
    35          Preprocessor_preprocessorList, 
     6from Orange.data.preprocess import (AddCensorWeight as Preprocessor_addCensorWeight, 
     7         AddClassNoise as  Preprocessor_addClassNoise, 
     8         AddClassWeight as Preprocessor_addClassWeight, 
     9         AddGaussianClassNoise as  Preprocessor_addGaussianClassNoise, 
     10         AddGaussianNoise as Preprocessor_addGaussianNoise, 
     11         AddMissing as Preprocessor_addMissing, 
     12         AddMissingClasses as Preprocessor_addMissingClasses, 
     13         AddNoise as Preprocessor_addNoise, 
     14         Discretize as Preprocessor_discretize, 
     15         Drop as Preprocessor_drop, 
     16         DropMissing as Preprocessor_dropMissing, 
     17         DropMissingClasses as Preprocessor_dropMissingClasses, 
     18         Filter as Preprocessor_filter, 
     19         Ignore as Preprocessor_ignore, 
     20         ImputeByLearner as Preprocessor_imputeByLearner, 
     21         RemoveDuplicates as Preprocessor_removeDuplicates, 
     22         Select as Preprocessor_select, 
     23         Shuffle as Preprocessor_shuffle, 
     24         Take as Preprocessor_take, 
     25         TakeMissing as Preprocessor_takeMissing, 
     26         TakeMissingClasses as Preprocessor_takeMissingClasses, 
     27         DiscretizeEntropy as Preprocessor_discretizeEntropy, 
     28         RemoveContinuous as Preprocessor_removeContinuous, 
     29         RemoveDiscrete as Preprocessor_removeDiscrete, 
     30         Continuize as Preprocessor_continuize, 
     31         Impute as Preprocessor_impute, 
     32         FeatureSelection as Preprocessor_featureSelection, 
     33         RFE as Preprocessor_RFE, 
     34         Sample as Preprocessor_sample, 
     35         PreprocessorList as Preprocessor_preprocessorList, 
    3636         ) 
    3737 
  • docs/reference/rst/code/unusedValues.py

    r10149 r10547  
    22data = Orange.data.Table("unusedValues.tab") 
    33 
    4 new_variables = [Orange.preprocess.RemoveUnusedValues(var, data) for var in data.domain.variables] 
     4new_variables = [Orange.data.preprocess.RemoveUnusedValues(var, data) for var in data.domain.variables] 
    55 
    66print 
  • install-scripts/mac/dailyrun.sh

    r10527 r10534  
    3333./build-source.sh https://bitbucket.org/biolab/orange-addon-text text tip $WORK_DIR Orange-Text-Mining >> $SOURCE_LOG 2>&1 
    3434EXIT_VALUE3=$? 
     35 
     36if [ ! $LOCAL ]; then 
     37    /Users/ailabc/mount-dirs.sh || { echo "Mounting failed." ; exit 1 ; } 
     38fi 
    3539 
    3640echo "Orange (sources) [$EXIT_VALUE1 $EXIT_VALUE2 $EXIT_VALUE3]" > "/Volumes/download/buildLogs/osx/source-daily-build-hg.log" 
Note: See TracChangeset for help on using the changeset viewer.