What are the coefficients returned by Polynomial Ridge Regression (or any regression)?

### Describe the issue linked to the documentation

I asked and answered a question about Regression in [Stack Overflow](https://stackoverflow.com/questions/79691953/ridge-polynomial-regression-how-to-get-parameters-for-equation-found).  Here is a summary and question.

I ran several regressions using pipeline and gridsearch.  The winning regression was polynomial ridge regression.  What I then wanted to do was extract the coefficients of the successful regression so I could pass them on for an implementation that uses just python (no libraries) and Java (no libraries).  That was not straightforward.

I eventually found the coefficients under `steps` after someone pointed that out.  Even the answers I got on Google indicated they were under the attribute `coef` but I couldn't find them though I thought I had read the docs sufficiently.

As explained at the link above, I expected coefficients for an equation: `a + bx + cx^2 + dx^3`.  If I looked at the coefficients under the attribute `coef_` I got: `[ 0.00000000e+00  9.17291774e-01 -4.25186367e-09  9.06355625e-18]`, from which I assumed that meant that `a=0`,` b=9.17291774e-01`, etc.  It turned out that was only partially true, `b-d` are correct but `a` is not.  `a` is actually the interecept which is another attribute `intercept_`.  At least, that is how I got things to work (code below for an example)

Question:  what is the first element in the coefficients from Polynomial Ridge Regression or have I completely misunderstood?

```
import pandas as pd
import warnings

# regression libs
from sklearn.pipeline import make_pipeline
from sklearn.linear_model import Ridge
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import PolynomialFeatures

# useful initializations
warnings.filterwarnings('ignore')

p = [0, 10, -20, .30]

# Create fake data using the preceding coefficients with some noise
def regr_noise(x, p):
    mu = np.random.uniform(0,50E6)
    return (p[0] + p[1]*x + p[2]*x**2 + p[3]*x**3 + mu)

x = range(0,1000, 50)
df_fake = pd.DataFrame({'x':x})
df_fake['y'] = df_fake['x'].apply(lambda x: regr_noise(x, p))

# polynomial ridge regression
x = df_fake[['x']]
y = df_fake[['y']]

ridge_reg_poly = make_pipeline(PolynomialFeatures(degree=3),Ridge(alpha=0, solver="cholesky"))
temp = ridge_reg_poly.fit(x,y)
yp = temp.predict(x)

# get the coefficients and reproduce the results
p_found = ridge_reg_poly.steps[1][1].coef_
p_interc = ridge_reg_poly.steps[1][1].intercept_
print('coeff:',p_found,'\nintercep:' ,p_interc)

def regr_clean(x, p):
    return (p[0] + p[1]*x + p[2]*x**2 + p[3]*x**3 + p_interc)

y_fmcoef = regr_clean(x, p_found).rename(columns={'x':'y'})

Will get a column of zeros b/c same results as sklearn
yp - y_fmcoef.y
```

### Suggest a potential alternative/fix

Clear statements:

1. coefficients are produced and available
2. what the coefficients are, their relationship to an equation
3. how to use them in an equation

COMMENT:
Yes, I meant the [API docs](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html).  So here is the confusion:   given an equation `a + bx + cx^2` the docs imply the coefficients are `b` and `c` and the intercept is `a`; separate items.  Except that by default in that case `coef_` would return [0.0 , b, c] (_3_ elements including one where you would expect the intercept to be) and `interecept_` would return `a`.  

So `coef_` _is_ returning a value for the intercept but it defaults to 0.0 if `fit_intercept` is True.  But the docs direct:
```
fit_interceptbool, default=True
Whether to fit the intercept for this model. If set to false, no intercept will be used in calculations (i.e. X and y are expected to be centered).
```
Given that, I would expect the first element of `coef_ ` to be the intercept, which it isn't.   I'm guessing that if I set `fit_interceptbool` to False, then the first element of `coef_` will still be 0.0.  It's counterintuitive.

Labels: Documentation