Deviance#
- class pygam.callbacks.Deviance[source]#
Bases:
CallBackDeviance CallBack class
Useful for capturing the Deviance of a model on training data at each iteration
- Parameters:
Methods
get_params([deep])Returns a dict of all of the object's user-facing parameters.
on_loop_start(gam, y, mu)Runs the method at loop start.
set_params([deep, force])Sets an object's parameters.
- get_params(deep=False)[source]#
Returns a dict of all of the object’s user-facing parameters.
- Parameters:
- deepboolean, default: False
when True, also gets non-user-facing parameters
- Returns:
- dict
- on_loop_start(gam, y, mu)[source]#
Runs the method at loop start.
- Parameters:
- gamGAM instance
- yarray-like of length n
target data
- muarray-like of length n
expected value data
- Returns:
- deviancenp.array of length n
- set_params(deep=False, force=False, **parameters)[source]#
Sets an object’s parameters.
- Parameters:
- deepboolean, default: False
when True, also sets non-user-facing parameters
- forceboolean, default: False
when True, also sets parameters that the object does not already have
- **parametersparameters to set
- Returns:
- self