Closed koop14 closed 8 months ago
Unable to reproduce on master
.
You have a released version of python, but are running the example on the master
branch. Try running the 1.7.5 version of this example.
Thanks, the example works. I'm following the instructions and still getting the same error:
poly1 = ps.PolynomialLibrary(degree=1, include_bias=True)
poly2 = ps.PolynomialLibrary(degree=1, include_bias=False)
#library 1: 1 bias, 3 state, 2 controls. library 2: 0 bias, 0 state, 2 controls
#The desired end result is 1 degree polynomial + interactions between state and controls
inputs_per_library = [[0, 1, 2, 3, 4, 5], [3,3,3,3,4]]
tensor_array = [[1, 1]]
generalized_library = ps.GeneralizedLibrary([poly1, poly2],
tensor_array=tensor_array,
inputs_per_library=inputs_per_library)
Traceback (most recent call last):
Cell In[5961], line 6 generalized_library = ps.GeneralizedLibrary([poly1, poly2],
File ~\anaconda3\envs\k\lib\site-packages\pysindy\feature_library\generalized_library.py:124 in init if inputs_per_library.ndim != 2:
AttributeError: 'list' object has no attribute 'ndim'
Cast inputs_per_library
as a numpy array and it should work.
Issue with generalized library example here: https://github.com/dynamicslab/pysindy/blob/master/examples/1_feature_overview/example.ipynb
Reproducing code example: