"""
This module contains the JointCRepCrossValidation class, which is used for cross-validation of the
JointCRep algorithm.
"""

from ..models.jointcrep import JointCRep
from .cross_validation import CrossValidation


class JointCRepCrossValidation(CrossValidation):
    """
    Class for cross-validation of the JointCRep algorithm.
    """

    def __init__(
        self, algorithm, parameters, input_cv_params, numerical_parameters=None
    ):
        """
        Constructor for the JointCRepCrossValidation class.
        Parameters
        ----------
        algorithm
        parameters
        input_cv_params
        """
        super().__init__(algorithm, parameters, input_cv_params, numerical_parameters)
        # These are the parameters for the JointCRep algorithm
        self.parameters = parameters
        self.num_parameters = numerical_parameters
        self.model = JointCRep

    def extract_mask(self, fold):
        # Use the auxiliary method from the base class
        return super()._extract_mask(fold)

    def calculate_performance_and_prepare_comparison(
        self, outputs, mask, fold, algorithm_object
    ):
        return super()._calculate_performance_and_prepare_comparison(
            outputs, mask, fold, algorithm_object
        )
