Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scores all zeros despite getting >0.3 on kaggle submission #5

Closed
yxc8 opened this issue Dec 8, 2022 · 3 comments
Closed

scores all zeros despite getting >0.3 on kaggle submission #5

yxc8 opened this issue Dec 8, 2022 · 3 comments

Comments

@yxc8
Copy link

yxc8 commented Dec 8, 2022

Hi,

it seems like I'm getting all zero scores when running pipenv run python -m src.evaluate --test-labels test_labels.jsonl --predictions predictions.csv where the test_labels.jsonl refer to the file generated by pipenv run python -m src.testset --train-set train.jsonl --days 2 --output-path 'out/' --seed 42 . However, submitting the same csv to kaggle gives score >0.3. Any suggestions on what might be causing this?

INFO:root:Reading labels from out/test_labels.jsonl
Preparing labels: 100%|█████████████| 515702/515702 [00:05<00:00, 101878.16it/s]
INFO:root:Read 515702 labels
INFO:root:Reading predictions from predictions.csv
Preparing predictions: 100%|███████| 5015409/5015409 [06:25<00:00, 13000.44it/s]
INFO:root:Read 1671803 predictions
INFO:root:Calculating scores
Evaluating sessions: 100%|██████████| 515702/515702 [00:01<00:00, 324037.41it/s]
INFO:root:Scores: {'clicks': 0.0, 'carts': 0.0, 'orders': 0.0, 'total': 0.0}

Thank you!

@philippnormann
Copy link
Member

Hi @yxc8, are you sure you scored the test_sessions.jsonl and not the test.jsonl from Kaggle for your local CV?

@yxc8
Copy link
Author

yxc8 commented Dec 10, 2022

Ah, I see, thanks for pointing this out! I was indeed using the wrong file.

One more thing, the current test still fails because it can't catch the case when prediction doesn't have a certain key. So in evaluate.py, evaluate_session() function, change if 'clicks' in labels and labels['clicks']: to if 'clicks' in labels and labels['clicks'] and 'clicks' in prediction.keys(): and similarly for carts and orders, then the test works without error. Just want to point this out in case someone run into a similar problem.

Anyway thanks for the help Philip!

@philippnormann
Copy link
Member

Thanks for pointing that out, @yxc8!

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

No branches or pull requests

2 participants