예제 #1
0
			if finished == True:
				break
			path = os.path.join(basepath, files)
			if os.path.isdir(path):
				for logFile in os.listdir(path):
					if limit == 0:
						finished = True
						break

					with open(os.path.join(path,logFile), 'r') as h:					
						lines = h.readlines()
						for line in lines:
							if line:
								feature = [features.durationLessThanMinute(line)]
								feature.extend([features.durationOneToFive(line)])
								feature.extend([features.durationFiveOrMore(line)])
								feature.extend([features.device(line)])
								feature.extend(features.ipFeature(line))
								feature.extend(features.timeStartFeature(line))
								feature.extend(features.timeEndFeature(line))

								arrayOfFeatures.append(feature)

					
					limit -= 1
					print "limit: ", limit

	nparray = np.array(arrayOfFeatures)
	print nparray.shape
	row, col = nparray.shape
예제 #2
0
 def feature3(self):
     if features.durationFiveOrMore(self.line):
         return 1
     else:
         return 0