Skip to content

Commit 1af3c52

Browse files
committed
Update compare function in learning.py
1 parent f76d1c8 commit 1af3c52

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

learning.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,14 +1000,14 @@ def ContinuousXor(n):
10001000
# ______________________________________________________________________________
10011001

10021002

1003-
def compare(algorithms=[PluralityLearner, NaiveBayesLearner,
1004-
NearestNeighborLearner, DecisionTreeLearner],
1005-
datasets=[iris, orings, zoo, restaurant, SyntheticRestaurant(20),
1006-
Majority(7, 100), Parity(7, 100), Xor(100)],
1007-
k=10, trials=1):
1003+
def compare(algorithms=[PluralityLearner, NaiveBayesLearner, NearestNeighborLearner,
1004+
DecisionTreeLearner],
1005+
datasets=[iris, orings, zoo, restaurant, SyntheticRestaurant(20), Majority(7, 100),
1006+
Parity(7, 100), Xor(100)],
1007+
k=10, size=3, trials=1):
10081008
"""Compare various learners on various datasets using cross-validation.
10091009
Print results as a table."""
10101010
print_table([[a.__name__.replace('Learner', '')] +
1011-
[cross_validation(a, d, k, trials) for d in datasets]
1011+
[cross_validation(a, size, d, k, trials) for d in datasets]
10121012
for a in algorithms],
1013-
header=[''] + [d.name[0:7] for d in datasets], numfmt='%.2f')
1013+
header=[''] + [d.name[0:7] for d in datasets], numfmt='{:.2f}')

0 commit comments

Comments
 (0)