(self, data)
return MahalanobisModel(self.axis, self.impute, vi)
Return a model with stored inverse covariance matrix
Return a model with stored inverse covariance matrix
Return a model with stored inverse covariance matrix
def fit(self, data):
        """Return a model with stored inverse covariance matrix"""
        x = _orange_to_numpy(data)
        if self.axis == 0:
            x = x.T
        try:
            c = np.cov(x.T)
        except:
            raise MemoryError("Covariance matrix is too large.")
        try:
            vi = np.linalg.inv(c)
        except:
            raise ValueError("Computation of inverse covariance matrix failed.")
        return MahalanobisModel(self.axis, self.impute, vi)
def fit ( self , data ) : x = _orange_to_numpy ( data ) if self . axis == 0 : x = x . T try : c = np . cov ( x . T ) except : raise MemoryError ( "Covariance matrix is too large." ) try : vi = np . linalg . inv ( c ) except : raise ValueError ( "Computation of inverse covariance matrix failed." ) return MahalanobisModel ( self . axis , self . impute , vi )