fix errors on hhvm with float casting

This commit is contained in:
Arkadiusz Kondas 2016-07-07 22:47:36 +02:00
parent 6c7416a9c4
commit 4aa9702943
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class TfIdfTransformer implements Transformer
$count = count($samples);
foreach ($this->idf as &$value) {
$value = log($count / $value, 10);
$value = log(floatval($count / $value), 10.0);
}
}

View File

@ -78,7 +78,7 @@ class Normalizer implements Preprocessor
foreach ($sample as $feature) {
$norm2 += $feature * $feature;
}
$norm2 = sqrt($norm2);
$norm2 = sqrt(floatval($norm2));
if (0 == $norm2) {
$sample = array_fill(0, count($sample), 1);