pycse

Perform linear, nonlinear, and polynomial regression with confidence intervals and prediction bounds.

34|7|Updated Nov 29, 2025
One-click install
npx skills add https://github.com/jkitchin/skillz --skill pycse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pycse
Source: https://github.com/jkitchin/skillz/tree/main/skills/python/pycse
Command: npx skills add https://github.com/jkitchin/skillz --skill pycse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides wrappers around SciPy for regression tasks with automatic confidence intervals and prediction bounds, dramatically reducing boilerplate and error-prone math.

Core Features & Use Cases

  • Automatic confidence intervals for linear, nonlinear, and polynomial regression
  • Prediction intervals with bound estimates
  • Caching for expensive computations and Google Sheets integration
  • Consistent API for regress, nlinfit, polyfit, and more

Quick Start

Use pycse.nlinfit to fit a nonlinear model and obtain confidence intervals with a single call.

Frequently Asked Questions about pycse

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fit a regression model and get confidence intervals automatically?

Regression with confidence intervals involves fitting a model to data and calculating uncertainty bounds around parameters. pycse automates this by wrapping SciPy functions to return parameter estimates, interval bounds, and standard errors in a single call for linear, nonlinear, and polynomial models.

Can I generate prediction intervals for regression forecasts?

Prediction intervals quantify uncertainty around individual forecasts from a fitted model. pycse provides prediction interval bounds alongside point estimates, enabling you to report ranges rather than single values when predicting new data points.

How do I compare regression models using statistical criteria?

Model comparison uses metrics like BIC and R² to evaluate which model better explains your data. pycse exposes these statistics directly from fitted models, letting you rank candidate fits without manual calculations.

Does this work for nonlinear regression fits?

Yes. pycse.nlinfit handles nonlinear regression alongside linear and polynomial cases, all returning confidence intervals and prediction bounds through the same consistent API.

Can I speed up repeated regression analyses on the same data?

Caching mechanisms like HashCache, JsonCache, and SqlCache store computation results, avoiding redundant fitting when you re-run analysis pipelines. pycse integrates these to persist expensive regressions.

What if my data comes from Google Sheets?

pycse supports direct data ingestion from Google Sheets, eliminating manual export steps and keeping your analysis workflow connected to live data sources.