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 output #10

Open
zqr2008 opened this issue May 16, 2022 · 2 comments
Open

Incorrect output #10

zqr2008 opened this issue May 16, 2022 · 2 comments

Comments

@zqr2008
Copy link

zqr2008 commented May 16, 2022

Thanks a lot for your code! It helped me a lot.
In the implementation of this roc comparison, I ran into a problems:

You see, I calculated y_prob_xgboost and y_prob_simple from previous model. Those two are of probabilities between 0-1. The y_test represent the true result.

In the code below, I used the function you kindly provided in the compare_auc_delong_xu module:

delongcov=compare_auc_delong_xu.delong_roc_test(y_test,y_prob_xgboost,y_prob_simple) print(delongcov)

However, I get a result of
[[-15.40781058]]

It did not make sense since I read some of the functions. I believe the function of "calc_pvalue" is to calculate to p value, which mean it is >0 instead of a negative one. By the way, I did not run into any error information during run it. IT MEANS THAT MY PROBLEM MAY NOT BE THE ERROR YOU ASSERTED.

Would you please tell me how it may be caused? Thanks a lot!

@pierrebaudot
Copy link

pierrebaudot commented May 20, 2022

Hello,
Thank you for your code. I have the same error .... and get a -0.24844165 p_value.
However reading the code ... the function returns Log_10(p_value), which may explain.
Just take p_value_test = np.exp(np.log(10)*p_value_test)
Hence the issue is closed.
Kind regards,

@zqr2008
Copy link
Author

zqr2008 commented May 23, 2022

Hello, Thank you for your code. I have the same error .... and get a -0.24844165 p_value. However reading the code ... the function returns Log_10(p_value), which may explain. Just take p_value_test = np.exp(np.log(10)*p_value_test) Hence the issue is closed. Kind regards,

Thanks a lot for addressing the question. Indeed, the result can be positive after np.exp the result. However, I am still confused at the result returned by the calc_value function. In the last line:
return np.log10(2) + scipy.stats.norm.logsf(z, loc=0, scale=1) / np.log(10)

It seems the calculate the logsf of z(z was derived from aucs, after reading some content of the original paper, I guess the z is a parameter calculated using matrix ) ,and divide it by log(10). How can I tell it, that the real pvalue is the result of np.exp(np.log(10)*p_value_test) instead of just np.log(10)*p_value_test?

Pardon me for my lack in math, it is just a little bit hard for me. Your help is already very useful.

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