简体   繁体   English

sklearn Python和Logistic回归

[英]sklearn Python and Logistic regression

Good night, community! 晚安,社区!

I have a simple question whose answer may not be as simple: 我有一个简单的问题,答案可能并非如此简单:

How can I show the independent variable coefficients of a Logistic regression model using Python's SciKit Learn ? 如何使用Python的SciKit Learn显示Logistic回归模型的自变量系数?

如果model是您的sklearn.linear_model.LogisticRegression则可以在model.coef_中访问model.coef_

Only completing the answer above in case you want to be able to build full the linear regression equation. 仅当您希望能够建立完整的线性回归方程式时,才完成上述答案。 You woul need not only the coefficients of independent variables but also the intercept. 您不仅需要自变量的系数,还需要截距。 You can access these values in the following way: 您可以通过以下方式访问这些值:

  • Coefficients: model.coef_ 系数: model.coef_
  • Intercept: model.intercept_ 拦截: model.intercept_

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM