MCPcopy Create free account
hub / github.com/bobolike123/NetworkTrafficAnalysis / readTotalFileNum

Method readTotalFileNum

Classification.py:208–235  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206 '''
207
208 def readTotalFileNum(self):
209 tcount = 0
210 vcount = 0
211
212 num_in_each_class = 0
213 tarray = []
214 varray = []
215 for root, dirs, files in os.walk(self.train_data_dir):
216 for each in files:
217 num_in_each_class += 1
218 tcount += 1
219 tarray.append(num_in_each_class)
220 num_in_each_class = 0
221 print('t_count:', tcount)
222 tarray = tarray[1:]
223 print(tarray)
224
225 for root, dirs, files in os.walk(self.validation_data_dir):
226 for each in files:
227 num_in_each_class += 1
228 vcount += 1
229 varray.append(num_in_each_class)
230 num_in_each_class = 0
231 print('v_count:', vcount)
232 varray = varray[1:]
233 print(varray)
234
235 return (tcount, vcount, tarray, varray)
236
237 def createTrainLabels(self, train_sample_distribution):
238 tlist = []

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected