Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Statistical Library statsmodels in Python

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to use the statistical library statsmodels in Python", which is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use statsmodels in Python".

Statsmodels is a Python module that provides classes and capabilities for estimating many different statistical models.

Let me show you the documentation page of this library. With so much statistical knowledge, I only read Linear Regression.

I only saw OLS in the Linear Regression part.

OLS I only tried the fit method today.

Statsmodel Chinese materials are not much, there are statistical needs and good English, welcome to eat. O (∩ _ ∩) obliteration enriches the statistical ability of my python circle. Of course, R is much richer and more detailed in this aspect of statistics, there is no need for Python, the right tools are used in the right place. Python and R, stata, spss and excel have their own advantages and disadvantages and can complement each other.

Let's take a look at the following small cases.

Small case study:

Import statsmodels.api as sm

Y = [1,3,4,5,2,3,4]

X = range (1,8)

# add intercept item

X = sm.add_constant (X)

Model = sm.OLS (Y, X)

# data fitting, generating model

Results = model.fit ()

Print (results.summary ())

After the run is complete, output the model overview

The above is all the contents of the article "how to use statsmodels in Python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report