## models.Gam


A generalized additive model: a [Glm](models.Glm.md#prospicio.models.Glm) plus P-spline smooths of


Usage


``` python
models.Gam()
```


numeric design columns, with smoothing chosen by GCV or UBRE.


## Parameters


`glm: Glm`  
Family, link and dispersion.

`smooths: list of str or (str, int)`  
The design columns to smooth, optionally with the number of basis functions (10 by default).

`smoothing: str or list of float = ``"auto"`  
`"auto"` (UBRE for a fixed dispersion, GCV otherwise), `"gcv"`, `"ubre"`, or fixed smoothing parameters, one per smooth.


## Examples

``` python
>>> import math
>>> from prospicio.models import Design, Gam, Glm
>>> x = [i / 99 for i in range(100)]
>>> y = [math.sin(6 * v) for v in x]
>>> d = Design([[1.0] * 100, x], ["(Intercept)", "x"])
>>> fit = Gam(Glm("gaussian"), ["x"]).fit(d, y)
>>> abs(fit.predict(d)[50] - y[50]) < 0.01
```

True


## Methods

| Name | Description |
|----|----|
| [fit()](#fit) | Fits the model. |

------------------------------------------------------------------------


#### fit()


Fits the model.


Usage


``` python
fit(design, y)
```


##### Parameters


`design: Design`  
Includes the raw columns to smooth.

`y: list of float`  


##### Returns


`GamFit`
