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

ZeroDivisionError: division by zero #6

Open
jxy-001 opened this issue Sep 9, 2019 · 6 comments
Open

ZeroDivisionError: division by zero #6

jxy-001 opened this issue Sep 9, 2019 · 6 comments

Comments

@jxy-001
Copy link

jxy-001 commented Sep 9, 2019

86 p = TP / (TP + FP)
87 r = TP / (TP + FN)
88 F1 = 2 * r * p / (r + p)

ZeroDivisionError: division by zero

I use my dataset,the text is short,but the shape is 10240, maybe where I should change?

@EthanWng97
Copy link
Owner

The denominator is ZERO. Maybe u can set a proper batch size and small max_seq_length. Moreover, using cross-validation maybe another option.

@jxy-001
Copy link
Author

jxy-001 commented Sep 10, 2019

what is the code if use cross-validation?could u help me ?

@EthanWng97
Copy link
Owner

nyu-dl/dl4marco-bert#31

@jxy-001
Copy link
Author

jxy-001 commented Sep 11, 2019

the test acc is always about 60%,but the train is more than 90%,I do not konw why?

@jxy-001
Copy link
Author

jxy-001 commented Sep 13, 2019

maybe test need some operate?

@EthanWng97
Copy link
Owner

ur data will be divided into 70% train set and 30% test set. If ur data set is small, the result is basically wrong. All u can do is setting a proper proportion about set and test set.

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