Giter VIP home page Giter VIP logo

Comments (6)

Ohjeah avatar Ohjeah commented on June 10, 2024

You can use the sklearn gridsearch on nested or composed estimators as well: https://scikit-learn.org/stable/modules/grid_search.html#composite-estimators-and-parameter-spaces

We need to make sure though, that all nested objects inherit properly from the BaseEstimator class, as this implements the two methods (set_params and get_params) needed.

Also, internally we are using a MultiOutput(Pipeline). As you said, this might clutter the parameter names. If this is the case, we can overwrite set_params and get_params for a cleaner interface.

from pysindy.

rspadim avatar rspadim commented on June 10, 2024

Should be interesting an example at documentation

from pysindy.

briandesilva avatar briandesilva commented on June 10, 2024

I was looking into this again and your suggestion, @Ohjeah, now works smoothly (since we have refactored the optimizer code).

However there's another problem: the SINDy fit and score methods take an optional parameter t which isn't standard for scikit-learn. When a uniform time step other than 1 is used, the cross validation object doesn't have a way to pass it into both the fit and score methods. You can pass in a fixed time step to SINDy.fit via the **fit_params argument of the cross validation object, but not the score function.

One option is to not try to feed t in and assume a uniform time step of 1. If you then divide the coefficients of the resulting model by the true time step you'll arrive at the correct equation, but you'll also have to shrink the thresholds by the same factor.

Another option could be to add a parameter to the SINDy constructor allowing you to specify a fixed uniform time step that would be used as a default if other values are not passed in. I think this might be the cleanest solution. I'll play around with it and see how it looks.

Nonuniform time steps or control variables are another story. I haven't thought much about how to incorporate them into this framework.

from pysindy.

Ohjeah avatar Ohjeah commented on June 10, 2024

Closed with #84

from pysindy.

Ohjeah avatar Ohjeah commented on June 10, 2024

@briandesilva I overlooked your last comment and assumed this issues was closed with the corresponding PR.

Should we re-open, or open a separate issue to discuss parameters for the derivative?

Btw: you can also use a custom scorer in gridsearches/crossvalidation.

from pysindy.

briandesilva avatar briandesilva commented on June 10, 2024

I don't think we need to re-open the issue. I'm satisfied with our current cross-validation capabilities.

from pysindy.

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.