Install & Compatibility
Where this runs
tested against v2025.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 22.6s · import 7.684s · 717MB
730MB installed
● package 730MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
LogisticRegression
✓ from dask_ml.linear_model import LogisticRegression
✗ from dask_ml.models import LogisticRegression
wrong module path
train_test_split
✓ from dask_ml.model_selection import train_test_split
✗ from sklearn.model_selection import train_test_split
sklearn's API returns numpy arrays
preprocessing
✓ from dask_ml.preprocessing import StandardScaler
✗ from sklearn.preprocessing import StandardScaler
sklearn's StandardScaler does not work on Dask arrays
Basic usage: load data with Dask, split, train a logistic regression model, and compute accuracy.
import dask.dataframe as dd
from dask_ml.linear_model import LogisticRegression
from dask_ml.model_selection import train_test_split
# Create a Dask DataFrame from a CSV
df = dd.read_csv('data.csv')
X = df[['feature1', 'feature2']].to_dask_array(lengths=True)
y = df['label'].to_dask_array(lengths=True)
# Train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
# Fit model
model = LogisticRegression()
model.fit(X_train, y_train)
# Score
accuracy = model.score(X_test, y_test)
print(accuracy.compute())
Errors
Common errors & fixes
ValueError: could not broadcast input array from shape (X,) into shape (Y,)
Mismatched chunk sizes in Dask array during fit.
fixEnsure all input Dask arrays have known chunk sizes: X = X.compute_chunk_sizes()
TypeError: Only Dask DataFrames are supported; got pandas DataFrame
Passed a pandas DataFrame to dask_ml.model_selection functions.
fixConvert using ddf = dask.dataframe.from_pandas(df, npartitions=...)
ModuleNotFoundError: No module named 'dask_ml.models'
Wrong import path for estimators.
fixUse correct submodule, e.g., from dask_ml.linear_model import LogisticRegression
Upgrade
Version history
2025.1.0latest on PyPI · released Feb 8, 2025
Audit
Dependencies
daskrequiredcore distributed computing framework
scikit-learnrequiredAPI compatibility and underlying algorithms
pandasrequireddata handling
numpyrequiredarray operations
distributedoptionaloptional distributed scheduler