Proposal to change default value of n_neighbors in mutual_info_regression

### Describe the bug

Hi, recently I figured out that for short sequences default value of 3 is way too unstable and gives poor results.

Don't know the reasons why 3 was used, my testing shows that 2 is a far more appropriate choice for some unknown reason.

Please change it to 2 to reduce users' frustration )

Or maybe someone can dig deeper and find out what's causing such discrepancy, something must be not quite right there.

_mutual_info_classif_ probably needs to be changed, too.

### Steps/Code to Reproduce

```python
from sklearn.feature_selection import mutual_info_regression
import numpy as np


def etimate_mi(rel_name: str, x: np.ndarray, y: np.ndarray, n_reps: int = 100, n_neighbors: int = 3):
    mi = []
    for _ in range(n_reps):
        mi.append(mutual_info_regression(x, y.ravel(), n_neighbors=n_neighbors)[0])
    mi = np.array(mi)
    print(
        f"{len(x)} samples {rel_name} with {n_neighbors} n_neighbors: mi_min={mi.min():.4f}, mi_max={mi.max():.4f}, corrcoef={np.corrcoef(x, y, rowvar=False)[0][1]:.4f}"
    )


def demonstrate_perfect_vs_zero_mi(sample_size: int = 10, n_reps: int = 100, n_neighbors: int = 3):
    x = np.arange(sample_size).reshape(-1, 1)
    zero = np.random.random(sample_size)
    perfect = x * 2

    etimate_mi(rel_name="perfect relationship", x=x, y=perfect, n_reps=n_reps, n_neighbors=n_neighbors)
    etimate_mi(rel_name="zero relationship", x=x, y=zero, n_reps=n_reps, n_neighbors=n_neighbors)


for sample_size in (10, 20, 30, 1000):
    for n_neighbors in (4, 3, 2, 1):
        demonstrate_perfect_vs_zero_mi(sample_size=sample_size, n_reps=100, n_neighbors=n_neighbors)
        print("\n")
    print("\n")
```

### Expected Results

10 samples perfect relationship with 4 n_neighbors: mi_min=0.2811, mi_max=0.5990, corrcoef=1.0000
10 samples zero relationship with 4 n_neighbors: mi_min=0.0000, mi_max=0.2262, corrcoef=0.2706


10 samples perfect relationship with 3 n_neighbors: **mi_min=0.2823, mi_max=0.8006**, corrcoef=1.0000
10 samples zero relationship with 3 n_neighbors: mi_min=0.0000, mi_max=0.0492, corrcoef=-0.3437


10 samples perfect relationship with 2 n_neighbors: **mi_min=0.8956, mi_max=1.0790**, corrcoef=1.0000
10 samples zero relationship with 2 n_neighbors: mi_min=0.0000, mi_max=0.0000, corrcoef=0.3402


10 samples perfect relationship with 1 n_neighbors: mi_min=0.7290, mi_max=1.3290, corrcoef=1.0000
10 samples zero relationship with 1 n_neighbors: mi_min=0.0000, mi_max=0.0622, corrcoef=-0.1999




20 samples perfect relationship with 4 n_neighbors: mi_min=0.9413, mi_max=1.0477, corrcoef=1.0000
20 samples zero relationship with 4 n_neighbors: mi_min=0.0000, mi_max=0.1007, corrcoef=0.1928


20 samples perfect relationship with 3 n_neighbors: mi_min=0.9577, mi_max=1.1102, corrcoef=1.0000
20 samples zero relationship with 3 n_neighbors: mi_min=0.0000, mi_max=0.0381, corrcoef=-0.0137


20 samples perfect relationship with 2 n_neighbors: mi_min=1.0144, mi_max=1.1311, corrcoef=1.0000
20 samples zero relationship with 2 n_neighbors: mi_min=0.0763, mi_max=0.1793, corrcoef=-0.2913


20 samples perfect relationship with 1 n_neighbors: mi_min=1.0927, mi_max=1.3927, corrcoef=1.0000
20 samples zero relationship with 1 n_neighbors: mi_min=0.5010, mi_max=0.5010, corrcoef=-0.1347




30 samples perfect relationship with 4 n_neighbors: mi_min=1.0278, mi_max=1.1119, corrcoef=1.0000
30 samples zero relationship with 4 n_neighbors: mi_min=0.0000, mi_max=0.0000, corrcoef=0.0565


