dynobo / lmdiag Goto Github PK
View Code? Open in Web Editor NEWPython Library providing Diagnostic Plots for Linear Regression
License: MIT License
Python Library providing Diagnostic Plots for Linear Regression
License: MIT License
Thanks for a very useful package. It would be great if lmdiag
is extended so that the estimation results of linearmodels can be used as an input, e.g. IV-2SLS and Panel Data.
Thank you for creating a nice package. It is very handy to install such a functionality with pip
.
However, I find this package to be rather slow for large datasets in comparison with the LinearRegDiagnostic
class described in the Linear regression diagnostics example of statsmodels
. This may indicate some inefficiency of the package.
Example:
df = sm.datasets.get_rdataset("ames", "openintro").data
res = smf.ols("np.log10(price) ~ Q('Overall.Qual') + np.log(area)", df).fit()
lmdiag
%%time
lmdiag.plot(res)
CPU times: user 15.1 s, sys: 215 ms, total: 15.3 s
Wall time: 16.1 s
LinearRegDiagnostic
%%time
LinearRegDiagnostic(res)()
CPU times: user 2.17 s, sys: 125 ms, total: 2.29 s
Wall time: 2.17 s
@dynobo I want to start off by saying that I love this package. Inferential statistics is super easy in R thanks to things like plot.lm
, so lmdiag
really helps bridge the gap between Python and R! I was hunting down an easy way to do something similar to plot.lm
in Python without having to manually build a bunch of the plots, so I was very happy to find this package.
So I found one case in info.py
where you used some Python 3-specific string formatting that causes this package to not work for Python 2. If you're only planning on having this be a Python 3 package, I completely respect that, though it would be nice if that were the case to add a note of that in the README. If you are interested in making this package work for Python 2, here is a super quick fix I made in a fork of this package that fixes the issue for Python 2 (note: I haven't done extensive testing based on this fix, I just know it lets the package be imported without raising an error).
If a matplotlib style is used, it's possible, that the markers are not shown, e.g. with
plt.style.use('seaborn')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.