Commits

Janez Demšar committed 2b8ddbb

Fixed problems due to refactoring of classification.rules

Comments (0)

Files changed (4)

Orange/orng/orngABCN2.py

 from Orange.classification.rules import ABCN2Ordered
 from Orange.classification.rules import ABCN2M
 from Orange.classification.rules import ABBeamFilter
-from Orange.classification.rules import RuleCoversArguments
+from Orange.classification.rules import CoversArguments
 from Orange.classification.rules import SelectorAdder
 from Orange.classification.rules import ArgFilter
 from Orange.classification.rules import SelectorArgConditions

Orange/orng/orngCN2.py

 from Orange.classification.rules import LaplaceEvaluator
 from Orange.classification.rules import WRACCEvaluator
 from Orange.classification.rules import MEstimateEvaluator as mEstimate
-from Orange.classification.rules import RuleStopping_Apriori as RuleStopping_apriori
+from Orange.classification.rules import Stopping_Apriori as RuleStopping_apriori
 from Orange.classification.rules import LengthValidator
 from Orange.classification.rules import supervisedClassCheck
 from Orange.classification.rules import CN2Learner
 from Orange.classification.rules import CN2Classifier
 from Orange.classification.rules import CN2UnorderedLearner
 from Orange.classification.rules import CN2UnorderedClassifier
-from Orange.classification.rules import RuleClassifier_BestRule as RuleClassifier_bestRule
+from Orange.classification.rules import Classifier_BestRule as RuleClassifier_bestRule
 from Orange.classification.rules import CovererAndRemover_MultWeights as CovererAndRemover_multWeights
 from Orange.classification.rules import CovererAndRemover_AddWeights as CovererAndRemover_addWeights
 from Orange.classification.rules import rule_in_set
 from Orange.classification.rules import rules_equal
 from Orange.classification.rules import NoDuplicatesValidator as noDuplicates_validator
-from Orange.classification.rules import RuleStopping_SetRules as ruleSt_setRules
+from Orange.classification.rules import Stopping_SetRules as ruleSt_setRules
 from Orange.classification.rules import CN2SDUnorderedLearner
 from Orange.classification.rules import CovererAndRemover_Prob
-from Orange.classification.rules import CN2EVCUnorderedLearner
+from Orange.classification.rules import CN2EVCUnorderedLearner

docs/reference/rst/code/rules-customized.py

 import Orange
 
 learner = Orange.classification.rules.RuleLearner()
-learner.rule_finder = Orange.classification.rules.RuleBeamFinder()
+learner.rule_finder = Orange.classification.rules.BeamFinder()
 learner.rule_finder.evaluator = Orange.classification.rules.MEstimateEvaluator(m=50)
 
 titanic =  Orange.data.Table("titanic")
     print Orange.classification.rules.rule_to_string(r)
 
 learner.rule_finder.rule_stopping_validator = \
