1

I'm trying to understand cubic spline generation in patsy library of python. As far as I can see from the output of

import numpy as np
from patsy import dmatrix

x = np.linspace(0., 1., 100)
y1 = dmatrix("bs(x, df=6, degree=3, include_intercept=True)", {"x": x})
print(y1)
y2 = dmatrix("bs(x, df=6, degree=3, include_intercept=False)", {"x": x})
print(y2)

the y1 (with intercept) and y2 (without intercept) are the same. Is there something I am missing? Thanks!

hovnatan
  • 1,331
  • 10
  • 23

1 Answers1

2

This was answered on the patsy issue tracker:

https://github.com/pydata/patsy/issues/108#issuecomment-309234408

tl;dr: they are different, but eyeballing big matrices full of floating point numbers is hard :-)

Nathaniel J. Smith
  • 11,613
  • 4
  • 41
  • 49