caliber.binary_classification.minimizing.linear_scaling.calibration.asce_linear_scaling - caliber

Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# Source code for caliber.binary_classification.minimizing.linear_scaling.calibration.asce_linear_scaling

    from typing import Optional

    from caliber.binary_classification.metrics.asce import average_squared_calibration_error
    from caliber.binary_classification.minimizing.linear_scaling.calibration.base import (
        CalibrationLinearScalingBinaryClassificationModel,
    )
    from caliber.binary_classification.minimizing.linear_scaling.mixins.fit.brute_fit import (
        LinearScalingBruteFitBinaryClassificationMixin,
    )

    class ASCELinearScalingBinaryClassificationModel(
        LinearScalingBruteFitBinaryClassificationMixin,
        CalibrationLinearScalingBinaryClassificationModel,
    ):
        def __init__(
            self,
            minimize_options: Optional[dict] = None,
            lam: float = 0.01,
            has_intercept: bool = True,
            has_bivariate_slope: bool = False,
        ):
            super().__init__(
                loss_fn=average_squared_calibration_error,
                minimize_options=minimize_options,
                has_intercept=has_intercept,
                has_bivariate_slope=has_bivariate_slope,
            )
            self._lam = lam