-    Orange.classification.rules.RuleValidator_LRS(alpha=0.01,
+    Orange.classification.rules.Validator_LRS(alpha=0.01,
                              min_coverage=10, max_rule_complexity = 2)
 learner.rule_finder.rule_filter = \
-    Orange.classification.rules.RuleBeamFilter_Width(width = 50)
+    Orange.classification.rules.BeamFilter_Width(width = 50)
 
 classifier = learner(titanic)
 

source/orange/lib_learner.cpp

 
 C_NAMED(Rule - Orange.classification.rules.Rule, Orange, "()")
 
-C_NAMED(RuleValidator_LRS - Orange.classification.rules.RuleValidator_LRS, RuleValidator, "([alpha=0.05,min_coverage=0,max_rule_complexity=0,min_quality=numeric_limits<float>::min()])")
+C_NAMED(RuleValidator_LRS - Orange.classification.rules.Validator_LRS, RuleValidator, "([alpha=0.05,min_coverage=0,max_rule_complexity=0,min_quality=numeric_limits<float>::min()])")
 
-C_NAMED(RuleEvaluator_Entropy - Orange.classification.rules.RuleEvaluator_Entropy, RuleEvaluator, "()")
-C_NAMED(RuleEvaluator_Laplace - Orange.classification.rules.RuleEvaluator_Laplace, RuleEvaluator, "()")
-C_NAMED(RuleEvaluator_LRS - Orange.classification.rules.RuleEvaluator_LRS, RuleEvaluator, "()")
-C_NAMED(RuleEvaluator_mEVC - Orange.classification.rules.RuleEvaluator_mEVC, RuleEvaluator, "(ruleAlpha=1.0,attributeAlpha=1.0)")
+C_NAMED(RuleEvaluator_Entropy - Orange.classification.rules.Evaluator_Entropy, RuleEvaluator, "()")
+C_NAMED(RuleEvaluator_Laplace - Orange.classification.rules.Evaluator_Laplace, RuleEvaluator, "()")
+C_NAMED(RuleEvaluator_LRS - Orange.classification.rules.Evaluator_LRS, RuleEvaluator, "()")
+C_NAMED(RuleEvaluator_mEVC - Orange.classification.rules.Evaluator_mEVC, RuleEvaluator, "(ruleAlpha=1.0,attributeAlpha=1.0)")
 
 C_NAMED(EVDist, Orange, "()")
 C_NAMED(EVDistGetter_Standard, EVDistGetter, "()")
 
-C_NAMED(RuleBeamFinder - Orange.classification.rules.RuleBeamFinder, RuleFinder, "([validator=, evaluator=, initializer=, refiner=, candidateSelector=, ruleFilter=])")
+C_NAMED(RuleBeamFinder - Orange.classification.rules.BeamFinder, RuleFinder, "([validator=, evaluator=, initializer=, refiner=, candidateSelector=, ruleFilter=])")
 
-C_NAMED(RuleBeamInitializer_Default - Orange.classification.rules.RuleBeamInitializer_Default, RuleBeamInitializer, "()")
+C_NAMED(RuleBeamInitializer_Default - Orange.classification.rules.BeamInitializer_Default, RuleBeamInitializer, "()")
 
-C_NAMED(RuleBeamRefiner_Selector - Orange.classification.rules.RuleBeamRefiner_Selector, RuleBeamRefiner, "([discretization=])")
+C_NAMED(RuleBeamRefiner_Selector - Orange.classification.rules.BeamRefiner_Selector, RuleBeamRefiner, "([discretization=])")
 
-C_NAMED(RuleBeamCandidateSelector_TakeAll - Orange.classification.rules.RuleBeamCandidateSelector_TakeAll, RuleBeamCandidateSelector, "()")
+C_NAMED(RuleBeamCandidateSelector_TakeAll - Orange.classification.rules.BeamCandidateSelector_TakeAll, RuleBeamCandidateSelector, "()")
 
-C_NAMED(RuleBeamFilter_Width - Orange.classification.rules.RuleBeamFilter_Width, RuleBeamFilter, "([width=5])")
+C_NAMED(RuleBeamFilter_Width - Orange.classification.rules.BeamFilter_Width, RuleBeamFilter, "([width=5])")
 
-C_NAMED(RuleDataStoppingCriteria_NoPositives - Orange.classification.rules.RuleDataStoppingCriteria_NoPositives, RuleDataStoppingCriteria, "()")
+C_NAMED(RuleDataStoppingCriteria_NoPositives - Orange.classification.rules.DataStoppingCriteria_NoPositives, RuleDataStoppingCriteria, "()")
 
-C_NAMED(RuleCovererAndRemover_Default - Orange.classification.rules.RuleCovererAndRemover_Default, RuleCovererAndRemover, "()")
+C_NAMED(RuleCovererAndRemover_Default - Orange.classification.rules.CovererAndRemover_Default, RuleCovererAndRemover, "()")
 
-C_NAMED(RuleStoppingCriteria_NegativeDistribution - Orange.classification.rules.RuleStoppingCriteria_NegativeDistribution, RuleStoppingCriteria, "()")
+C_NAMED(RuleStoppingCriteria_NegativeDistribution - Orange.classification.rules.StoppingCriteria_NegativeDistribution, RuleStoppingCriteria, "()")
 C_CALL(RuleLearner - Orange.classification.rules.RuleLearner, Learner, "([examples[, weightID]]) -/-> Classifier")
 
 ABSTRACT(RuleClassifier - Orange.classification.rules.RuleClassifier, Classifier)
  PyCATCH
 }
 
-PyObject *RuleEvaluator_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleEvaluator, "<abstract>")
+PyObject *RuleEvaluator_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.Evaluator, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleEvaluator_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleEvaluator_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleValidator_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleValidator, "<abstract>")
+PyObject *RuleValidator_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.Validator, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleValidator_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleValidator_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleCovererAndRemover_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleCovererAndRemover, "<abstract>")
+PyObject *RuleCovererAndRemover_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.CovererAndRemover, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleCovererAndRemover_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleCovererAndRemover_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleStoppingCriteria_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleStoppingCriteria, "<abstract>")
+PyObject *RuleStoppingCriteria_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.StoppingCriteria, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleStoppingCriteria_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleStoppingCriteria_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleDataStoppingCriteria_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleDataStoppingCriteria, "<abstract>")
+PyObject *RuleDataStoppingCriteria_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.DataStoppingCriteria, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleDataStoppingCriteria_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleDataStoppingCriteria_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleFinder_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleFinder, "<abstract>")
+PyObject *RuleFinder_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.Finder, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleFinder_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleFinder_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleBeamRefiner_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleBeamRefiner, "<abstract>")
+PyObject *RuleBeamRefiner_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.BeamRefiner, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleBeamRefiner_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleBeamRefiner_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleBeamInitializer_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleBeamInitializer, "<abstract>")
+PyObject *RuleBeamInitializer_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.BeamInitializer, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleBeamInitializer_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleBeamInitializer_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleBeamCandidateSelector_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleBeamCandidateSelector, "<abstract>")
+PyObject *RuleBeamCandidateSelector_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.BeamCandidateSelector, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleBeamCandidateSelector_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleBeamCandidateSelector_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleBeamFilter_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleBeamFilter, "<abstract>")
+PyObject *RuleBeamFilter_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.BeamFilter, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleBeamFilter_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleBeamFilter_Python(), type), args);
   else
   PyCATCH
 }
 
-PyObject *RuleClassifierConstructor_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.RuleClassifierConstructor, "<abstract>")
+PyObject *RuleClassifierConstructor_new(PyTypeObject *type, PyObject *args, PyObject *keywords)  BASED_ON(Orange - Orange.classification.rules.ClassifierConstructor, "<abstract>")
 { if (type == (PyTypeObject *)&PyOrRuleClassifierConstructor_Type)
     return setCallbackFunction(WrapNewOrange(mlnew TRuleClassifierConstructor_Python(), type), args);
   else