LinearDiscriminantAnalysis: svd solver gives different results than eigen and lsqr.

### Describe the bug

LinearDiscriminantAnalysis provides three methods for determining the discriminants: `svd` (the default), `lsqr` and `eigen`. The coefficients produced by the `lsqr` and `eigen` methods agree with each other and disagree with that produced by `svd`. This disagreement is particularly large when the classes have different scalings. 

Looking at the source code, the error could be partially due to improper scaling of the centered data. At line 509 of `discriminant_analysis.py`, the comments indicate that the features should be scaled by their within-class standard deviations, but are actually being scaled by the overall standard deviations.

### Steps/Code to Reproduce

```
import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA

np.random.seed(0)

# Create some random data 
n_features, n_classes, n_trials = 150, 50, 25
X_  = np.random.randn(n_classes,n_trials,n_features)

# Apply class specific variances
for i in range(n_classes):
    X_[i] *= ((i+1)*10/n_classes)
X  = X_.reshape(-1, n_features)
y  = np.array([i for i in range(n_classes) for _ in range(n_trials)])

# Run the three different solvers on the same problem
solvers = ["svd", "lsqr", "eigen"]
coefs = {solver:LDA(solver=solver).fit(X,y).coef_ for solver in solvers}

# Compare the coefficients by computing the norms of their differences.
print(f"|EIGEN coef_ - LSQR coef_ | = {np.linalg.norm(coefs['eigen'] - coefs['lsqr'])}")
print(f"|  SVD coef_ - LSQR coef_ | = {np.linalg.norm(coefs['svd']   - coefs['lsqr'])}")
```


### Expected Results

Computing the norm of the difference between the coefficients computed by each method, we **should** see  that the `eigen` and `lsqr` methods agree with each other and with `svd`.

```
|EIGEN coef_ - LSQR coef_ | = 1e-14 # small number
|  SVD coef_ - LSQR coef_ | = 1e-14 # small number
```

### Actual Results

Computing the norm of the difference between the coefficients computed by each method, we **actually** see that the `eigen` and `lsqr` methods agree with each other but **disagree** with `svd`.

```
|EIGEN coef_ - LSQR coef_ | = 1.2895407125794645e-14
|  SVD coef_ - LSQR coef_ | = 0.6328175709616005
```

### Versions

```shell
System:
    python: 3.8.5 (default, Sep  4 2020, 02:22:02)  [Clang 10.0.0 ]
executable: /Users/stootoon/anaconda3/envs/amblr_py38/bin/python
   machine: macOS-10.14.6-x86_64-i386-64bit

Python dependencies:
      sklearn: 1.2.1
          pip: 20.2.4
   setuptools: 50.3.0.post20201006
        numpy: 1.24.2
        scipy: 1.10.1
       Cython: 0.29.21
       pandas: 1.5.0
   matplotlib: 3.3.2
       joblib: 1.2.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/stootoon/anaconda3/envs/amblr_py38/lib/python3.8/site-packages/numpy/.dylibs/libopenblas64_.0.dylib
        version: 0.3.21
threading_layer: pthreads
   architecture: Haswell
    num_threads: 4

       user_api: openmp
   internal_api: openmp
         prefix: libomp
       filepath: /Users/stootoon/anaconda3/envs/amblr_py38/lib/python3.8/site-packages/sklearn/.dylibs/libomp.dylib
        version: None
    num_threads: 8

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /Users/stootoon/anaconda3/envs/amblr_py38/lib/python3.8/site-packages/scipy/.dylibs/libopenblas.0.dylib
        version: 0.3.18
threading_layer: pthreads
   architecture: Haswell
    num_threads: 4
```

COMMENT:
I just realized that the LDA docs assume all classes share the same covariance matrix, so it's not necessarily surprising that their answers will differ when the class covariances are different, as in my example above. The answers also differ when I sample all classes from the same distribution, but the differences there are much smaller and perhaps due to numerical errors in estimating covariance matrices etc. So I will close this issue for now.

Labels: Bug, Needs Triage