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

bookChallenge: Implement Negative Selection Algorithm

Aufgabe

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'.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 4. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

Awesome!

Completion rate improved to 6.25

bookChallenge: Implement Negative Selection Algorithm

Swipe um das Menü anzuzeigen

Aufgabe

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'.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 4. Kapitel 4
single

single

some-alt