mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-09-27 06:29:02 +00:00
Add null coalesce operator in token count vectoriezer
This commit is contained in:
parent
38a26d185f
commit
8aad8afc37
@ -132,7 +132,7 @@ class TokenCountVectorizer implements Transformer
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isset($this->vocabulary[$token]) ? $this->vocabulary[$token] : false;
|
return $this->vocabulary[$token] ?? false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -163,7 +163,7 @@ class ClassificationReport
|
|||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 2.0 * (($precision * $recall) / ($divider));
|
return 2.0 * (($precision * $recall) / $divider);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user