CANN - Combined Actuarial Neural Network¶
Advanced neural network architecture designed specifically for actuarial and insurance applications.
Class Definition¶
Bases: BaseModel
The Combined Actuarial Neural Network (CANN) model adaptable for both gamma and Gaussian GLMs.
Functions¶
__init__(baseline, num_hidden_layers=2, hidden_size=50, dropout_rate=0.2, train_glm=False, learning_rate=0.001)
¶
Args: baseline_model: the baseline model to use (GLM or Constant) num_hidden_layers: the number of hidden layers in the neural network hidden_size: the number of neurons in each hidden layer train_glm: whether to retrain the baseline model or not
forward(x)
¶
Calculate the predicted outputs for the distributions. Args: x: the input features (shape: (n, p)) Returns: the predicted outputs (shape: (n,))
mean(x)
¶
Calculate the predicted means for the given observations, specific to the model type.