#!/usr/bin/python3 import sys import Vector import sample import nearestneighbors # test classifications on a pickled file of samples and denoting active features with # sample codes, ex: high.total_packets # Usage: main.py pickled_sample_file high.total_packets high.time_spent... def main(): i = 0 sampleList = Vector.readPickledData(sys.argv[1]) featureList = [] for s in sampleList: featureList.append(Vector.FeatureVector(s)) activeFeatureStrings = [] for i in range(2, len(sys.argv)): activeFeatureStrings.append(sys.argv[i]) for f in featureList: f.set_features(activeFeatureStrings) # perform classification on f here nearestneighbors.kNearestNeighbors() if __name__ == '__main__': main()