FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update learning.py mode function by lucasmoura · Pull Request #323 · aimacode/aima-python · GitHub

Repository navigation

Update learning.py mode function - #323

Closed
lucasmoura wants to merge 2 commits into
aimacode:masterfrom
lucasmoura:fix_build
Closed

lucasmoura wants to merge 2 commits into
aimacode:masterfrom
lucasmoura:fix_build

Conversation

Copy link
Copy Markdown
Contributor

In the mode function in learning.py, there is a problem in this the line:

(item, count) = Counter(data).most_common(1)

That's because the most_common method returns a list. Therefore, the unpacking fails. That's the reason the build is currently failing as well. This MR fixes that and adds a test for the mode function

Chipe1 mentioned this pull request Mar 6, 2017
kaivalyar mentioned this pull request Mar 6, 2017

norvig commented Mar 7, 2017

Copy link
Copy Markdown
Member

Silly mistake on my part -- thanks for correcting it. It was also corrected in another change.

norvig closed this Mar 7, 2017

Copy link
Copy Markdown
Contributor Author

@norvig There is just one small problem left: missing import on utils.py for the Counter class.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL