logistic regression target class and coefficient interpretation

User 2785 | 4/27/2016, 11:45:35 PM

Hi there,

Just wanted to check my understanding of the logistic regression output. According to the docs if I feed in 0 and 1 as the target then 0 will be set as the base class and 1 will be set as the reference class. How do I use this assignment to interpret the coefficients? For example here are some of my coefficients from a recent model:

name,index,class,value,stderr (intercept),,1,0.04198, df,ADM,1,1.5567, days_from_cut_off_to_first_open,,1,0.00108085, days_from_cut_off_to_last_open,,1,0.0158151, use_duration_in_days_open,,1,-0.00847008, unique_day_count_open,,1,-0.0227168, unique_count_open,,1,-0.00426469,

so then feeding in the features with their corresponding coefficients, positive coefficients move the predicted target more towards 1, and negative coefficients move the predicted target more towards 0, correct? I'm probably not phrasing this very well, I'm just confused about how 1 and 0 map to the coefficient signs.

the relevant part of the docs:

The values in this column must be of string or integer type. String target variables are automatically mapped to integers in the order in which they are provided. For example, a target variable with ‘cat’ and ‘dog’ as possible values is mapped to 0 and 1 respectively with 0 being the base class and 1 being the reference class.

Comments

User 2785 | 4/28/2016, 5:14:37 PM

ps i'm asking this because i would expect the coefficients to map the opposite way considering my data


User 91 | 4/29/2016, 12:06:46 AM

Great question; the coefficients always correspond to the "positive class". model.classes[1] will be the "positive" class. So, a positive coefficient would mean that there is a positive correlation between the feature and the probability that the example will be predicted as a "positive" class.


User 2785 | 4/29/2016, 6:31:51 PM

so in my case the positive class will be 1?


User 1189 | 5/2/2016, 8:00:28 PM

Yes that should be right.