@@ -983,14 +983,14 @@ def ContinuousXor(n):
983
983
# ______________________________________________________________________________
984
984
985
985
986
- def compare (algorithms = [PluralityLearner , NaiveBayesLearner ,
987
- NearestNeighborLearner , DecisionTreeLearner ],
988
- datasets = [iris , orings , zoo , restaurant , SyntheticRestaurant (20 ),
989
- Majority ( 7 , 100 ), Parity (7 , 100 ), Xor (100 )],
990
- k = 10 , trials = 1 ):
986
+ def compare (algorithms = [PluralityLearner , NaiveBayesLearner , NearestNeighborLearner ,
987
+ DecisionTreeLearner ],
988
+ datasets = [iris , orings , zoo , restaurant , SyntheticRestaurant (20 ), Majority ( 7 , 100 ),
989
+ Parity (7 , 100 ), Xor (100 )],
990
+ k = 10 , size = 3 , trials = 1 ):
991
991
"""Compare various learners on various datasets using cross-validation.
992
992
Print results as a table."""
993
993
print_table ([[a .__name__ .replace ('Learner' , '' )] +
994
- [cross_validation (a , d , k , trials ) for d in datasets ]
994
+ [cross_validation (a , size , d , k , trials ) for d in datasets ]
995
995
for a in algorithms ],
996
- header = ['' ] + [d .name [0 :7 ] for d in datasets ], numfmt = '% .2f' )
996
+ header = ['' ] + [d .name [0 :7 ] for d in datasets ], numfmt = '{: .2f} ' )
0 commit comments