Skip to content

Commit

Permalink
Fixed some beacon scores from being NaN (activecm#748)
Browse files Browse the repository at this point in the history
* Fix some beacon scores from being NaN

* Match tsMadmScore

Co-authored-by: naomi <[email protected]>
  • Loading branch information
caffeinatedpixel and caffeinatedpixel authored Aug 25, 2022
1 parent ef7cebc commit 6ab6138
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/beacon/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,10 @@ func (a *analyzer) start() {
}

//lower dispersion is better
dsMadmScore := 1.0 - float64(dsMadm)/float64(dsMid)
dsMadmScore := 0.0
if dsMid >= 1 {
dsMadmScore = 1.0 - float64(dsMadm)/float64(dsMid)
}
if dsMadmScore < 0 {
dsMadmScore = 0
}
Expand Down

0 comments on commit 6ab6138

Please sign in to comment.