Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update learning.py mode function#323

Closed
lucasmoura wants to merge 2 commits intoaimacode:masteraimacode/aima-python:masterfrom
lucasmoura:fix_buildlucasmoura/aima-python:fix_buildCopy head branch name to clipboard
Closed

Update learning.py mode function#323
lucasmoura wants to merge 2 commits intoaimacode:masteraimacode/aima-python:masterfrom
lucasmoura:fix_buildlucasmoura/aima-python:fix_buildCopy head branch name to clipboard

Conversation

@lucasmoura
Copy link
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 Chipe1 mentioned this pull request Mar 6, 2017
@kaivalyar kaivalyar mentioned this pull request Mar 6, 2017
@norvig
Copy link
Collaborator

norvig commented Mar 7, 2017

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

@norvig norvig closed this Mar 7, 2017
@lucasmoura
Copy link
Contributor Author

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

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

Comments

Close sidebar
Morty Proxy This is a proxified and sanitized view of the page, visit original site.