'Compute the covariance matrix needed for calculating distances.
Args:
data: The dataset used for calculating covariances.
axis: If axis=1 we calculate distances between rows, if axis=0 we
calculate distances between columns.'

def fit(self, data, axis=1):

    x = _orange_to_numpy(data)
    if (axis == 0):
        x = x.T
    self.axis = axis
    try:
        c = np.cov(x.T)
    except:
        raise MemoryError('Covariance    matrix    is    too    large.')
    try:
        self.VI = np.linalg.inv(c)
    except:
        raise ValueError('Computation    of    inverse    covariance    matrix    failed.')
