bugfinder.features.extraction
Base classes for feature extraction
- class bugfinder.features.extraction.FlowGraphFeatureExtractor(dataset, deprecation_warning=None)
Bases:
GraphFeatureExtractor
Base extractor to retrieve control or data flow features from a Joern database.
- extract_features()
Extract features
- extract_features_worker(args)
Feature extraction worker for a single entrypoint
- static finalize_features(features, labels)
Finalize features.
- abstract get_flowgraph_count(flowgraph)
Retrieve the number of a given flowgraph. Must be implemented by the subclasses.
- abstract get_flowgraph_list_for_entrypoint(entrypoint)
Retrieve the list of flowgraph for a given entrypoint. Must be implemented by the subclasses.
- abstract get_label_from_flowgraph(flowgraph)
Create label for a given flowgraph. Must be implemented by the subclasses.
- initialize_features(entrypoint, label_list)
Initialize the features to 0 and returns the expected array
- Parameters
dict (entrypoint -) –
list (label_list -) –
- Returns
List of labels initialized to 0
- Return type
- map_features()
Map features
- map_features_worker(entrypoint)
Worker to map features
- class bugfinder.features.extraction.GraphFeatureExtractor(dataset, deprecation_warning=None)
Bases:
Neo4J3Processing
Feature extractor for Joern databases
- check_extraction_inputs()
Verify and version feature file
- configure_container()
Setup main container variables.
- execute(command_args=None, feature_map_filepath=None, need_map_features=False)
Execute the feature extraction
- abstract extract_features()
Extract features. Abstract method.
- feature_map_filepath = None
- get_labels_from_feature_map()
Retrieve labels stored in feature map
- abstract map_features()
Map features. Abstract method.
- need_map_features = False
- save_labels_to_feature_map(labels)
Save all labels to feature map
- send_commands()
Send commands to the container
- write_extraction_outputs(features)
Write features to CSV file
- bugfinder.features.extraction.interproc
FeatureExtractor
FeatureExtractor.catlock
FeatureExtractor.cats
FeatureExtractor.check_extraction_inputs()
FeatureExtractor.configure_container()
FeatureExtractor.configure_container_with_dict()
FeatureExtractor.extract_features()
FeatureExtractor.extract_features_worker()
FeatureExtractor.get_flowgraph_list_for_entrypoint()
FeatureExtractor.send_commands()
FeatureExtractor.timeout
FeatureExtractor.write_extraction_outputs()
- bugfinder.features.extraction.bag_of_words
- bugfinder.features.extraction.bag_of_words.hops_n_flows
FeatureExtractor
FeatureExtractor.configure_container()
FeatureExtractor.execute()
FeatureExtractor.finalize_features()
FeatureExtractor.flows
FeatureExtractor.get_flowgraph_count()
FeatureExtractor.get_flowgraph_list_for_entrypoint()
FeatureExtractor.get_label_from_flowgraph()
FeatureExtractor.max_hops
FeatureExtractor.min_hops
- bugfinder.features.extraction.bag_of_words.single_hop
- bugfinder.features.extraction.bag_of_words.any_hop
- bugfinder.features.extraction.bag_of_words.hops_n_flows
- bugfinder.features.extraction.word2vec
- bugfinder.features.extraction.node2vec
- bugfinder.features.extraction.node2vec.embeddings
- bugfinder.features.extraction.node2vec.model
- bugfinder.features.extraction.node2vec.implementation
Node2VecImplementation
Node2VecImplementation.FIRST_TRAVEL_KEY
Node2VecImplementation.NEIGHBORS_KEY
Node2VecImplementation.NUM_WALKS_KEY
Node2VecImplementation.PROBABILITIES_KEY
Node2VecImplementation.P_KEY
Node2VecImplementation.Q_KEY
Node2VecImplementation.WALK_LENGTH_KEY
Node2VecImplementation.WEIGHT_KEY
Node2VecImplementation.fit()