python - statsmodels:寻找 statsmodels.formula.api 详细文档
问题描述
statsmodels 主页http://www.statsmodels.org/stable/index.html上的示例 使用 statsmodels.api 和 statsmodels.formula.api,但我在 index/module 页面中找不到它们。
同时,我找不到 ols 类(statsmodels.formula.api 模块),而是 statsmodels.regression.linear_model 模块的大写 OLS 类。对此感到困惑。
我在哪里可以获得 statsmodels.formula.api.ols 的详细信息?
解决方案
没有针对api
. 该文档主要针对各个类和函数。有不同导入路径的简要说明http://www.statsmodels.org/stable/importpaths.html
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
...
formula.api 只是定义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
推荐阅读
- next.js - 为什么 mapbox-gl-js 无法正确解析 env 变量令牌?
- string - 修改 bash 字符串
- angular - Ionic 4,在模态页面上添加自定义组件
- ios - 在 Flutter 中使用 Firebase ML 视觉安装 pod 时出错
- javascript - 在 JS 对话窗口中单击“全选”按钮会导致主页面中的所有复选框都被选中
- javascript - 这些交互 btw var 和具有相同名称的函数声明如何工作?
- r - 减少ggplot2中多个图中的列高
- ios - MPVolumeView not visible when connected to AirPlay device
- javascript - JS根据窗口宽度控制文字长度
- c++ - 如何在 C++ 中获得所有连接到 Linux 机器的显示器的组合分辨率?