NLP Exercise, step 5, solution code fails .check()
- Dominant language
- Jupyter Notebook
- Stars
- 514
- Forks
- 274
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.