Miran Levar avatar Miran Levar committed afe97c0

Fixes to unit-tests

Comments (0)

Files changed (7)

Orange/testing/regression/results_reference/mt-evaluate.py.txt

-Weighted RMSE scores:
-    Majority	0.8228
-     MT Tree	0.3949
-         PLS	0.3021
-       Earth	0.2880

Orange/testing/regression/results_reference/multitarget.py.txt

-Features: <Orange.feature.Continuous 'X1', Orange.feature.Continuous 'X2', Orange.feature.Continuous 'X3'>
-Classes: <Orange.feature.Continuous 'Y1', Orange.feature.Continuous 'Y2', Orange.feature.Continuous 'Y3', Orange.feature.Continuous 'Y4'>
-First instance: [0.628, 0.095, 0.652] (0.490, 1.237, 1.808, 0.422)
-Actual classes: [<orange.Value 'Y1'='0.490'>, <orange.Value 'Y2'='1.237'>, <orange.Value 'Y3'='1.808'>, <orange.Value 'Y4'='0.422'>]
-Majority predictions:
-[<orange.Value 'Y1'='0.514'>, <orange.Value 'Y2'='-0.587'>, <orange.Value 'Y3'='-1.666'>, <orange.Value 'Y4'='0.506'>]
-PLS predictions:
-[<orange.Value 'Y1'='0.613'>, <orange.Value 'Y2'='0.826'>, <orange.Value 'Y3'='1.084'>, <orange.Value 'Y4'='0.534'>]
-Multi-target Tree predictions:
-[<orange.Value 'Y1'='0.745'>, <orange.Value 'Y2'='0.994'>, <orange.Value 'Y3'='1.318'>, <orange.Value 'Y4'='0.518'>]

Orange/testing/unit/tests/test_display_name_mapping.py

 
 class TestNameMapping(unittest.TestCase):
 
-    exempt = ["Orange.multitarget.tree",
-        ]
-
     def test_qualified_names(self):
         """ Test that qualified names of core C++ objects 
         map to the correct name in the Orange.* hierarchy.
           
         """
+        #modules in exempt contain source files intended for addons
+        exempt = ["Orange.multitarget.tree",  ]
+
         for cls in orange.__dict__.values():
             if type(cls) == type:
                 if cls.__module__ in exempt:

docs/reference/rst/Orange.multitarget.rst

-###########################################
-Multi-target prediction (``multitarget``)
-###########################################
-
-Multi-target prediction tries to achieve better prediction accuracy or speed
-through prediction of multiple dependent variables at once. It works on
-:ref:`multi-target data <multiple-classes>`, which is also supported by
-Orange's tab file format using :ref:`multiclass directive <tab-delimited>`.
-
-.. toctree::
-   :maxdepth: 1
-
-   Orange.multitarget.tree
-   Orange.regression.pls
-   Orange.regression.earth
-
-For evaluation of multi-target methods, see the corresponding section in 
-:ref:`Orange.evaluation.scoring <mt-scoring>`.
-
-
-.. automodule:: Orange.multitarget
-

docs/reference/rst/Orange.multitarget.tree.rst

-.. automodule:: Orange.multitarget.tree

docs/reference/rst/code/mt-evaluate.py

-import Orange
-
-data = Orange.data.Table('multitarget-synthetic')
-
-majority = Orange.multitarget.MultitargetLearner(
-    Orange.classification.majority.MajorityLearner(), name='Majority')
-tree = Orange.multitarget.tree.MultiTreeLearner(max_depth=3, name='MT Tree')
-pls = Orange.multitarget.pls.PLSRegressionLearner(name='PLS')
-earth = Orange.multitarget.earth.EarthLearner(name='Earth')
-
-learners = [majority, tree, pls, earth]
-res = Orange.evaluation.testing.cross_validation(learners, data)
-rmse = Orange.evaluation.scoring.RMSE
-scores = Orange.evaluation.scoring.mt_average_score(
-            res, rmse, weights=[5,2,2,1])
-print 'Weighted RMSE scores:'
-print '\n'.join('%12s\t%.4f' % r for r in zip(res.classifier_names, scores))

docs/reference/rst/code/multitarget.py

-import Orange
-data = Orange.data.Table('multitarget-synthetic')
-print 'Features:', data.domain.features
-print 'Classes:', data.domain.class_vars
-print 'First instance:', data[0]
-print 'Actual classes:', data[0].get_classes()
-
-majority = Orange.classification.majority.MajorityLearner()
-mt_majority = Orange.multitarget.MultitargetLearner(majority)
-c_majority = mt_majority(data)
-print 'Majority predictions:\n', c_majority(data[0])
-
-pls = Orange.multitarget.pls.PLSRegressionLearner()
-c_pls = pls(data)
-print 'PLS predictions:\n', c_pls(data[0])
-
-mt_tree = Orange.multitarget.tree.MultiTreeLearner(max_depth=3)
-c_tree = mt_tree(data)
-print 'Multi-target Tree predictions:\n', c_tree(data[0])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.