def transform(self, x, y, metric="mean", metric_special=0,
                  metric_missing=0, show_digits=2, check_input=False):
        """Transform given data to mean using bins from the fitted optimal
        binning 2D.

        Parameters
        ----------
        x : array-like, shape = (n_samples,)
            Training vector x, where n_samples is the number of samples.

        y : array-like, shape = (n_samples,)
            Training vector y, where n_samples is the number of samples.

        metric : str (default="mean")
            The metric used to transform the input vector. Supported metrics
            are "mean" to choose the mean, "indices" to assign the
            corresponding indices of the bins and "bins" to assign the
            corresponding bin interval.

        metric_special : float or str (default=0)
            The metric value to transform special codes in the input vector.
            Supported metrics are "empirical" to use the empirical WoE or
            event rate and any numerical value.

        metric_missing : float or str (default=0)
            The metric value to transform missing values in the input vector.
            Supported metrics are "empirical" to use the empirical WoE or
            event rate and any numerical value.

        show_digits : int, optional (default=2)
            The number of significant digits of the bin column. Applies when
            ``metric="bins"``.

        check_input : bool (default=False)
            Whether to check input arrays.

        Returns
        -------
        z_new : numpy array, shape = (n_samples,)
            Transformed array.
        """
        self._check_is_fitted()

        return transform_continuous_target(
            self.dtype_x, self.dtype_y, self._splits_x_optimal,
            self._splits_y_optimal, x, y, self._n_records, self._sums,
            self.special_codes_x, self.special_codes_y, self._categories_x,
            self._categories_y, metric, metric_special, metric_missing,
            show_digits, check_input)
Transform given data to mean using bins from the fitted optimal
        binning 2D.

        Parameters
        ----------
        x : array-like, shape = (n_samples,)
            Training vector x, where n_samples is the number of samples.

        y : array-like, shape = (n_samples,)
            Training vector y, where n_samples is the number of samples.

        metric : str (default="mean")
            The metric used to transform the input vector. Supported metrics
            are "mean" to choose the mean, "indices" to assign the
            corresponding indices of the bins and "bins" to assign the
            corresponding bin interval.

        metric_special : float or str (default=0)
            The metric value to transform special codes in the input vector.
            Supported metrics are "empirical" to use the empirical WoE or
            event rate and any numerical value.

        metric_missing : float or str (default=0)
            The metric value to transform missing values in the input vector.
            Supported metrics are "empirical" to use the empirical WoE or
            event rate and any numerical value.

        show_digits : int, optional (default=2)
            The number of significant digits of the bin column. Applies when
            ``metric="bins"``.

        check_input : bool (default=False)
            Whether to check input arrays.

        Returns
        -------
        z_new : numpy array, shape = (n_samples,)
            Transformed array.
        
optbinning/binning/multidimensional/continuous_binning_2d.py