question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

statsmodels imports, replace sm

See original GitHub issue

(I’m just following up a link and briefly browsed the source)

bambi/priors.py imports statsmodels.api This is not recommended for library use because it imports all of statsmodels and large parts of scipy. Most of the time it is more efficient and faster in loading to just import the relevant submodules or objects, e.g. just GLM class and families module

e.g.

from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.genmod import families

https://gist.github.com/josef-pkt/61039ab6dc7fb8b502caf5f2050111c0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aloctavodiacommented, Mar 28, 2019

Thank you!

1reaction
camenpihorcommented, Mar 28, 2019

Hey! If this issue is open I would be interested in helping out 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import Paths and Structure
Importing statsmodels.api will load most of the public parts of statsmodels. This makes most functions and classes conveniently available within one or two ......
Read more >
what is the difference between import statsmodels.api as ...
1 Answer 1 · import statsmodels as sm makes your sm refer to statsmodels -- which is to say, statsmodels/__init__.py . · import...
Read more >
remove_data= option does not appear to remove data fully
Under statsmodels version 0.11.0, remove_data=True appears to successfully remove wendog and wexog by itself. So this appears to be a new issue.
Read more >
Logistic Regression using Statsmodels
Logistic Regression using Statsmodels ... import statsmodels.api as sm ... a substitute for the R-squared value in Least Squares linear ...
Read more >
Logistic Regression in Python with statsmodels
Imports. First we need import Pandas and the statsmodels Formula API. Convention is to alias statsmodels.formula.api to smf .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found