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

Incorrect data in training #8

Open
javixeneize opened this issue Dec 16, 2022 · 2 comments
Open

Incorrect data in training #8

javixeneize opened this issue Dec 16, 2022 · 2 comments

Comments

@javixeneize
Copy link

Hi

This code looks wrong

print("Training True : {0} ({1:0.2f}%)".format(len(y_train[y_train[:] == 1]), (len(y_train[y_train[:] == 1])/len(df.index) * 100.0)))
print("Training False : {0} ({1:0.2f}%)".format(len(y_train[y_train[:] == 0]), (len(y_train[y_train[:] == 0])/len(df.index) * 100.0)))
print("Test True : {0} ({1:0.2f}%)".format(len(y_test[y_test[:] == 1]), (len(y_test[y_test[:] == 1])/len(df.index) * 100.0)))
print("Test False : {0} ({1:0.2f}%)".format(len(y_test[y_test[:] == 0]), (len(y_test[y_test[:] == 0])/len(df.index) * 100.0)

Training True : 537 (69.92%)
Training False : 537 (69.92%)
Test True : 231 (30.08%)
Test False : 231 (30.08%)

When counting the occurences of 1, with len(y_train[y_train[:] == 1]), it returns all the items match that. In fact, if you change the condition to ==5, it still returns the full length of the array

@jdobrott
Copy link

I was able to get the code segment to work properly by changing [:] to 'diabetes'.
rint("Training True : {0} ({1:0.2f}%)".format(len(y_train[y_train['diabetes'] == 1]), (len(y_train[y_train['diabetes'] == 1])/len(df.index) * 100.0)))
etc...

@JerryKurata
Copy link
Owner

JerryKurata commented Jan 27, 2023

Thanks guys! I fixed the qualifier error. Good catch!

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

3 participants