Пример #1
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Clustering of the data for data exploration.')
     ExpConf.generateParser(parser)
     AnnotationsConf.generateParser(
         parser,
         message='CSV file containing the annotations of some '
         'instances. These annotations are used for '
         'semi-supervised projections.')
     parser.add_argument(
         '--label',
         choices=['all', 'malicious', 'benign'],
         default='all',
         help='The clustering is built from all the instances in the '
         'dataset, or only from the benign or malicious ones. '
         'By default, the clustering is built from all the '
         'instances. The malicious and benign instances are '
         'selected according to the ground-truth stored in '
         'annotations/ground_truth.csv.')
     subparsers = parser.add_subparsers(dest='algo')
     subparsers.required = True
     factory = ClusteringConfFactory.getFactory()
     for algo in factory.getMethods():
         algo_parser = subparsers.add_parser(algo)
         factory.generateParser(algo, algo_parser)
     return parser
Пример #2
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Learn a detection model. '
         'The ground-truth must be stored in '
         'annotations/ground_truth.csv.')
     ExpConf.generateParser(parser)
     CoreClassificationConf.generateParser(parser)
     models = [
         'LogisticRegression', 'Svc', 'GaussianNaiveBayes', 'DecisionTree',
         'RandomForest', 'GradientBoosting'
     ]
     subparsers = parser.add_subparsers(dest='model_class')
     subparsers.required = True
     factory = ClassifierConfFactory.getFactory()
     for model in models:
         model_parser = subparsers.add_parser(model)
         factory.generateParser(model, model_parser)
         AnnotationsConf.generateParser(
             model_parser,
             required=True,
             message='CSV file containing the annotations of some '
             'or all the instances.')
     ## Add subparser for already trained model
     already_trained = subparsers.add_parser('AlreadyTrained')
     factory.generateParser('AlreadyTrained', already_trained)
     return parser
Пример #3
0
 def generateParser():
     parser = argparse.ArgumentParser(description='Features Analysis')
     ExpConf.generateParser(parser, filters=False)
     AnnotationsConf.generateParser(parser,
                 required=True,
                 message='CSV file containing the annotations of some or all'
                         ' the instances.')
     return parser
Пример #4
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Rare Category Detection',
         formatter_class=argparse.RawTextHelpFormatter)
     ExpConf.generateParser(parser)
     AnnotationsConf.generateParser(
         parser,
         default='init_annotations.csv',
         required=False,
         message='CSV file containing the initial annotations '
         'used to learn the first supervised detection '
         'model.')
     factory = ActiveLearningConfFactory.getFactory()
     factory.generateParser('RareCategoryDetection', parser)
     return parser
Пример #5
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Projection of the data for data visualization.')
     ExpConf.generateParser(parser)
     AnnotationsConf.generateParser(
         parser,
         message='CSV file containing the annotations of some'
         ' instances. These annotations are used for '
         'semi-supervised projections.')
     algos = ['Pca', 'Rca', 'Lda', 'Lmnn', 'Nca', 'Itml']
     subparsers = parser.add_subparsers(dest='algo')
     subparsers.required = True
     factory = ProjectionConfFactory.getFactory()
     for algo in algos:
         algo_parser = subparsers.add_parser(algo)
         factory.generateParser(algo, algo_parser)
     return parser
Пример #6
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Active Learning',
         formatter_class=argparse.RawTextHelpFormatter)
     ExpConf.generateParser(parser)
     AnnotationsConf.generateParser(
         parser,
         default='init_annotations.csv',
         required=False,
         message='CSV file containing the initial annotations '
         'used to learn the first supervised detection '
         'model.')
     subparsers = parser.add_subparsers(dest='strategy')
     subparsers.required = True
     factory = ActiveLearningConfFactory.getFactory()
     strategies = factory.getMethods()
     for strategy in strategies:
         strategy_parser = subparsers.add_parser(strategy)
         factory.generateParser(strategy, strategy_parser)
     return parser