30 samples perfect relationship with 3 n_neighbors: mi_min=1.1962, mi_max=1.2784, corrcoef=1.0000
30 samples zero relationship with 3 n_neighbors: mi_min=0.0000, mi_max=0.0697, corrcoef=-0.2489


30 samples perfect relationship with 2 n_neighbors: mi_min=1.2395, mi_max=1.2951, corrcoef=1.0000
30 samples zero relationship with 2 n_neighbors: mi_min=0.0000, mi_max=0.0000, corrcoef=0.0368


30 samples perfect relationship with 1 n_neighbors: mi_min=1.1951, mi_max=1.3951, corrcoef=1.0000
30 samples zero relationship with 1 n_neighbors: mi_min=0.0000, mi_max=0.0000, corrcoef=-0.0677




1000 samples perfect relationship with 4 n_neighbors: mi_min=1.3389, mi_max=1.3406, corrcoef=1.0000
1000 samples zero relationship with 4 n_neighbors: mi_min=0.0129, mi_max=0.0129, corrcoef=-0.0335


1000 samples perfect relationship with 3 n_neighbors: mi_min=1.3397, mi_max=1.3421, corrcoef=1.0000
1000 samples zero relationship with 3 n_neighbors: mi_min=0.0000, mi_max=0.0000, corrcoef=-0.0188


1000 samples perfect relationship with 2 n_neighbors: mi_min=1.3414, mi_max=1.3430, corrcoef=1.0000
1000 samples zero relationship with 2 n_neighbors: mi_min=0.0149, mi_max=0.0149, corrcoef=-0.0156


1000 samples perfect relationship with 1 n_neighbors: mi_min=1.3400, mi_max=1.3460, corrcoef=1.0000
1000 samples zero relationship with 1 n_neighbors: mi_min=0.0000, mi_max=0.0000, corrcoef=0.0043

### Actual Results

As you can see, for short samples (under 20 instances), 3 gives much more variable and much less concise results than 2.
I vote for 2! With 2, a perfect relationship indeed gets robust high mi scores, and a zero relationship gets mi scores close to zero.  With a bigger sample size, n_neighbors does not matter that much anymore.

### Versions

```shell
System:
    python: 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)]
executable: C:\ProgramData\Anaconda3\python.exe
   machine: Windows-10-10.0.19041-SP0

Python dependencies:
      sklearn: 1.1.3
          pip: 23.0
   setuptools: 52.0.0.post20210125
        numpy: 1.22.4
        scipy: 1.10.0
       Cython: 0.29.32
       pandas: 1.5.3
   matplotlib: 3.6.3
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: C:\ProgramData\Anaconda3\Lib\site-packages\numpy\.libs\libopenblas.EL2C6PLE4ZYW3ECEVIV3OXXGRN2NRFM2.gfortran-win_amd64.dll
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell
    num_threads: 8

       user_api: blas
   internal_api: mkl
         prefix: mkl_rt
       filepath: C:\ProgramData\Anaconda3\Library\bin\mkl_rt.1.dll
        version: 2021.2-Product
threading_layer: intel
    num_threads: 4

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: C:\ProgramData\Anaconda3\Lib\site-packages\scipy.libs\libopenblas-802f9ed1179cb9c9b03d67ff79f48187.dll
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell
    num_threads: 8

       user_api: openmp
   internal_api: openmp
         prefix: vcomp
       filepath: C:\ProgramData\Anaconda3\Lib\site-packages\sklearn\.libs\vcomp140.dll
        version: None
    num_threads: 8

       user_api: openmp
   internal_api: openmp
         prefix: libiomp
       filepath: C:\ProgramData\Anaconda3\Lib\site-packages\torch\lib\libiomp5md.dll
        version: None
    num_threads: 4

       user_api: openmp
   internal_api: openmp
         prefix: libiomp
       filepath: C:\ProgramData\Anaconda3\Lib\site-packages\torch\lib\libiompstubs5md.dll
        version: None
    num_threads: 1
```

COMMENT:
The default value is not the optimal value in all situations. It's a good enough value in most situations. I don't think we should change the default based on 1 example.

Looking at the code I didn't find any issue with n_neighbors=3 in particular. Let's close this issue and consider reopening if new info comes in.

Labels: Bug, Needs Triage