On Mon, Dec 2, 2013 at 4:17 PM, Gael Varoquaux <gael.varoqu...@normalesup.org> wrote: > On Tue, Dec 03, 2013 at 06:56:14AM +1100, Joel Nothman wrote: >> As for "There should be one-- and preferably only one --obvious way to >> do it," Gaƫl, I feel there are times where the one obvious way to do it >> should be conditioned on whether you're building an application or >> writing a quick script / interactive play. > > The problem with pushing that logic too far is that it ends up creating a > jump in difficulty going from the interactive use to the proper one. It's > a mistake that we did with Mayavi. > > Ideally, the "correct usage pattern" should be design in a way that it is > reasonnably easy to use for interactive use. > > Going back to the topic of the discussion: if we add an 'api' module, > which pattern to we want to document and encourage?
To explain a bit why statsmodels got it's apis: One reason was that we can put the main models, OLS, WLS, GLM, RLM, .... into the main namespace for easy access instead of the actual path, for example sm.OLS instead of statsmodels.regression.linear_models.OLS The main reason for me was that we don't import anything with `import statsmodels`. I don't like it at all that if I want a simple function from scipy.stats, then I have to import half or two thirds of scipy. (slooow) As a consequence, almost all our __init__.py are empty. (Although `import statsmodels.regression.linear_models.OLS` still imports the large parts of scipy.) The other consequence is that we can, to some extend, separate actual code paths from the import paths. The code has in several cases deeper levels than the recommended imports. We shorten and pool the import paths in the api. Almost all our documentation examples use the API imports. Almost all code imports from the individual modules. (To make it more tricky we also recommend `import statsmodels.formula as smf` to get the formula interface. smf.ols, smf.poisson, .... or the slightly longer `sm.formula.ols` but that's less well established as a single recommended pattern.) http://statsmodels.sourceforge.net/devel/importpaths.html Josef > > G > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk > _______________________________________________ > Scikit-learn-general mailing list > Scikit-learn-general@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/scikit-learn-general ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ Scikit-learn-general mailing list Scikit-learn-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/scikit-learn-general