コード例 #1
0
#   ['system_call_20gram_feats'],\
#   ['system_call_8gram_feats','system_call_10gram_feats'],\
#   ['system_call_5gram_feats', 'system_call_8gram_feats', 'system_call_10gram_feats'],\
# ]

# other dumb feature functions
ff_combos = [['dlls_loaded_feats'],['registry_keys_feats'],['system_call_8gram_feats'],['system_call_8gram_feats','dlls_loaded_feats'],['system_call_8gram_feats','registry_keys_feats']]


for ffs in ff_combos:
  value = ffs
  print 
  print "################################################################################"
  print "Feature functions: " + str(value)

  params['ffs'] = ffs
  results = classif.mainTestIter(0, params)

  if(isinstance(value, list)):
    value = tuple(value)
  outputs[value] = results

print "\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%"
import pprint
pp = pprint.PrettyPrinter(indent=4)


print "Results:"
print outputs
print 
pp.pprint(outputs)
コード例 #2
0
#   ['system_call_8gram_feats','system_call_10gram_feats'],\
#   ['system_call_5gram_feats', 'system_call_8gram_feats', 'system_call_10gram_feats'],\
# ]

# other dumb feature functions
ff_combos = [['dlls_loaded_feats'], ['registry_keys_feats'],
             ['system_call_8gram_feats'],
             ['system_call_8gram_feats', 'dlls_loaded_feats'],
             ['system_call_8gram_feats', 'registry_keys_feats']]

for ffs in ff_combos:
    value = ffs
    print
    print "################################################################################"
    print "Feature functions: " + str(value)

    params['ffs'] = ffs
    results = classif.mainTestIter(0, params)

    if (isinstance(value, list)):
        value = tuple(value)
    outputs[value] = results

print "\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%\%"
import pprint
pp = pprint.PrettyPrinter(indent=4)

print "Results:"
print outputs
print
pp.pprint(outputs)
コード例 #3
0


"""params = {'load': None,
          'extractFile': 'Output/extractFile',
          'extractTestFile': 'Output/extractTestFile',
          'splitFile': 'Output/splitFile',
          'writePredict': True,
          # 'outputFile': 'Output/predict_oneVRest_3grams.csv',
          'splitMethod': 0,
          'options':{ },
          'option':'mode',
          'range':['oneVOne','oneVRest','decisionTree']
}"""

params = {'load': 'split',
          'extractFile': 'Output/extractFile_2grams',
          'extractTestFile': 'Output/extractTestFile',
          'splitFile': 'Output/split_bigrams_counts_withhold0',
          'writePredict': False,
          'outputFile': 'Output/predict_oneVRest_2grams.csv',
          'splitMethod': 0,
          'options':{
          },
          'option':'mode',
          'range':['logRegress']

}

classif.mainTestIter(0, params)
コード例 #4
0
"""value of splitMethod (used for consistent testing):
0: random
1: last 'withhold' are withheld
2: first 'withhold' are withheld"""
"""params = {'load': None,
          'extractFile': 'Output/extractFile',
          'extractTestFile': 'Output/extractTestFile',
          'splitFile': 'Output/splitFile',
          'writePredict': True,
          # 'outputFile': 'Output/predict_oneVRest_3grams.csv',
          'splitMethod': 0,
          'options':{ },
          'option':'mode',
          'range':['oneVOne','oneVRest','decisionTree']
}"""

params = {
    'load': 'split',
    'extractFile': 'Output/extractFile_2grams',
    'extractTestFile': 'Output/extractTestFile',
    'splitFile': 'Output/split_bigrams_counts_withhold0',
    'writePredict': False,
    'outputFile': 'Output/predict_oneVRest_2grams.csv',
    'splitMethod': 0,
    'options': {},
    'option': 'mode',
    'range': ['logRegress']
}

classif.mainTestIter(0, params)