Add null coalesce operator in token count vectoriezer

This commit is contained in:
Arkadiusz Kondas 2016-12-08 00:45:42 +01:00
parent 38a26d185f
commit 8aad8afc37
2 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@ class TokenCountVectorizer implements Transformer
return false;
}
return isset($this->vocabulary[$token]) ? $this->vocabulary[$token] : false;
return $this->vocabulary[$token] ?? false;
}
/**

View File

@ -163,7 +163,7 @@ class ClassificationReport
return 0.0;
}
return 2.0 * (($precision * $recall) / ($divider));
return 2.0 * (($precision * $recall) / $divider);
}
/**