Giter VIP home page Giter VIP logo

Comments (5)

billtubbs avatar billtubbs commented on June 10, 2024 2

The standard solution is to set the default values to None and then instantiate new STLSQ(), PolynomialFeatures() or FiniteDifference() objects if required in the body of the __init__ method.

E.g.

    if optimizer is None:
        self.optimizer = STLSQ()
    else:
        self.optimizer = optimizer

I can submit a pull-request to fix this if you like.

from pysindy.

briandesilva avatar briandesilva commented on June 10, 2024

This is a great suggestion, thanks! If you'd like to submit a pull-request, please do. Otherwise I can make the fix sometime in the next 24 hours.

from pysindy.

billtubbs avatar billtubbs commented on June 10, 2024

Now I'm getting 1 test fail. Any idea how this change to SINDy() could have caused this:

        optimizers = [SINDyOptimizer(o, unbias=True) for o in optimizers]
    
        for opt in optimizers:
            opt.fit(x, y)
    
        for less_complex, more_complex in zip(optimizers, optimizers[1:]):
            # relax the condition to account for
            # noise and non-normalized threshold parameters
>           assert less_complex.complexity <= more_complex.complexity + 1
E           AssertionError: assert 4 <= (2 + 1)
E            +  where 4 = SINDyOptimizer(optimizer=SR3(copy_X=True, fit_intercept=True, max_iter=30,\n                             normalize=False, nu=1.0, threshold=0.1,\n                             thresholder='l1', tol=1e-05),\n               unbias=True).complexity
E            +  and   2 = SINDyOptimizer(optimizer=Lasso(alpha=1.0, copy_X=True, fit_intercept=True,\n                               max_iter=100...          selection='cyclic', tol=0.0001,\n                               warm_start=False),\n               unbias=True).complexity

test/property_tests/test_optimizers_complexity.py:55: AssertionError

How does this test work?

from pysindy.

billtubbs avatar billtubbs commented on June 10, 2024

Actually, this is not related. I just rolled back my changes and this test was failing before. My changes pass pytest test/test_pysindy.py. So I will submit a pull-request. Not sure what the other problem is.

from pysindy.

briandesilva avatar briandesilva commented on June 10, 2024

The test failure you saw is troubling. I will have to look into it separately.

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.