Example #1
0
    def query(self, headline):
        '''

        :param headline: string, the headline to classify
        :return: 0/1: 0 - fake, 1 - real
        '''
        testX = feature.constructRealFea(headline)
        resRF = self.RF.query(testX)
        resRFSK = self.RFSklearn.predict(testX)
        resDT = self.DT.predict(testX)
        resSVM = self.SVM.predict(testX)
        resMLP = self.MLP.predict(testX)
        res = resRF + resRFSK + resDT + resSVM + resMLP
        if res > 2.5:
            return 1
        else:
            return 0
Example #2
0
 def querySVM(self,headline):
     testX=feature.constructRealFea(headline)
     return self.SVM.predict(testX)
Example #3
0
 def queryRFSK(self,headline):
     testX=feature.constructRealFea(headline)
     return self.RFSklearn.predict(testX)
Example #4
0
 def queryMLP(self,headline):
     testX=feature.constructRealFea(headline)
     return self.MLP.predict(testX)
Example #5
0
 def queryRF(self,headline):
     testX=feature.constructRealFea(headline)
     return self.RF.query(testX)