def transform(self,X):
    
     if self.tsupdate:
         Cr = riemann.mean_covariance(X,metric=self.metric)
     else:
         Cr = self.Cr
     return riemann.tangent_space(X,Cr)
Exemple #2
0
    def transform(self, X):

        if self.tsupdate:
            Cr = riemann.mean_covariance(X, metric=self.metric)
        else:
            Cr = self.Cr
        return riemann.tangent_space(X, Cr)
 def fit(self,X,y=None):
     C1 = riemann.mean_covariance(X[y==1,...],self.metric)
     C0 = riemann.mean_covariance(X[y==0,...],self.metric)
     
     Ne,_ = C0.shape
     
     self.subelec = range(0,Ne,1) 
     while (len(self.subelec)-2*self.nfilters)>self.nelec:
         di = numpy.zeros((len(self.subelec),1))
         for idx in range(2*self.nfilters,len(self.subelec)):
             sub = self.subelec[:]
             sub.pop(idx)
             di[idx] = riemann.distance(C0[:,sub][sub,:],C1[:,sub][sub,:])
         #print di
         torm = di.argmax()
         self.dist.append(di.max())
         self.subelec.pop(torm)        
Exemple #4
0
 def fit(self,X,y=None):
     C1 = riemann.mean_covariance(X[y==1,...],self.metric)
     C0 = riemann.mean_covariance(X[y==0,...],self.metric)
     
     Ne,_ = C0.shape
     
     self.subelec = list(range(0,Ne,1)) 
     while (len(self.subelec)-2*self.nfilters)>self.nelec:
         di = numpy.zeros((len(self.subelec),1))
         for idx in range(2*self.nfilters,len(self.subelec)):
             sub = self.subelec[:]
             sub.pop(idx)
             di[idx] = riemann.distance(C0[:,sub][sub,:],C1[:,sub][sub,:])
         #print di
         torm = di.argmax()
         self.dist.append(di.max())
         self.subelec.pop(torm)        
 def fit_transform(self,X,y=None):
     # compute mean covariance
     self.Cr = riemann.mean_covariance(X,metric=self.metric)
     return riemann.tangent_space(X,self.Cr)
 def fit(self,X,y=None):
     # compute mean covariance
     self.Cr = riemann.mean_covariance(X,metric=self.metric)
Exemple #7
0
 def fit_transform(self, X, y=None):
     # compute mean covariance
     self.Cr = riemann.mean_covariance(X, metric=self.metric)
     return riemann.tangent_space(X, self.Cr)
Exemple #8
0
 def fit(self, X, y=None):
     # compute mean covariance
     self.Cr = riemann.mean_covariance(X, metric=self.metric)