Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f42ef9f

Browse files
committed
Update compare function in learning.py
1 parent 35b319c commit f42ef9f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

learning.py

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

985985

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):
991991
"""Compare various learners on various datasets using cross-validation.
992992
Print results as a table."""
993993
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]
995995
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

Comments
 (0)