Commits

Aleš Erjavec committed 787f076

Modernize imports/module use to use the new namespace hierarchy.

(by running orange2to25 --aggressive)

Comments (0)

Files changed (5)

Orange/ensemble/bagging.py

 import math
 import random
 
-import Orange.core as orange
 import Orange
+import Orange.core
+import Orange.classification
 
 
-class BaggedLearner(orange.Learner):
+class BaggedLearner(Orange.core.Learner):
     """
     BaggedLearner takes a learner and returns a bagged learner, which is
     essentially a wrapper around the learner passed as an argument. If
             :class:`Orange.ensemble.bagging.BaggedLearner`
     """
     def __new__(cls, learner, instances=None, weight_id=None, **kwargs):
-        self = orange.Learner.__new__(cls, **kwargs)
+        self = Orange.core.Learner.__new__(cls, **kwargs)
         if instances is not None:
             self.__init__(self, learner, **kwargs)
             return self.__call__(instances, weight_id)
     )(BaggedLearner)
 
 
-class BaggedClassifier(orange.Classifier):
+class BaggedClassifier(Orange.core.Classifier):
     """
     A classifier that uses a bagging technique. Usually the learner
     (:class:`Orange.ensemble.bagging.BaggedLearner`) is used to construct the

Orange/ensemble/boosting.py

 import Orange
-import Orange.core as orange
+import Orange.core
 
 _inf = 100000
 
-class BoostedLearner(orange.Learner):
+class BoostedLearner(Orange.core.Learner):
     """
     Instead of drawing a series of bootstrap samples from the training set,
     bootstrap maintains a weight for each instance. When a classifier is 
             :class:`Orange.ensemble.boosting.BoostedLearner`
     """
     def __new__(cls, learner, instances=None, weight_id=None, **kwargs):
-        self = orange.Learner.__new__(cls, **kwargs)
+        self = Orange.core.Learner.__new__(cls, **kwargs)
         if instances is not None:
             self.__init__(self, learner, **kwargs)
             return self.__call__(instances, weight_id)
 
 BoostedLearner = Orange.utils.deprecated_members({"examples":"instances", "classVar":"class_var", "weightId":"weigth_id", "origWeight":"orig_weight"})(BoostedLearner)
 
-class BoostedClassifier(orange.Classifier):
+class BoostedClassifier(Orange.core.Classifier):
     """
     A classifier that uses a boosting technique. Usually the learner
     (:class:`Orange.ensemble.boosting.BoostedLearner`) is used to construct the

Orange/ensemble/forest.py

 from math import sqrt, floor
-import Orange.core as orange
+
 import Orange
 import Orange.feature.scoring
 import random
 import copy
 from Orange.utils import deprecated_keywords
 from operator import add
+import Orange.core
 
 def _default_small_learner(attributes=None, rand=None, base=None):
     # tree learner assembled as suggested by Breiman (2001)
 
 RandomForestLearner = Orange.utils.deprecated_members({"examples":"instances"})(RandomForestLearner)
 
-class RandomForestClassifier(orange.Classifier):
+class RandomForestClassifier(Orange.core.Classifier):
     """
     Uses the trees induced by the :obj:`RandomForestLearner`. An input
     instance is classified into the class with the most frequent vote.

Orange/feature/discretization.py

 import Orange
-import Orange.core as orange
 
 from Orange.core import \
     Discrete2Continuous, \
     Discretization, \
     Preprocessor_discretize
 
+import Orange.core
+
 def entropyDiscretization_wrapper(data):
     """Discretize all continuous features in class-labeled data set with the entropy-based discretization
     :obj:`Entropy`.
     Returns a table that 
 
     """
-    orange.setrandseed(0)
+    Orange.core.setrandseed(0)
     data_new = Orange.data.preprocess.Discretize(data, method=Entropy())
     
     attrlist = []

Orange/feature/selection.py

 from operator import itemgetter
 
 import Orange.data
-import Orange.core as orange
 
 from Orange.feature.scoring import score_all
 import Orange