{"id":23061,"library":"dask-glm","title":"dask-glm","description":"Generalized Linear Models with Dask. Current version is 0.4.0, with a release cadence approximately yearly. It provides implementations of GLMs (logistic, Poisson, etc.) that work on Dask arrays and DataFrames.","status":"active","version":"0.4.0","language":"python","source_language":"en","source_url":"https://github.com/dask/dask-glm","tags":["dask","glm","generalized linear models","distributed","machine learning","logistic regression","poisson regression"],"install":[{"cmd":"pip install dask-glm","lang":"bash","label":"Install from PyPI"},{"cmd":"conda install -c conda-forge dask-glm","lang":"bash","label":"Install via conda"}],"dependencies":[{"reason":"Core dependency for distributed computing and array/DataFrame abstractions","package":"dask","optional":false},{"reason":"Used for optimization routines and linear algebra","package":"scipy","optional":false},{"reason":"Required for array operations","package":"numpy","optional":false},{"reason":"Optional: GPU acceleration for GLM fitting","package":"cupy","optional":true}],"imports":[{"note":"LogisticRegression is not exposed at package top level; import from submodule.","wrong":"from dask_glm import LogisticRegression","symbol":"LogisticRegression","correct":"from dask_glm.logistic import LogisticRegression"},{"note":"Import PoissonRegression from the poisson submodule.","wrong":"","symbol":"PoissonRegression","correct":"from dask_glm.poisson import PoissonRegression"},{"note":"Regularizer functions are in dask_glm.regularizers.","wrong":"","symbol":"proximal_grad","correct":"from dask_glm.regularizers import proximal_grad"}],"quickstart":{"code":"import dask.array as da\nfrom dask_glm.logistic import LogisticRegression\n\n# Create synthetic data\nnp.random.seed(0)\nX = da.from_array(np.random.randn(1000, 10), chunks=100)\ny = da.from_array((np.random.rand(1000) > 0.5).astype(int), chunks=100)\n\n# Fit logistic regression\nmodel = LogisticRegression()\ncoef = model.fit(X, y).coef_\nprint(coef.compute())","lang":"python","description":"Quick example: fit a logistic regression model on a Dask array."},"warnings":[{"fix":"Upgrade Python to 3.10 or later.","message":"dask-glm 0.4.0 drops support for Python 3.8 and 3.9; requires Python >=3.10.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Use the class-based API: `model = LogisticRegression(); model.fit(X, y).coef_`.","message":"The old API using functions like `dask_glm.logistic.fit` is deprecated in favor of the object-oriented API with `LogisticRegression().fit()`.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Install cupy and convert Dask arrays to cupy arrays via `.map_blocks(cp.asarray)` before fitting.","message":"When using GPU acceleration with CuPy, ensure CuPy is installed and arrays are cupy-backed Dask arrays. The library does not automatically move data to GPU.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install dask-glm` and then import as `from dask_glm.logistic import LogisticRegression`.","cause":"Library not installed or installed incorrectly (e.g., pip install dask-glm but tried import dask_glm).","error":"ModuleNotFoundError: No module named 'dask_glm'"},{"fix":"Use `from dask_glm.logistic import LogisticRegression`.","cause":"Trying to import LogisticRegression from the top-level package, but it is in dask_glm.logistic.","error":"AttributeError: module 'dask_glm' has no attribute 'LogisticRegression'"},{"fix":"Increase chunk size: e.g., `X = da.from_array(data, chunks=500)` or use `X.rechunk(chunks=500)`.","cause":"Dask array chunks are too small, causing issues with solver internals.","error":"ValueError: The computed value of 'chunks' is larger than the number of rows. (Try increasing chunk size?)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}