如何使用sklearn在Logistic回归模型中查找beta值 [英] How to find beta values in Logistic Regression model with sklearn

查看:514
本文介绍了如何使用sklearn在Logistic回归模型中查找beta值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于Logistic回归函数:

Based on the Logistic Regression function:

我正在尝试从 scikit-learn 中的模型中提取以下值.

I'm trying to extract the following values from my model in scikit-learn.

其中是截距,而是回归系数. (根据维基百科)

Where is the intercept and is the regression coefficient. (as per the wikipedia)

现在,我认为我可以通过执行model.intercept_来获取,但我一直在努力获取.有什么想法吗?

Now, I think I can get by doing model.intercept_ but I've been struggling to get . Any ideas?

推荐答案

您可以使用model.coef_访问特征的系数.

You can access the coefficient of the features using model.coef_.

它给出了与值beta1beta2等对应的值列表.列表的大小取决于您的逻辑回归使用的解释变量的数量.

It gives a list of values that corresponds to the values beta1, beta2 and so on. The size of the list depends on the amount of explanatory variables your logistic regression uses.

这篇关于如何使用sklearn在Logistic回归模型中查找beta值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