mirror of https://github.com/MISP/MISP
chg: [decaying:effectiveRatio] Tags not having numerical_value doesn't
impact effective taxonomy ration anymorepull/5032/head
parent
b67f3879e3
commit
06c2fa39c7
|
@ -23,13 +23,13 @@ abstract class DecayingModelBase
|
|||
$total_score = 0.0;
|
||||
foreach ($tags as $tag) {
|
||||
$namespace_predicate = explode(':', $tag['Tag']['name'])[0];
|
||||
if (isset($taxonomy_base_ratio[$namespace_predicate])) {
|
||||
if (isset($taxonomy_base_ratio[$namespace_predicate]) && is_numeric($tag['Tag']['numerical_value'])) {
|
||||
$total_score += floatval($taxonomy_base_ratio[$namespace_predicate]);
|
||||
}
|
||||
}
|
||||
foreach ($tags as $i => $tag) {
|
||||
$namespace_predicate = explode(':', $tag['Tag']['name'])[0];
|
||||
if (isset($taxonomy_base_ratio[$namespace_predicate])) {
|
||||
if (isset($taxonomy_base_ratio[$namespace_predicate]) && is_numeric($tag['Tag']['numerical_value'])) {
|
||||
$ratioScore[$namespace_predicate] = floatval($taxonomy_base_ratio[$namespace_predicate]) / $total_score;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<th rowspan="2" style="vertical-align: middle;"><?php echo __('Result') ?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="padding: 0px; width: 50px;" title="<?php echo __('Taxonomy ratio') ?>"><?php echo __('Ratio') ?></th>
|
||||
<th style="padding: 0px; width: 50px;" title="<?php echo __('Taxonomy effective ratio') ?>"><?php echo __('Ratio') ?></th>
|
||||
<th></th>
|
||||
<th style="padding: 0px; width: 50px;" title="<?php echo __('Tag numerical value') ?>"><?php echo __('Value') ?></th>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue