Unexpected keyword argument 'normalize' when instantiating LinearRegression
When running an example program, PySINDy seems to instantiate a LinearRegression object when creating the optimizer ps.STLSQ, and throws a TypeError: TypeError: LinearRegression.__init__() got an unexpected keyword argument 'normalize'.
Reproducing code example:
import pysindy
poly_order = 3 # Adjust based on your problem
feature_library = ps.PolynomialLibrary(degree=poly_order)
lag = 1
# stack lagged data
X = np.column_stack([np.roll(self.training_input_data, i) for i in range(lag+1)] +
[np.roll(self.training_output_data, i) for i in range(lag+1)])
#remove rows due to shifting
X = X[lag:, :]
self.training_output_data = self.training_output_data[lag:]
optimizer = ps.STLSQ(threshold=0.1)# ERROR THROWN HERE
model = ps.SINDy(feature_names=["power", "input"], feature_library=feature_library, optimizer=optimizer) # SAME ERROR THROWN HERE WHEN REMOVING ps.STLSQ() AND REMOVING OPTIMIZER.
model.fit(X, t=1)
model.print()
Error message:
Exception has occurred: TypeError
LinearRegression.__init__() got an unexpected keyword argument 'normalize'
File "/Users/sebastianozuddas/Programming/Python/HAOS_Websocket/SystemIdentification.py", line 112, in fit_model_pysindy
optimizer = ps.STLSQ(threshold=0.1)#where threshold is Lambda
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/sebastianozuddas/Programming/Python/HAOS_Websocket/main.py", line 92, in main
test.fit_model_pysindy()
File "/Users/sebastianozuddas/Programming/Python/HAOS_Websocket/main.py", line 118, in <module>
asyncio.run(main())
TypeError: LinearRegression.__init__() got an unexpected keyword argument 'normalize'
Issue found.
When installing via conda install pysindy, an older version of pysindy is installed.
Installing with pip install pysindy doesn't throw the error.
Unexpected keyword argument 'normalize' when instantiating LinearRegression
When running an example program, PySINDy seems to instantiate a LinearRegression object when creating the optimizer
ps.STLSQ
, and throws a TypeError:TypeError: LinearRegression.__init__() got an unexpected keyword argument 'normalize'
.Reproducing code example:
Error message:
PySINDy/Python version information: