Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

ENH: option for nonreplicated exterior knots in b-splines

Open
#132 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start in patsy/splines.py around line 229 and inspect the BS implementation, then trace how stateful transforms are represented in design_info. Review the linked statsmodels PR and the stated mgcv behavior to define the required exterior-knot option and transform access. Done means the supported behavior and resulting spline metadata are specified and covered by appropriate tests.

Written by the indexing model from the issue text.

Description

AFAICS, patsy sets all exterior knots in BS at the same points, i.e. lower_bound and upper_bound.

https://github.com/pydata/patsy/blob/master/patsy/splines.py#L229

I'm trying to replicate some mgcv functions, and mgcv chooses by default spread out exterior knots. I don't see a way how to replicate this with patsy's BS.

I started to work again on GAM for statsmodels
https://github.com/statsmodels/statsmodels/pull/5296

side question: Is there a way to get access to the stateful transform and underlying spline, e.g. BS, instance from the design_info.
(e.g. in general we would need to know which transform patsy applied to the basis function to incorporate the sum to zero or removal of constant constraint, because a transformation of the spline basis and parameters would also have to be applied to the penalization matrix.)

Dominant language
Python
Stars
989
Forks
106
Avg merge
7d 34m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pydata/patsy

All issues in pydata/patsy

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.