neuraltrain.models.constant_predictor.ConstantPredictor

class neuraltrain.models.constant_predictor.ConstantPredictor(*, mode: Literal['most_frequent', 'most_frequent_multilabel', 'mean', 'auto'] = 'auto')[source][source]

Constant predictor that predicts the most frequent class or the mean of the targets.

Parameters:

mode (tp.Literal["most_frequent", "most_frequent_multilabel", "mean", "auto"]) –

Mode to use for obtaining the constant from the targets. Options: - “most_frequent”: Predicts the most frequent class (for single-label classification). - “most_frequent_multilabel”: Predicts the most frequent value for each class independently

(for multilabel classification where multiple classes can be active simultaneously).

  • ”mean”: Predicts the mean of the targets (for regression).

  • ”auto”: Automatically determines the mode based on the dtype and shape of the targets.