@@ -996,14 +996,14 @@ def ContinuousXor(n):
996
996
# ______________________________________________________________________________
997
997
998
998
999
- def compare (algorithms = [PluralityLearner , NaiveBayesLearner ,
1000
- NearestNeighborLearner , DecisionTreeLearner ],
1001
- datasets = [iris , orings , zoo , restaurant , SyntheticRestaurant (20 ),
1002
- Majority ( 7 , 100 ), Parity (7 , 100 ), Xor (100 )],
1003
- k = 10 , trials = 1 ):
999
+ def compare (algorithms = [PluralityLearner , NaiveBayesLearner , NearestNeighborLearner ,
1000
+ DecisionTreeLearner ],
1001
+ datasets = [iris , orings , zoo , restaurant , SyntheticRestaurant (20 ), Majority ( 7 , 100 ),
1002
+ Parity (7 , 100 ), Xor (100 )],
1003
+ k = 10 , size = 3 , trials = 1 ):
1004
1004
"""Compare various learners on various datasets using cross-validation.
1005
1005
Print results as a table."""
1006
1006
print_table ([[a .__name__ .replace ('Learner' , '' )] +
1007
- [cross_validation (a , d , k , trials ) for d in datasets ]
1007
+ [cross_validation (a , size , d , k , trials ) for d in datasets ]
1008
1008
for a in algorithms ],
1009
- header = ['' ] + [d .name [0 :7 ] for d in datasets ], numfmt = '% .2f' )
1009
+ header = ['' ] + [d .name [0 :7 ] for d in datasets ], numfmt = '{: .2f} ' )
0 commit comments