def use_kernel(self): """ kernel_option=0: gaussian kernel kernel_option=1: polynomial kernel Otherwise: linear kernel """ n = self.data_.shape[0] K = np.empty([n,n]) for i in xrange(n): for j in xrange(n): K[i,j] = kernels.ker(self.data_[i,0:-1], self.data_[j,0:-1], self.kernel_option_) # W, V = MDS.find_coordinates(K) # print "W" # print W # print "V" # print V return K
def use_kernel(self): """ kernel_option=0: gaussian kernel kernel_option=1: polynomial kernel Otherwise: linear kernel """ n = self.data_.shape[0] K = np.empty([n, n]) for i in xrange(n): for j in xrange(n): K[i, j] = kernels.ker(self.data_[i, 0:-1], self.data_[j, 0:-1], self.kernel_option_) # W, V = MDS.find_coordinates(K) # print "W" # print W # print "V" # print V return K
def kernel(self, x1, x2): return kernels.ker(x1, x2, self.kernel_option_)