(self, e1, e2=None)
If e2 is omitted, calculate distances between all rows (axis=1) or
        columns (axis=2) of e1. If e2 is present, calculate distances between
        all pairs if rows from e1 and e2.

        This method converts the data into numpy arrays, calls the method
        `compute_data` and packs the result into `DistMatrix`. Subclasses are
        expected to define the `compute_data` and not the `__call__` method.

        Args:
            e1 (Orange.data.Table or Orange.data.Instance or numpy.ndarray):
                input data
            e2 (Orange.data.Table or Orange.data.Instance or numpy.ndarray):
                secondary data

        Returns:
            A distance matrix (Orange.misc.distmatrix.DistMatrix)
If e2 is omitted, calculate distances between all rows (axis=1) or
        columns (axis=2) of e1. If e2 is present, calculate distances between
        all pairs if rows from e1 and e2.
If e2 is omitted calculate distances between all rows ( axis = 1 ) or columns ( axis = 2 ) of e1 . If e2 is present calculate distances between all pairs if rows from e1 and e2 .
def __call__(self, e1, e2=None):
        """
        If e2 is omitted, calculate distances between all rows (axis=1) or
        columns (axis=2) of e1. If e2 is present, calculate distances between
        all pairs if rows from e1 and e2.

        This method converts the data into numpy arrays, calls the method
        `compute_data` and packs the result into `DistMatrix`. Subclasses are
        expected to define the `compute_data` and not the `__call__` method.

        Args:
            e1 (Orange.data.Table or Orange.data.Instance or numpy.ndarray):
                input data
            e2 (Orange.data.Table or Orange.data.Instance or numpy.ndarray):
                secondary data

        Returns:
            A distance matrix (Orange.misc.distmatrix.DistMatrix)
        """
        if self.axis == 0 and e2 is not None:
            # Backward compatibility fix
            if e2 is e1:
                e2 = None
            else:
                raise ValueError("Two tables cannot be compared by columns")

        x1 = _orange_to_numpy(e1)
        x2 = _orange_to_numpy(e2)
        with np.errstate(invalid="ignore"):  # nans are handled below
            dist = self.compute_distances(x1, x2)
            if self.impute and np.isnan(dist).any():
                dist = np.nan_to_num(dist)
            if isinstance(e1, (Table, RowInstance)):
                dist = DistMatrix(dist, e1, e2, self.axis)
            else:
                dist = DistMatrix(dist)
            return dist
def __call__ ( self , e1 , e2 = None ) : if self . axis == 0 and e2 is not None : # Backward compatibility fix if e2 is e1 : e2 = None else : raise ValueError ( "Two tables cannot be compared by columns" ) x1 = _orange_to_numpy ( e1 ) x2 = _orange_to_numpy ( e2 ) with np . errstate ( invalid = "ignore" ) : # nans are handled below dist = self . compute_distances ( x1 , x2 ) if self . impute and np . isnan ( dist ) . any ( ) : dist = np . nan_to_num ( dist ) if isinstance ( e1 , ( Table , RowInstance ) ) : dist = DistMatrix ( dist , e1 , e2 , self . axis ) else : dist = DistMatrix ( dist ) return dist