dswah/pyGAM

ValueError: cannot set WRITEABLE flag to True of this array

MMCMA opened this issue · 2 comments

MMCMA commented

After installing sciki-sparse I get the following error when fitting a LinearGAM with pygam. Here is the relevant error trace:

  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/pygam.py", line 915, in fit
    self._pirls(X, y, weights)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/pygam.py", line 753, in _pirls
    E = self._cholesky(S + P, sparse=False, verbose=self.verbose)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/pygam.py", line 520, in _cholesky
    L = cholesky(A, **kwargs)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/pygam/utils.py", line 59, in cholesky
    P[np.arange(len(p)), p] = 1
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/scipy/sparse/_lil.py", line 331, in __setitem__
    IndexMixin.__setitem__(self, key, x)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/scipy/sparse/_index.py", line 118, in __setitem__
    i, j = _broadcast_arrays(row, col)
  File "/opt/conda/envs/py310/lib/python3.10/site-packages/scipy/sparse/_index.py", line 24, in _broadcast_arrays
    y.flags.writeable = b.flags.writeable
ValueError: cannot set WRITEABLE flag to True of this array

I use the following versions:
pygam : 0.9.0

I got the same issue

conda uninstall scikit-sparse works