📣 独立日限时特惠: VIP通行证立减$68
查看: 3429| 回复: 16
跳转到指定楼层
上一主题 下一主题
收起左侧

不懂就问:logistic regression的assumption

 
全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
大家好 我想请教一下大家logistic regression 的assumption 具体是什么 和linear regression相同吗? 请问我在fit logistic regression之前需要怎么来判定我的数据是否符合assumption呢?
具体code的话 比如R里面可以直接plot出来看四张图。请问logistic regression有类似的command吗?
谢谢大家!!!

上一篇:five fold cross-validation的最后性能
下一篇:NPV at base rate of 12%
推荐
u878qwqe 2022-2-23 06:09:26 | 只看该作者
全局:
linear regression 和 logistic regression都是GLM, 关于logistic regression 的 assumption和推导,我看过这个文章总结得比较细致:https://bit.ly/3Hb1ccC    也介绍了从glm角度比较两个模型。
回复

使用道具 举报

推荐
hea_bow0w 2022-2-15 09:08:57 | 只看该作者
全局:
我之前复习的时候参考的assumption,链接是 https://www.statisticssolutions. ... ogistic-regression/

First, binary logistic regression requires the dependent variable to be binary and ordinal logistic regression requires the dependent variable to be ordinal.
Second, logistic regression requires the observations to be independent of each other.  In other words, the observations should not come from repeated measurements or matched data.
Third, logistic regression requires there to be little or no multicollinearity among the independent variables.  This means that the independent variables should not be too highly correlated with each other.
Fourth, logistic regression assumes linearity of independent variables and log odds.  although this analysis does not require the dependent and independent variables to be related linearly, it requires that the independent variables are linearly related to the log odds.
Finally, logistic regression typically requires a large sample size.  A general guideline is that you need at minimum of 10 cases with the least frequent outcome for each independent variable in your model. For example, if you have 5 independent variables and the expected probability of your least frequent outcome is .10, then you would need a minimum sample size of 500 (10*5 / .10).

关于logistic数据判定,抱歉我没有自己做过,但觉得只要把p改成log odds应该就和linear model一样?对于linear model的检测,我是照着https://www.statology.org/linear-regression-assumptions/ 做的。

希望有帮助。

评分

参与人数 2大米 +2 收起 理由
NickW + 1 make sense
taskbitask + 1 赞一个

查看全部评分

回复

使用道具 举报

推荐
olivia122 2022-2-15 08:28:43 | 只看该作者
全局:

评分

参与人数 1大米 +1 收起 理由
taskbitask + 1 很有用的信息!

查看全部评分

回复

使用道具 举报

🔗
microsat 2022-2-16 01:03:58 | 只看该作者
全局:
我有个疑问。logistic regression是用来干什么的?  比如  weight~ age+sex+city

有人会用odd ratios来说参数的重要性吗?  比如age的odd ratio如果特别高,那么就说明age重要。

类似,sex的odd ratio特别高,sex就重要。

但是,你想没想过,这种odd ratio根本说明不了参数的重要性。存在一种可能,odd ratio非常小,但是对应的参数仍然重要。

或者, odd ratio非常高,但对应的参数根本不重要。
回复

使用道具 举报

🔗
20220202 2022-2-17 13:41:20 | 只看该作者
全局:
microsat 发表于 2022-2-15 11:03
我有个疑问。logistic regression是用来干什么的?  比如  weight~ age+sex+city

有人会用odd ratios来 ...

logistic regression 就是根据输入features来分类来做决定, 所以输出必须是一个概率, p(event )=0~1之间的数字。 所以做个变换 log[p(event)/ p(not event)] 让他回到任何数量的区间。在线性模型的前提,认为各种特征和结果有着线形关系,weight 来表示关联强度,这是一个很局限的假设。 比如说有的疾病在某个地区的年长的男性中常见,这样必须综合 location, sex 和 age 一起来判断,单个特征的 odd ratio 会掩盖事实上的关联

回复

使用道具 举报

🔗
road 2022-2-17 13:47:27 来自APP | 只看该作者
全局:
Decision boundary is linear.
看你feature的区分程度和维度 一般都是可以先行可分

如果不行可以对数据做kernel变换用SVM
回复

使用道具 举报

全局:
Technically speaking 没有linear的假设吧? 毕竟可以加interaction term 或者做transform
回复

使用道具 举报

🔗
20220202 2022-2-17 14:14:01 | 只看该作者
全局:
是可以用kernel 方法变换到任何空间。但问某个输入特征的 odd ratio 似乎隐含了线形的假设,至少是monotic relationship
回复

使用道具 举报

🔗
microsat 2022-2-21 02:14:10 | 只看该作者
全局:
假设一个变量有两个levels(A和B),例如sex的两个levels就是男和女。一个变量的重要性,和这个变量的某个level相对于另一个level的odd ratio很高,这两个是一致的吗?

比如男的相对于女的,体能上,存在高odd ratio, 那么我们就可以说性别是体能的一个重要指标。

有没有可能,一个参数很重要,但是odd ratio却很小(看不出重要来)。
或者一个参数不重要,但是odd ratio却很大(你误认为很重要)
回复

使用道具 举报

🔗
lailedage 2022-2-21 04:31:35 | 只看该作者
全局:
microsat 发表于 2022-2-20 10:14
假设一个变量有两个levels(A和B),例如sex的两个levels就是男和女。一个变量的重要性,和这个变量的某个l ...

test一个feature的importance之前先确定哪种方法。简单一点,比如想要知道sex的重要性,首先要保证其他feature不变,如果sex变化对odd ratio变化(大或者小)都可以说明sex比较重要,影响不大的话可能就不那么重要。当然这是比较简单的例子,test feature importance有很多中方法,一种比较流行的SHAPLEY可以google一下。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表