Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positives negatives rate #67

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

mrkickling
Copy link
Collaborator

@mrkickling mrkickling commented Oct 3, 2024

Current state:

  • User can specify false positive/negative rate for specific attack graph nodes
  • It is applied to the observation for each specified node in each step using a rng
  • The false negatives/positives are 'sticky' if cumulative observation are used (default)

The are applied by scenario on the attack graph into node.extras field and used when creating the observation.

@mrkickling mrkickling linked an issue Oct 3, 2024 that may be closed by this pull request
@andrewbwm andrewbwm added this to the September-November 2024 milestone Oct 8, 2024
Copy link
Collaborator

@kasanari kasanari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine apart from RNG management.

@@ -654,9 +655,15 @@ def _observe_defender(
observation["observed_state"][index] = 1
else:
if node.is_compromised():
observation["observed_state"][index] = 1
fn_rate = node.extras.get('false_negative_rate')
make_false_negative = fn_rate and random() < fn_rate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would advise using a random number generator object here, so that the simulator respects the given seed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense, will fix that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a lot of changes to the PR after restructuring was done in the main branch. Needs to be reviewed again.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also added a test for the rng functionality to make sure a seed makes it deterministic.

@mrkickling mrkickling force-pushed the false-positives-negatives-rate branch 2 times, most recently from 7053d6d to cd0e80a Compare October 14, 2024 15:10
@mrkickling mrkickling marked this pull request as ready for review October 16, 2024 12:35
@mrkickling mrkickling force-pushed the false-positives-negatives-rate branch from 9f5e512 to f4e9fba Compare October 17, 2024 08:39
@mrkickling mrkickling force-pushed the false-positives-negatives-rate branch from 486e523 to 12c2cda Compare October 21, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement false positives/negatives in the Simulator
3 participants