GithubHelp home page GithubHelp logo

Example of `scipy.interpolate.BSpline.design_matrix` equivalent with`skfda.representation.basis.BSplineBasis` about scikit-fda HOT 3 CLOSED

avivajpeyi avatar avivajpeyi commented on September 26, 2024
Example of `scipy.interpolate.BSpline.design_matrix` equivalent with`skfda.representation.basis.BSplineBasis`

from scikit-fda.

Comments (3)

vnmabus avatar vnmabus commented on September 26, 2024 1

The BSplineBasis object in scikit-fda is not intended to be a replacement of SciPy's B-splines (in fact, they are used internally). This object is just used to define a particular basis of functions for a FDataBasis object. Although some procedures, such as the computation of the design matrix, can be done with both, there exist some differences and I am not sure if I would recommend using scikit-fda for that purpose. First, as SciPy's B-splines are used internally, the scikit-fda implementation can only be slower. Secondly, the implementation of design_matrix in SciPy returns a sparse matrix, which will be more efficient in both memory and speed for a high number of basis elements.

Thus, unless you can provide a better explanation of why that should be done, I do not think that this is useful for most users.

Finally, note that there is an easier and faster way to compute that design matrix in scikit-fda:

fda_matrix = fda_basis(x)[..., 0]

from scikit-fda.

avivajpeyi avatar avivajpeyi commented on September 26, 2024

Ah I see! Thanks @vnmabus. In that case maybe we can close this issue.

Tbh the main reason I am using scikit-fda now instead of scipy' Bsplines is because I need to generate a penalty matrix for my basis (which I didn't know how to do with scipy's Bsplines, but can do with scikit-fda)

This might be another issue, but since the scipy design matrix is more efficient, is it possible to generate a penalty matrix for that via the scikit-fda interface?

from scikit-fda.

vnmabus avatar vnmabus commented on September 26, 2024

Unfortunately no. However for a small number of basis elements the difference in performance is probably not that much.

I will close this issue as not planned, then.

from scikit-fda.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.