Commits

Aleš Erjavec committed aa91172

Fixed changed SVM doctest output.

Comments (0)

Files changed (2)

Orange/classification/svm/__init__.py

         >>> data = Orange.data.Table("vehicle.tab")
         >>> learner = svm.SVMLearner()
         >>> results = testing.cross_validation([learner], data, folds=5)
-        >>> print "CA:  %.4f" % scoring.CA(results)[0]
-        CA:  0.7908
-        >>> print "AUC: %.4f" % scoring.AUC(results)[0]
-        AUC: 0.9565
+        >>> print "CA:  %.2f" % scoring.CA(results)[0]
+        CA:  0.79
+        >>> print "AUC: %.2f" % scoring.AUC(results)[0]
+        AUC: 0.95
 
     """
     __new__ = _orange__new__(_SVMLearner)
         >>> score = Orange.classification.svm.ScoreSVMWeights()
         >>> svm_scores = [(score(f, table), f) for f in table.domain.features]
         >>> for feature_score, feature in sorted(svm_scores, reverse=True):
-        ...     print "%-35s: %.3f" % (feature.name, feature_score)
-        pr.axis aspect ratio               : 44.263
-        kurtosis about major axis          : 42.593
-        max.length rectangularity          : 39.377
-        radius ratio                       : 28.741
-        skewness about major axis          : 26.682
-        hollows ratio                      : 20.993
-        compactness                        : 20.085
-        elongatedness                      : 17.410
-        distance circularity               : 14.542
-        scaled radius of gyration          : 12.584
-        max.length aspect ratio            : 10.686
-        scatter ratio                      : 10.574
-        scaled variance along minor axis   : 10.049
-        circularity                        : 8.360
-        pr.axis rectangularity             : 7.473
-        scaled variance along major axis   : 5.731
-        skewness about minor axis          : 1.368
-        kurtosis about minor axis          : 0.690
+        ...     print "%-35s: %.1f" % (feature.name, feature_score)
+        pr.axis aspect ratio               : 44.3
+        kurtosis about major axis          : 42.6
+        max.length rectangularity          : 39.4
+        radius ratio                       : 28.7
+        ...
 
 
     """

Orange/testing/unit/tests/test_svm.py

 
 def load_tests(loader, tests, ignore):
     import doctest
-    tests.addTests(doctest.DocTestSuite(svm))
+    tests.addTests(doctest.DocTestSuite(svm, optionflags=doctest.ELLIPSIS))
     return tests
 
 if __name__ == "__main__":
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.