root_mean_squared_log_error & mean_squared_log_error: ValueError should be raised only if y_true or y_pred contain a value below -1, not below 0

### Describe the bug

For the `sklearn.metrics.root_mean_squared_log_error(y_true, y_pred)` & `sklearn.metrics.mean_squared_log_error(y_true, y_pred)` evaluation metrics, if any of the values in `y_true` or `y_pred` are below 0, the following `ValueError` exception is raised:

```python
if (y_true < 0).any() or (y_pred < 0).any():
    raise ValueError(
        "Root Mean Squared Logarithmic Error cannot be used when "
        "targets contain negative values."
    )
```

However, the actual calculations behind these errors are valid for values of `y_true` & `y_pred` larger than -1, so any values in `y_true` or `y_pred` that are in the range [0, -1[ should be valid when calculating these errors. The equations are shown below, note that the log() of any value larger than 0 is valid:

$$RMSLE=\sqrt{\frac{1}{n} \sum_{i=1}^n (\log{(y_{pred}+1)}-\log{(y_{true}+1)})^2}$$

$$MSLE=\frac{1}{n} \sum_{i=1}^n (\log{(y_{pred}+1)}-\log{(y_{true}+1)})^2$$

The thresholds that trigger the `ValueError` exception should be adjusted as shown below: 

```python
if (y_true <= -1).any() or (y_pred <= -1).any():
    raise ValueError(
        "Root Mean Squared Logarithmic Error cannot be used when "
        "targets contain values below or equal to -1."
    )
```

### Steps/Code to Reproduce

```python
import numpy as np
from sklearn.metrics import root_mean_squared_log_error, mean_squared_log_error

y_true = [0, -0.25, -0.1]
y_pred = [1, -0.5, -0.9]

# Hand calculation of RMSLE is valid
RMSLE = (1 / len(y_pred) * sum([(np.log(y_pred[i] + 1) - np.log(y_true[i] + 1)) ** 2 for i in range(len(y_pred))])) ** 0.5

# Hand calculation of MSLE is valid
MSLE = 1 / len(y_pred) * sum([(np.log(y_pred[i] + 1) - np.log(y_true[i] + 1)) ** 2 for i in range(len(y_pred))])

# Error is raised with sklearn
print(root_mean_squared_log_error(y_true, y_pred)) 

# Error is raised with sklearn
print(mean_squared_log_error(y_true, y_pred))  
```

### Expected Results

No error is thrown. Errors should only be thrown if `y_true` or `y_pred` contain values below or equal to -1.

### Actual Results

Traceback (most recent call last):
  File "scratch.py", line 10, in <module>
    print(root_mean_squared_log_error(y_true, y_pred))  # Error is raised
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/sklearn/utils/_param_validation.py", line 213, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "[...]/lib/python3.11/site-packages/sklearn/metrics/_regression.py", line 759, in root_mean_squared_log_error
    raise ValueError(
ValueError: Root Mean Squared Logarithmic Error cannot be used when targets contain negative values.

### Versions

```shell
System:
    python: 3.11.8 (main, Feb 26 2024, 21:39:34) [GCC 11.2.0]
executable: /home/simon/anaconda3/envs/arcflashml/bin/python
   machine: Linux-5.15.153.1-microsoft-standard-WSL2-x86_64-with-glibc2.35

Python dependencies:
      sklearn: 1.4.2
          pip: 23.3.1
   setuptools: 68.2.2
        numpy: 1.26.4
        scipy: 1.13.0
       Cython: None
       pandas: 2.2.1
   matplotlib: 3.8.4
       joblib: 1.4.0
threadpoolctl: 3.4.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: mkl
    num_threads: 8
         prefix: libmkl_rt
       filepath: /home/simon/anaconda3/envs/arcflashml/lib/libmkl_rt.so.2
        version: 2023.1-Product
threading_layer: intel

       user_api: openmp
   internal_api: openmp
    num_threads: 16
         prefix: libiomp
       filepath: /home/simon/anaconda3/envs/arcflashml/lib/libiomp5.so
        version: None

       user_api: openmp
   internal_api: openmp
    num_threads: 16
         prefix: libgomp
       filepath: /home/simon/anaconda3/envs/arcflashml/lib/python3.11/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None

       user_api: blas
   internal_api: openblas
    num_threads: 16
         prefix: libopenblas
       filepath: /home/simon/anaconda3/envs/arcflashml/lib/python3.11/site-packages/scipy.libs/libopenblasp-r0-24bff013.3.26.dev.so
        version: 0.3.26.dev
threading_layer: pthreads
   architecture: Zen
```

COMMENT:
> My naive guess would be whoever implemented it saw the log and needed to ensure the log was not of a negative number. I'm surprised it was never an issue before

I agree with this. After verifying the non-negative condition, both functions feed `y_pred` and `y_true` into `numpy.log1p` instead of `numpy.log`. After reading the OP and the code myself, I don't believe checking for non-negativity was intended.

I also suspect that most users assumed RMSLE and MSLE are meant for probabilities, so the issue arises when someone tries to feed non-probability values into the functions, as OP demonstrated here.

Labels: Bug