--- id: polars-ds version: "0.12.0" license: unclear license_treatment: permissive maintenance: active --- # polars-ds License: permissive · Maintenance: active · Downloads: 177.8K/mo ## What it is and what it does Polars-ds is a Polars extension that brings data science and statistical modeling directly into lazy dataframe expressions. It lets you compute ML metrics, fit regression models, run statistical tests, and calculate string/array distances all within Polars' query engine, avoiding intermediate data copies. The package covers linear regression (with L1/L2 regularization), logistic regression, rolling and recursive regression, statistical tests (t-test, chi-squared, F-test), string distances (Levenshtein, Jaro-Winkler, OSA), and array distances. Models are non-persistent—fit and predict in a single expression—and work alongside Polars' group_by and lazy evaluation. It requires Python 3.9+ and depends only on polars and typing-extensions. The package is written in Rust for performance and ships as compiled wheels for macOS (x86_64 and arm64), Linux (x86_64 and aarch64), and Windows. It is in Beta status and actively maintained. Use it for: - Compute ML evaluation metrics (ROC-AUC, log-loss) in parallel across data segments using group_by. - Fit and predict with linear or logistic regression inline within a Polars expression without materializing intermediate tables. - Generate polynomial features and produce statsmodels-style regression summaries with coefficients, p-values, and confidence intervals. - Calculate string edit distances (Levenshtein, Jaro-Winkler) or array distances (squared L2) for fuzzy matching or similarity scoring. - Run statistical hypothesis tests (t-test, chi-squared, F-test) grouped by category within a single lazy query. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Polars-ds adds data science and machine learning operations to Polars dataframes, including linear regression, logistic regression, statistical tests, string and array distances, and feature engineering transforms. Yes, if you work with Polars and need inline statistical modeling or ML metrics. The permissive MIT license, minimal dependencies, and active maintenance make it low-risk. Medium install friction (compiled wheels) is typical for performance-critical packages. Beta status is acceptable for exploratory or non-critical workflows; verify stability requirements for production use. ## Install pip install polars-ds uv add polars-ds poetry add polars-ds ## Installing polars-ds Before you install: Medium install friction due to compiled wheels across multiple platforms (x86_64, arm64, Windows). Active maintenance with recent release (74 days ago). Minimal runtime dependencies: only polars and typing-extensions. License in practice: MIT license (permissive) allows commercial and private use without restriction. Quickstart: pip install polars-ds import polars as pl import polars_ds as pds df = pl.DataFrame({"x1": [1.0, 2.0], "x2": [3.0, 4.0], "y": [5.0, 6.0]}) result = df.select(pds.lin_reg(pl.col("x1"), pl.col("x2"), target=pl.col("y"))) Requires Python 3.9+. Compiled wheels available for macOS (x86_64, arm64), Linux (x86_64, aarch64), and Windows (x86_64); other platforms may require building from source. Verify before relying: - Whether the package supports GPU acceleration or only CPU computation. - Performance characteristics compared to scikit-learn or statsmodels for the same operations. - Stability guarantees given Beta development status. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 177.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags polars machine learning extension, dataframe linear regression, statistical tests in polars, string distance metrics, feature engineering polars, polars-extension, statistical-modeling, feature-engineering [View on SkillFed](https://skillfed.io/packages/polars-ds) · [View on PyPI](https://pypi.org/project/polars-ds/)