Registry / analytics / polars-ols

polars-ols

JSON →
library0.3.5pypypi✓ verified 82d ago

An extension for Polars providing Ordinary Least Squares (OLS) regression support. Version 0.3.5 is current. Release cadence is irregular.

pip install polars-ols
INSTALL
IMPORT
SIG · POLARS-OLS
P
polars-ols
analyticspythonv0.3.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

least_squares
from polars_ols import least_squares
from polars_ols import OLS
compute_least_squares
from polars_ols import compute_least_squares
LeastSquares
from polars_ols import LeastSquares

Fit OLS regression using polars-pipe syntax.

import polars as pl import polars_ols df = pl.DataFrame({ 'y': [1.0, 2.0, 3.0, 4.0, 5.0], 'x1': [2.0, 3.0, 4.0, 5.0, 6.0], 'x2': [1.0, 4.0, 9.0, 16.0, 25.0] }) result = df.pipe(polars_ols.ols, 'y', ['x1', 'x2']) print(result)
Debug
Known issues
gotchaThe package provides a single function `ols`; it does not support multiple regression types or complex formulas.
fix
Use polars_ols.ols for linear OLS only. For other models, consider statsmodel or sklearn.
affects: all
gotchaThe function returns a polars DataFrame with columns for coefficients, standard errors, t-stats, p-values, etc., not a statsmodels-like result object.
fix
Access results via DataFrame column names, e.g., result['coef'].
affects: all
deprecatedInterface changed in 0.3.0: previously used `polars_ols.ols(df, y, x)` now uses `df.pipe(polars_ols.ols, y, x)`.
fix
Use pipe syntax: df.pipe(polars_ols.ols, 'y', ['x1', 'x2'])
affects: <0.3.0
Upgrade
Version history
0.3.5latest on PyPI · released Aug 25, 2024
Audit
Dependencies
polarsrequiredCore dependency for dataframe operations
Agent activity
31 hits · last 30 days
node
28
OpenAI (training)
1
Resources

No resource links recorded.

polars-ols — pip install polars-ols · libregistry