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
def querySVM(self,headline): testX=feature.constructRealFea(headline) return self.SVM.predict(testX)
def queryRFSK(self,headline): testX=feature.constructRealFea(headline) return self.RFSklearn.predict(testX)
def queryMLP(self,headline): testX=feature.constructRealFea(headline) return self.MLP.predict(testX)
def queryRF(self,headline): testX=feature.constructRealFea(headline) return self.RF.query(testX)