Skip to content

Commit

Permalink
Merge branch 'gh-pages' of github.com:dsten/data8assets into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
papajohn committed Apr 1, 2016
2 parents a72dedb + bfa525d commit 664cacc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion labs/lab10/lab10.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
},
"outputs": [],
"source": [
"my_classifier = make_classifier(lyrics)"
"my_classifier = ..."
]
},
{
Expand Down
11 changes: 6 additions & 5 deletions labs/lab10/tests/q31.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
'cases': [
{
'code': r"""
>>> c = make_best_knn_classifier(lyrics.take(range(20)), lyrics.take(range(20, 25)))
>>> your_classifier = make_best_knn_classifier(lyrics.take(range(20)), lyrics.take(range(20, 25)))
>>> import collections
>>> # make_best_knn_classifier should return a function.
>>> isinstance(c, collections.Callable)
>>> isinstance(your_classifier, collections.Callable)
True
>>> # It looks like your classifier doesn't behave like the correct
>>> # one does.
>>> c(lyrics.drop(0).row(30)) == 'Hip-hop'
>>> # It looks like your function doesn't produce classifiers that
>>> # behave as expected.
>>> expected_classifier = make_knn_classifier(lyrics.take(range(20)), 1)
>>> np.all(lyrics.drop(0).apply(your_classifier) == lyrics.drop(0).apply(expected_classifier))
True
""",
'hidden': False,
Expand Down

0 comments on commit 664cacc

Please sign in to comment.