Skip to content

Commit e1931c5

Browse files
committed
Update compare function in learning.py
1 parent cfb3af0 commit e1931c5

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
@@ -996,14 +996,14 @@ def ContinuousXor(n):
996996
# ______________________________________________________________________________
997997

998998

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):
10041004
"""Compare various learners on various datasets using cross-validation.
10051005
Print results as a table."""
10061006
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]
10081008
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

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy