models.base_score()
The constant link-scale score a booster starts from:
Usage
models.base_score(
link,
y,
weights,
offset,
)log(sum(w y) / sum(w exp(offset))) for a log link (the weighted total must be positive), sum(w (y - offset)) / sum(w) for an identity link.
Parameters
link: (log, identity) = "log"y: list of floatweights: list of floatoffset: list of float
Returns
float
Examples
>>> from prospicio.models import base_score
>>> base_score("identity", [1.0, 3.0], [1.0, 1.0], [0.0, 0.0])2.0