Instead of homegrown tensor-product.
This way we avoid materializing the dense model matrix for our model matrices
B-Splines
https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.BSpline.html
Tensors
scipy.sparse.kron:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.kron.html
to replace:
|
def tensor_product(a, b, reshape=True): |