简体   繁体   English

statsmodels:寻找statsmodels.formula.api详细文件

[英]statsmodels: looking for statsmodels.formula.api detail document

the example on statsmodels homepage http://www.statsmodels.org/stable/index.html is using statsmodels.api and statsmodels.formula.api, but I cannot find them in the index/module page. statsmodels主页http://www.statsmodels.org/stable/index.html上的示例正在使用statsmodels.api和statsmodels.formula.api,但在索引/模块页面中找不到它们。

Meanwhile I cannot find the ols class(of statsmodels.formula.api module), but a capitalized OLS class of statsmodels.regression.linear_model module. 同时,我找不到ols类(statsmodels.formula.api模块),但是找不到大写的OLS类statsmodels.regression.linear_model模块。 Confused about this. 对此感到困惑。

Where can I get the detail of statsmodels.formula.api.ols? 在哪里可以获取statsmodels.formula.api.ols的详细信息?

There is no specific documentation for the api . api没有特定的文档。 The documentation is mostly for the individual classes and functions. 该文档主要针对各个类和功能。 There is a brief explanation of the different import paths http://www.statsmodels.org/stable/importpaths.html 简要介绍了不同的导入路径http://www.statsmodels.org/stable/importpaths.html

The api.py are mainly a collection of imports, eg statsmodels api https://github.com/statsmodels/statsmodels/blob/master/statsmodels/api.py api.py主要是导入的集合,例如statsmodels api https://github.com/statsmodels/statsmodels/blob/master/statsmodels/api.py

from . import iolib
from . import datasets
from . import tools
from .tools.tools import add_constant, categorical
from . import regression
from .regression.linear_model import OLS, GLS, WLS, GLSAR
from .regression.recursive_ls import RecursiveLS
from .regression.quantile_regression import QuantReg
from .regression.mixed_linear_model import MixedLM
from .genmod import api as genmod
from .genmod.api import (GLM, GEE, OrdinalGEE, NominalGEE, families,
                         cov_struct,
                         BinomialBayesMixedGLM, PoissonBayesMixedGLM)
from . import robust
from .robust.robust_linear_model import RLM
from .discrete.discrete_model import (Poisson, Logit, Probit,
                                      MNLogit, NegativeBinomial,
                                      GeneralizedPoisson,
                                      NegativeBinomialP)
from .discrete.count_model import (ZeroInflatedPoisson,
                                   ZeroInflatedGeneralizedPoisson,
                                   ZeroInflatedNegativeBinomialP)
from .tsa import api as tsa
...

The formula.api just defines aliases to the from_formula methods of the models https://github.com/statsmodels/statsmodels/blob/master/statsmodels/formula/api.py from_formula只是为模型的from_formula方法定义别名https://github.com/statsmodels/statsmodels/blob/master/statsmodels/formula/api.py

from statsmodels.regression.linear_model import GLS
gls = GLS.from_formula
from statsmodels.regression.linear_model import WLS
wls = WLS.from_formula
from statsmodels.regression.linear_model import OLS
ols = OLS.from_formula
from statsmodels.regression.linear_model import GLSAR
glsar = GLSAR.from_formula
from statsmodels.regression.mixed_linear_model import MixedLM
mixedlm = MixedLM.from_formula
from statsmodels.genmod.generalized_linear_model import GLM
glm = GLM.from_formula
from statsmodels.robust.robust_linear_model import RLM
rlm = RLM.from_formula
from statsmodels.discrete.discrete_model import MNLogit
mnlogit = MNLogit.from_formula
from statsmodels.discrete.discrete_model import Logit
logit = Logit.from_formula
from statsmodels.discrete.discrete_model import Probit
probit = Probit.from_formula
from statsmodels.discrete.discrete_model import Poisson
poisson = Poisson.from_formula
from statsmodels.discrete.discrete_model import NegativeBinomial
negativebinomial = NegativeBinomial.from_formula
from statsmodels.regression.quantile_regression import QuantReg
quantreg = QuantReg.from_formula
from statsmodels.duration.hazard_regression import PHReg
phreg = PHReg.from_formula
from statsmodels.genmod.generalized_estimating_equations import (GEE,
     OrdinalGEE, NominalGEE)
gee = GEE.from_formula
ordinal_gee = OrdinalGEE.from_formula
nominal_gee = NominalGEE.from_formula

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

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