Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Implement Negative Selection Algorithm | Artificial Immune Systems
Bio-Inspired Algorithms

bookChallenge: Implement Negative Selection Algorithm

Taak

Swipe to start coding

In this challenge, you will implement a basic negative selection algorithm (NSA) for anomaly detection.
This algorithm is inspired by the human immune system, which learns to distinguish between self (normal) and non-self (foreign) patterns.

You are given a list of self_patterns representing normal data.
Your task is to implement two core functions:

  1. Generate detectors: in the generate_detectors function, you must:
    • Generate random candidate patterns.
    • Check if the candidate pattern is in the self_set.
    • Only add the candidate to the detectors set if it is not a "self" pattern.
  2. Classify patterns: in the classify_patterns function, you must:
    • Check each pattern from the test_patterns list.
    • If the pattern is in the self_set, classify it as 'self'.
    • Else, if the pattern is in the detector_set, classify it as 'non-self'.
    • Otherwise (if it is not "self" and not in the generated detector list), classify it as 'non-self'.

Oplossing

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 4
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

close

Awesome!

Completion rate improved to 6.25

bookChallenge: Implement Negative Selection Algorithm

Veeg om het menu te tonen

Taak

Swipe to start coding

In this challenge, you will implement a basic negative selection algorithm (NSA) for anomaly detection.
This algorithm is inspired by the human immune system, which learns to distinguish between self (normal) and non-self (foreign) patterns.

You are given a list of self_patterns representing normal data.
Your task is to implement two core functions:

  1. Generate detectors: in the generate_detectors function, you must:
    • Generate random candidate patterns.
    • Check if the candidate pattern is in the self_set.
    • Only add the candidate to the detectors set if it is not a "self" pattern.
  2. Classify patterns: in the classify_patterns function, you must:
    • Check each pattern from the test_patterns list.
    • If the pattern is in the self_set, classify it as 'self'.
    • Else, if the pattern is in the detector_set, classify it as 'non-self'.
    • Otherwise (if it is not "self" and not in the generated detector list), classify it as 'non-self'.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 4. Hoofdstuk 4
single

single

some-alt