gbnet.base

Classes

BaseGBModule

Base class for gradient boosting modules.

Module Contents

class gbnet.base.BaseGBModule(min_hess=0.0)[source]

Bases: torch.nn.Module, abc.ABC

Base class for gradient boosting modules.

This abstract base class defines the common interface and functionality that all gradient boosting modules should implement.

Variables:

min_hess (float) – minimum hessian value

min_hess = 0.0[source]
grad = None[source]
hess = None[source]
abstractmethod _input_checking_setting(input_data)[source]

Validate and prepare input data.

Parameters:

input_data – Input data in model-specific format

Returns:

Processed input data ready for model

abstractmethod forward(input_data, return_tensor=True)[source]

Forward pass through the model.

Parameters:
  • input_data – Input data in model-specific format

  • return_tensor (bool) – Whether to return predictions as PyTorch tensor

Returns:

Model predictions as tensor or numpy array

_get_grad_hess_FX()[source]
abstractmethod gb_step()[source]

Perform one gradient boosting step.

This method should implement the logic for: 1. Getting gradients/hessians 2. Training one boosting iteration 3. Updating predictions