Skip to content

Implement classifier aggregating detector results with confidence scoring #6

Description

@MaximilianRau04

Context

src/algorithm_pattern_classifier/classifiers/ is currently empty. Once multiple BaseDetector implementations exist (#2, #3, ...), something needs to combine their outputs into a single, ranked answer — a piece of code can plausibly match more than one pattern (e.g. a DP solution that also looks like a nested loop).

What

Implement a BaseClassifier that:

  1. Runs all registered detectors against the parsed source.
  2. Aggregates the individual detector outputs (which may each independently claim a match) into a ranked list of ClassificationResults with a combined confidence score.
  3. Handles ties/overlaps sensibly (e.g. a DP solution shouldn't also be reported as a generic "nested loop" pattern if a more specific detector matched).

Depends on #1, and benefits from having at least two detectors (#2, #3) implemented to test aggregation against.

Acceptance Criteria

  • Classifier returns results ordered by descending confidence
  • Ambiguous cases (multiple plausible patterns) surface all of them rather than silently picking one
  • Unit tests cover: single clear match, multiple detectors firing on the same snippet, and no detector matching

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions