[Python] Batch make_smoothing_spline in scipy

Discussão em 'Python' iniciado por Stack, Fevereiro 11, 2025.

  1. Stack

    Stack Membro Participativo

    In scipy, the function scipy.interpolate.make_interp_spline() can be batched since its x argument must be one-dimensional with shape (m,) and its y argument can have shape (m, ...).

    However, the function scipy.interpolate.make_smoothing_spline() only accepts a y argument of shape (m,).

    Is there a simple way to batch the behavior of make_smoothing_spline() so it has the same behavior as make_interp_spline()?

    I was thinking of using numpy.vectorize(), but here I'm not batching operations on an array, I need a single function as output.

    I guess I could just implement a loop and make a nested list of splines, but I was wondering if there would be a neater way.

    Probably some combination of decorators but I'm twisting my brain in knots...

    EDIT: Developers seem to be aware of this issue here.

    Continue reading...

Compartilhe esta Página