FukuML/ProbabilisticSVM.py
def svm_score(self, x):

        x = x[1:]

        '''
        original_X = self.svm_processor.train_X[:, 1:]
        score = 0
        for i in range(len(self.svm_processor.sv_alpha)):
            score += self.svm_processor.sv_alpha[i] * self.svm_processor.sv_Y[i] * utility.Kernel.gaussian_kernel(self, original_X[self.svm_processor.sv_index[i]], x)
        score = score + self.svm_processor.sv_avg_b
        '''

        score = np.sum(self.svm_processor.sv_alpha * self.svm_processor.sv_Y * utility.Kernel.kernel_matrix_xX(self, x, self.svm_processor.sv_X)) + self.svm_processor.sv_avg_b

        return score
def svm_score(self, x):

        x = x[1:]

        '''
        original_X = self.svm_processor.train_X[:, 1:]
        score = 0
        for i in range(len(self.svm_processor.sv_alpha)):
            score += self.svm_processor.sv_alpha[i] * self.svm_processor.sv_Y[i] * utility.Kernel.gaussian_kernel(self, original_X[self.svm_processor.sv_index[i]], x)
        score = score + self.svm_processor.sv_avg_b
        '''

        score = np.sum(self.svm_processor.sv_alpha * self.svm_processor.sv_Y * utility.Kernel.kernel_matrix_xX(self, x, self.svm_processor.sv_X)) + self.svm_processor.sv_avg_b

        return score
def svm_score ( self , x ) : x = x [ 1 : ] score = np . sum ( self . svm_processor . sv_alpha * self . svm_processor . sv_Y * utility . Kernel . kernel_matrix_xX ( self , x , self . svm_processor . sv_X ) ) + self . svm_processor . sv_avg_b return score
original_X = self.svm_processor.train_X[:, 1:]
        score = 0
        for i in range(len(self.svm_processor.sv_alpha)):
            score += self.svm_processor.sv_alpha[i] * self.svm_processor.sv_Y[i] * utility.Kernel.gaussian_kernel(self, original_X[self.svm_processor.sv_index[i]], x)
        score = score + self.svm_processor.sv_avg_b
original_X = self . svm_processor . train_X [ : 1 : ] score = 0 for i in range ( len ( self . svm_processor . sv_alpha )) : score + = self . svm_processor . sv_alpha [ i ] * self . svm_processor . sv_Y [ i ] * utility . Kernel . gaussian_kernel ( self original_X [ self . svm_processor . sv_index [ i ]] x ) score = score + self . svm_processor . sv_avg_b