Hello,I have a logistic regression model for a binary classifier (0, 1). I get the single probability back when I predict my test set. Is that the probability for a 0 or for a 1? The model is an sm.logit(y,x)
--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/f23355bf-f7e7-4d2a-9fd1-4fbf706907e8%40googlegroups.com.
On Tue, Feb 11, 2020 at 10:29 AM Jordan Howell <jordan....@gmail.com> wrote:Hello,I have a logistic regression model for a binary classifier (0, 1). I get the single probability back when I predict my test set. Is that the probability for a 0 or for a 1? The model is an sm.logit(y,x)for endog=1predict(x) = P(y = 1 | x)
On Tue, Feb 11, 2020 at 10:29 AM Jordan Howell <jordan...@gmail.com> wrote:Hello,I have a logistic regression model for a binary classifier (0, 1). I get the single probability back when I predict my test set. Is that the probability for a 0 or for a 1? The model is an sm.logit(y,x)for endog=1predict(x) = P(y = 1 | x)
--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.
Thanks. I seem to be getting the opposite if the predictions are the probability of endog = 1 which concerns me with the model.
--
On Tuesday, February 11, 2020 at 10:35:57 AM UTC-5, josefpktd wrote:On Tue, Feb 11, 2020 at 10:29 AM Jordan Howell <jordan...@gmail.com> wrote:Hello,I have a logistic regression model for a binary classifier (0, 1). I get the single probability back when I predict my test set. Is that the probability for a 0 or for a 1? The model is an sm.logit(y,x)for endog=1predict(x) = P(y = 1 | x)--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/f23355bf-f7e7-4d2a-9fd1-4fbf706907e8%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/d853ea1d-6ac5-4bcd-9f8b-2a3badf01978%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/CAMMTP%2BD5s6hMgCSX5qKLuVJkopLo%2BdctRj5d69oqFHcjjyJFEA%40mail.gmail.com.
On Tue, Feb 11, 2020 at 11:44 AM Jordan Howell <jordan...@gmail.com> wrote:Thanks. I seem to be getting the opposite if the predictions are the probability of endog = 1 which concerns me with the model.Are you using GLM or Logit?Check `model.endog` to see how the endog is encoded if you are using formulas.patsy produces the "reversed" encoding for the way endog is interpreted in GLM.one way to check this is to create a numeric 0, 1 endog yourself and compare it with the model.endog that you currently have.Josef
--
On Tuesday, February 11, 2020 at 10:35:57 AM UTC-5, josefpktd wrote:On Tue, Feb 11, 2020 at 10:29 AM Jordan Howell <jordan...@gmail.com> wrote:Hello,I have a logistic regression model for a binary classifier (0, 1). I get the single probability back when I predict my test set. Is that the probability for a 0 or for a 1? The model is an sm.logit(y,x)for endog=1predict(x) = P(y = 1 | x)--
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/f23355bf-f7e7-4d2a-9fd1-4fbf706907e8%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "pystatsmodels" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pystat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/d853ea1d-6ac5-4bcd-9f8b-2a3badf01978%40googlegroups.com.
Excuse the last post. After doing `model.endog`, I get a 1d array which matches my 0s and 1s. I still have a sinking feeling the model is predicting the first class, in this case 0. I'm just not sure how to double check.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/796bf47d-e6a7-4858-a1a8-6addbf29ad64%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/796bf47d-e6a7-4858-a1a8-6addbf29ad64%40googlegroups.com.
So I changed the classes around (0 for 1 and 1 for 0) and the results were reversed so I feel like patsy or statsmodels or something is predicting the first class `0` in this case.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/dc258ca0-beb5-4356-860d-099babeb2866%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/dc258ca0-beb5-4356-860d-099babeb2866%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/bdf2e804-b672-4248-a880-ab80900d1349%40googlegroups.com.
array([0., 1., 1., ..., 1., 0., 0.])
Again, this is the model:
model = sm.Logit(y, x)
On Monday, February 17, 2020 at 10:07:17 AM UTC-5, josefpktd wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/bdf2e804-b672-4248-a880-ab80900d1349%40googlegroups.com.
The target flag is a float (0 or 1). After I run the model with:
To unsubscribe from this group and stop receiving emails from it, send an email to pystatsmodel...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/96182f32-5bd4-4001-a0a9-845c72b3ba29%40googlegroups.com.
ValueError: operands could not be broadcast together with shapes (647274,2) (647274,) Not sure why it's erroring out.
To view this discussion on the web visit https://groups.google.com/d/msgid/pystatsmodels/96182f32-5bd4-4001-a0a9-845c72b3ba29%40googlegroups.com.