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

02_end_to_end_machine_learning_project.ipynb Error #2

Closed
krinkere opened this issue Apr 19, 2019 · 1 comment
Closed

02_end_to_end_machine_learning_project.ipynb Error #2

krinkere opened this issue Apr 19, 2019 · 1 comment

Comments

@krinkere
Copy link

In [32]:
preds = pd.concat([y_train,predictionsBasedOnKFolds.loc[:,1]], axis=1)

the above is wrong... it would always grab prediction for class 1

so if we had predict_proba give us something like
index prob0 prob1
1 0.9 0.1

and label is
index label
1 0

so above would produce preds as
index trueLabel prection
1 0 0.1

should be 0.9, not 0.1

@aapatel09
Copy link
Owner

preds = pd.concat([y_train,predictionsBasedOnKFolds.loc[:,1]], axis=1) will return the prob1, which is what we want. The "1" refers to the prob1 here.

preds would return:
index trueLabel prediction
1 0 .1

This is what we want. We want prob1 to be returned so that when the label is 1, prob1 is close to 1 (ideally), and when the label is 0, prob1 is close to 0 (ideally).

Please let me know if you still have questions about this. Happy to clarify this more.

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