ValueError in PLSRegression.fit() with zero-variance predictor

### Describe the bug

Related: https://github.com/scipy/scipy/commit/5bc3d8814d566ef328f41cfa69ccd797c68b0d02

When fitting a PLSRegression model, if the input array X contains a feature with zero variance (i.e., a constant column), the fit method raises a ValueError: illegal value in 4th argument of internal gesdd.

This results in a division by zero when a predictor has no variance, creating NaN values likely in the intermediate matrices. These NaN values are then passed to the SciPy function, which in turn calls the LAPACK gesdd routine for SVD, causing it to crash.

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.cross_decomposition import PLSRegression

n_samples = 20
y = np.arange(n_samples, dtype=float)

# This feature has zero variance.
X = np.ones((n_samples, 1))

# This will raise the error.
pls = PLSRegression(n_components=1)
pls.fit(X, y)
```

### Expected Results

The model should either fit successfully (e.g., perhaps assigning a zero weight to the zero-variance feature) or raise a more informative ValueError indicating that a predictor has zero variance.

### Actual Results

We get "ValueError: illegal value in 4th argument of internal gesdd"

```python
/home/user/.local/lib/python3.13/site-packages/sklearn/cross_decomposition/_pls.py:99: RuntimeWarning: invalid value encountered in divide
  y_weights = np.dot(Y.T, x_score) / np.dot(x_score.T, x_score)
/home/user/.local/lib/python3.13/site-packages/sklearn/cross_decomposition/_pls.py:368: RuntimeWarning: invalid value encountered in divide
  x_loadings = np.dot(x_scores, Xk) / np.dot(x_scores, x_scores)
/home/user/.local/lib/python3.13/site-packages/sklearn/cross_decomposition/_pls.py:377: RuntimeWarning: invalid value encountered in divide
  y_loadings = np.dot(x_scores, yk) / np.dot(x_scores, x_scores)
Traceback (most recent call last):
  File "/home/user/agents/test/f.py", line 14, in <module>
    pls.fit(X, y)
    ~~~~~~~^^^^^^
  File "/home/user/.local/lib/python3.13/site-packages/sklearn/cross_decomposition/_pls.py", line 719, in fit
    super().fit(X, y)
    ~~~~~~~~~~~^^^^^^
  File "/home/user/.local/lib/python3.13/site-packages/sklearn/base.py", line 1389, in wrapper
    return fit_method(estimator, *args, **kwargs)
  File "/home/user/.local/lib/python3.13/site-packages/sklearn/cross_decomposition/_pls.py", line 396, in fit
    pinv2(np.dot(self.x_loadings_.T, self.x_weights_), check_finite=False),
    ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.13/site-packages/scipy/linalg/_basic.py", line 1607, in pinv
    u, s, vh = _decomp_svd.svd(a, full_matrices=False, check_finite=False)                                                     ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/lib/python3.13/site-packages/scipy/linalg/_decomp_svd.py", line 168, in svd               raise ValueError('illegal value in %dth argument of internal gesdd'                                                              % -info)
ValueError: illegal value in 4th argument of internal gesdd
```

### Versions

```shell
System:                                                     python: 3.13.5 (main, Jun 12 2025, 00:00:00) [GCC 14.3.1 20250523 (Red Hat 14.3.1-1)]
executable: /usr/bin/python3                               machine: Linux-6.14.8-400.asahi.fc41.aarch64+16k-aarch64-with-glibc2.40                                                                                              Python dependencies:
      sklearn: 1.6.1
          pip: 25.1.1                                      setuptools: 69.2.0
        numpy: 1.26.4                                           scipy: 1.15.3
       Cython: None                                            pandas: 2.2.3
   matplotlib: 3.10.3
       joblib: 1.5.0                                    threadpoolctl: 3.6.0
                                                        Built with OpenMP: True
threadpoolctl info:                                            user_api: blas
   internal_api: openblas                                   num_threads: 1
         prefix: libopenblas                                   filepath: /usr/lib64/libopenblas-r0.3.26.so
        version: 0.3.26                                 threading_layer: disabled
   architecture: neoversen1
       user_api: openmp                                    internal_api: openmp
    num_threads: 8                                               prefix: libgomp
       filepath: /usr/lib64/libgomp.so.1.0.0                    version: None
                                                               user_api: blas
   internal_api: openblas
    num_threads: 8                                               prefix: libscipy_openblas
       filepath: /home/user/.local/lib/python3.13/site-packages/scipy.libs/libscipy_openblas-9778f98e.so
        version: 0.3.28                                 threading_layer: pthreads
   architecture: neoversen1

       user_api: openmp                                    internal_api: openmp
    num_threads: 8                                               prefix: libgomp
       filepath: /home/user/.local/lib/python3.13/site-packages/scikit_learn.libs/libgomp-d22c30c5.so.1.0.0             version: None
```

COMMENT:
Interestingly, I do not get the `ValueError` but the model predicts nan values on this reproducer:

```python
In [1]: import numpy as np
   ...: from sklearn.cross_decomposition import PLSRegression
   ...: 
   ...: n_samples = 20
   ...: y = np.arange(n_samples, dtype=float)
   ...: 
   ...: # This feature has zero variance.
   ...: X = np.ones((n_samples, 1))
   ...: 
   ...: # This will raise the error.
   ...: pls = PLSRegression(n_components=1)
   ...: pls.fit(X, y).predict(X)
/Users/ogrisel/code/scikit-learn/sklearn/cross_decomposition/_pls.py:90: RuntimeWarning: invalid value encountered in divide
  y_weights = np.dot(y.T, x_score) / np.dot(x_score.T, x_score)
/Users/ogrisel/code/scikit-learn/sklearn/cross_decomposition/_pls.py:328: RuntimeWarning: invalid value encountered in divide
  x_loadings = np.dot(x_scores, Xk) / np.dot(x_scores, x_scores)
/Users/ogrisel/code/scikit-learn/sklearn/cross_decomposition/_pls.py:337: RuntimeWarning: invalid value encountered in divide
  y_loadings = np.dot(x_scores, yk) / np.dot(x_scores, x_scores)
Out[1]: 
array([nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan,
       nan, nan, nan, nan, nan, nan, nan])

In [2]: import scipy

In [3]: scipy.__version__
Out[3]: '1.16.1'
```

So it's definitely a bug.

Labels: Bug