How to use the networkml.algorithms.base.BaseAlgorithm function in networkml

To help you get started, we’ve selected a few networkml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CyberReboot / NetworkML / tests / test_basealgorithm.py View on Github external
def test_basealgorithm_eval():
    instance = BaseAlgorithm()
    instance.eval('onelayer')
    instance.eval('randomforest')
github CyberReboot / NetworkML / tests / test_basealgorithm.py View on Github external
def test_parse_pcap_name():
    instance = BaseAlgorithm()
    parse_pcap_name = instance.parse_pcap_name
    assert parse_pcap_name('notaposeidontracefile.pcap') == (
        'notaposeidontracefile', None)
    assert parse_pcap_name('trace_but_invalid') == (
        None, None)
    assert parse_pcap_name('trace_ab12_2001-01-01_02_03-client-ip-1-2-3-4.pcap') == (
        'ab12', 'ip-1-2-3-4')
    assert parse_pcap_name('trace_ab12_2001-01-01_02_03-miscellaneous-stuff.pcap') == (
        None, None)
github CyberReboot / NetworkML / tests / test_basealgorithm.py View on Github external
def test_basealgorithm():
    instance = BaseAlgorithm()

    last_update = instance.common.get_address_info('10.0.0.1', '1')
    last_update, previous_representation = instance.common.get_previous_state(
        '10.0.0.1', '1')
    assert last_update == None
    assert previous_representation == None
github CyberReboot / NetworkML / networkml / NetworkML.py View on Github external
def create_base_alg():
            return BaseAlgorithm(
                files=self.files, config=self.config,
                model=self.model, model_hash=self.model_hash,
                model_path=self.args.trained_model)