Skip to content

ValueError: cannot set WRITEABLE flag to True of this array #337

@MMCMA

Description

@MMCMA

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions