def latihh10(self): self.train10 = pd.DataFrame() eeays = [] #print('att',self.__atribut_terpilih) for i in self.__atribut_terpilih: #print('i',i) for j in self.latih10: #print('y',j) eeays.append(self.__dataset.iloc[j, i]) # dcc.at[i, dc.columns[i]] = 1 self.train10[self.__dataset.columns[i]] = eeays #print('ini', eeays) eeays = [] label = [] i = 0 while i < len(self.latih10): label.append(self.__dataset.loc[i, 'Classification']) i += 1 self.train10['Classification'] = label nb = nbb.Naivebayes(self.train10) dl = nb.latih() self.kfold10() du = nb.uji(self.fold10) return self.train10
def latihh1(self): self.train1 = pd.DataFrame() eeays = [] #print('att',self.__atribut_terpilih) for i in self.__atribut_terpilih: #print('i',i) for j in self.latih1: #print('y',j) eeays.append(self.__dataset.iloc[j, i]) # dcc.at[i, dc.columns[i]] = 1 self.train1[self.__dataset.columns[i]] = eeays #print('ini', eeays) eeays = [] label = [] i = 0 while i < len(self.latih1): label.append(self.__dataset.loc[i, 'Classification']) i += 1 self.train1['Classification'] = label #print('latih 1', self.train1) nb = nbb.Naivebayes(self.train1) dl = nb.latih() self.kfold() du = nb.uji(self.fold1) print('IA',du) #UI = ab.New_Toplevel() #UII = UI.config(1) #self.train1.to_excel(r'train11.xlsx', sheet_name='train 1') return self.train1