NLP Exercise, step 5, solution code fails .check()
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python
- Domain
- machine-learning
Research direction
Run step_5.solution() and step_5.check() using the evaluation function shown in the report, then compare the checker’s expectations with the result passed from step 5 into the next step. Done means a valid solution is accepted by step_5.check() while the following exercise still runs correctly.
Written by the indexing model from the issue text.
Description
If you run step_5.solution() you get:
def evaluate(model, texts, labels):
# Get predictions from textcat model
predicted_class = predict(model, texts)
# From labels, get the true class as a list of integers (POSITIVE -> 1, NEGATIVE -> 0)
true_class = [int(each['cats']['POSITIVE']) for each in labels]
# A boolean or int array indicating correct predictions
correct_predictions = predicted_class == true_class
# The accuracy, number of correct predictions divided by all predictions
accuracy = correct_predictions.mean()
return accuracy
but if you use that and run step_5.check() it says incorrect. I can't find an answer to this question that passes step_5.check() even though many solutions seem correct and run correctly in the next step.
- Dominant language
- Jupyter Notebook
- Stars
- 515
- Forks
- 274
- Avg merge
- 14d 16h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Kaggle/learntools
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Kaggle/learntools#490 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Kaggle/learntools#278 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
Kaggle/learntools#484 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Kaggle/learntools#476 · 2 comments ·
-
Difficulty 1/5 Under an hour Newbie friendliness 52/100
Kaggle/learntools#468 ·
All issues in Kaggle/learntools
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
raullenchai/Rapid-MLX#4096 ·
Maintainers usually reply within 1 day
-
[BUG] `ForecastingBenchmark(return_data=True)` fails if it is run again with an existing result fileOpenbug module:metrics&benchmarking
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
sktime/sktime#11372 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
apache/tvm#20533 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
antoniorv6/SMT#42 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
es-ude/OnDeviceTraining#479 ·
Maintainers usually reply within 1 day