Regressor Base Class

The user-facing Regressors chapter documents the concrete regressor classes (M_KRR, M_BLR). The base class below is the API hook shared by every regressor.

class M_Core

Abstract base class for model cores.

Provides common functionality and interface for model implementations, including training status and weight management.

Subclassed by tadah::models::M_BLR_Core< Function_Base & >, tadah::models::M_KRR_Core< Function_Base & >, tadah::mlip::M_Tadah_Base, tadah::models::M_BLR_Core< BF >, tadah::models::M_KRR_Core< K >

Public Functions

inline virtual ~M_Core()

Virtual destructor for polymorphic deletion.

inline bool is_trained() const

Checks if the model has been trained.

Returns:

True if the model is trained, otherwise false.

inline void reset_trained()

Reset trained state so the model can be re-trained in-place.

inline const tadah::core::t_type &get_weights() const

Retrieves the weights of the model.

Returns:

Constant reference to the weights vector.

inline void set_weights(const tadah::core::t_type w)

Sets the model weights.

Parameters:

w – New weights vector to be set.

virtual double predict(const tadah::core::aed_type &v) const = 0

Pure virtual function for making predictions.

Must be implemented by derived classes.

Parameters:

v – Input vector for prediction.

Returns:

Predicted value.

virtual tadah::core::t_type get_weights_uncertainty() const = 0

Pure virtual function to get weights’ uncertainty.

Must be implemented by derived classes.

Returns:

Vector of uncertainties for the weights.

Public Members

int verbose = 0

Verbose level for logging.

bool trained = false

Indicates if the model has been trained.

tadah::core::t_type weights

Weights vector for the model.