Comments (5)
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.
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.
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.
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.
The test failure you saw is troubling. I will have to look into it separately.
from pysindy.
Related Issues (20)
- Incorporate make_constraints into trapping_sr3.py HOT 8
- Initial Guess - SR3 - Custom Library [BUG] HOT 3
- [Help] Can't get the right model for 2d system HOT 3
- [DOC] WeakPDELibrary.transform does not produce output in shape specified by documentation.
- Help in figuring out the cause behind TypeError while fitting with tensor libraries HOT 7
- Optimizer for SINDy-PI feature of implicit ODEs HOT 7
- Let model.print() respect the same kwargs as print()
- Use `x_dot` kwarg in `model.fit` in PDEs with `WeakPDELibrary()`
- constraint_separation_index undocumented
- Do we need `test_trapping_cubic_library()`?
- Make `IdentityLibrary` a subclass of `PolynomialLibrary`
- Make models guaranteed pickleable
- Error in '3_original_Paper' Example: Missing 'quiet' Argument in pysindy.py HOT 1
- Remove research experiments from pysindy HOT 4
- [Question]How model.predict() works for implicit ODEs function? HOT 14
- Passing custom derivatives instead of using predefined differentiation classes HOT 4
- [BUG] pytest-lazy-fixture may be dead, blocking pytest upgrades HOT 1
- `np.median(model.coef_list, axis=0)` does not give the same answer as `model.print()` from first example in ensembling documentation HOT 2
- [BUG] SINDyDerivative does not handle PDEs HOT 2
- Feature request: Manually set coefficients HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysindy.