mirror of
https://github.com/Llewellynvdm/php-ml.git
synced 2024-11-25 22:37:34 +00:00
remove count from test condition
This commit is contained in:
parent
db9d57cd22
commit
9899da7143
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "php-ai/php-ml",
|
"name": "php-ai/php-ml",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "PHP Machine learning library",
|
"description": "PHP Machine Learning library",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"keywords": ["machine learning","pattern recognition","computational learning theory","artificial intelligence"],
|
"keywords": ["machine learning","pattern recognition","computational learning theory","artificial intelligence"],
|
||||||
"homepage": "https://github.com/php-ai/php-ml",
|
"homepage": "https://github.com/php-ai/php-ml",
|
||||||
|
@ -23,8 +23,9 @@ class Distance
|
|||||||
}
|
}
|
||||||
|
|
||||||
$distance = 0;
|
$distance = 0;
|
||||||
|
$count = count($a);
|
||||||
|
|
||||||
for ($i = 0; $i < count($a); ++$i) {
|
for ($i = 0; $i < $count; ++$i) {
|
||||||
$distance += pow($a[$i] - $b[$i], 2);
|
$distance += pow($a[$i] - $b[$i], 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user