## models.TargetEncoding


The encoding of each level of a factor learned from all the training


Usage

``` python
models.TargetEncoding()
```


rows, from [target_encode](models.target_encode.md#prospicio.models.target_encode).


## Attributes

| Name | Description |
|----|----|
| [k](#k) | The credibility constant `K`. |
| [levels](#levels) | The levels seen in training, sorted. |
| [ratios](#ratios) | Each level's credibility-weighted actual-to-expected ratio. |

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


#### k


The credibility constant `K`.


`k: float`


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


#### levels


The levels seen in training, sorted.


`levels: list[str]`


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


#### ratios


Each level's credibility-weighted actual-to-expected ratio.


`ratios: list[float]`


## Methods

| Name | Description |
|----|----|
| [encode()](#encode) | The encoding of each value of new data; a level not seen in |

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


#### encode()


The encoding of each value of new data; a level not seen in


Usage

``` python
encode(values)
```


training gets 1.


##### Parameters


`values: list of str`  


##### Returns


`list of float`
