Beispiel #1
0
    def sivmselect(self):
        sivmmdl = SIVM(self.data, num_bases=self._nsub, compute_w=True, compute_h=False, dist_measure='cosine')

        sivmmdl.initialization()    
        sivmmdl.factorize()
        idx = sivmmdl.select
        return idx
Beispiel #2
0
 def sample(self, A, c):
     # for optimizing the volume of the submatrix, set init to 'origin' (otherwise the volume of
     # the ordinary simplex would be optimized) 
     sivm_mdl = SIVM(A, num_bases=c, dist_measure=self._dist_measure,  
                         init=self.init)                        
     sivm_mdl.factorize(show_progress=False, compute_w=True, niter=1,
                        compute_h=False, compute_err=False)
     
     return sivm_mdl.select    
Beispiel #3
0
 def sample(self, A, c):
     # for optimizing the volume of the submatrix, set init to 'origin' (otherwise the volume of
     # the ordinary simplex would be optimized) 
     sivm_mdl = SIVM(A, num_bases=c, dist_measure=self._dist_measure,  
                         init=self.init)                        
     sivm_mdl.factorize(show_progress=False, compute_w=True, niter=1,
                        compute_h=False, compute_err=False)
     
     return sivm_mdl.select    
Beispiel #4
0
	def __init__(self, data_1, data_2, lambd=0.5, num_bases=4, niter=100, show_progress=False, compH=True, compW=True):
		
		# generate a new data set data using a weighted
		# combination of data_1 and data_2
		
		self._data_1 = data_1
		self._data_2 = data_2
		self._lambd = lambd
		
		data = np.concatenate((lambd*self._data_1, (1.0-lambd)* self._data_2), axis=0)		
		SIVM.__init__(self, data, num_bases=num_bases, niter=niter, show_progress=show_progress, compW=compW)
Beispiel #5
0
    def sivmselect(self):
        sivmmdl = SIVM(self.data, num_bases=self._nsub, compute_w=True, compute_h=False, dist_measure='cosine')

        sivmmdl.initialization()    
        sivmmdl.factorize()
        idx = sivmmdl.select
        return idx