Skip to content

Commit 9e949c6

Browse files
committed
Relax syntax a bit
1 parent 29d9955 commit 9e949c6

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/CrossValidation/Metrics/Completeness.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function compatibility() : array
6060
*/
6161
public function score(array $predictions, array $labels) : float
6262
{
63-
$table = new ContingencyTable()->generate($labels, $predictions);
63+
$table = (new ContingencyTable())->generate($labels, $predictions);
6464

6565
$score = 0.0;
6666

src/CrossValidation/Metrics/Homogeneity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function compatibility() : array
6161
*/
6262
public function score(array $predictions, array $labels) : float
6363
{
64-
$table = new ContingencyTable()->generate($predictions, $labels);
64+
$table = (new ContingencyTable())->generate($predictions, $labels);
6565

6666
$score = 0.0;
6767

src/CrossValidation/Metrics/RandIndex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function compatibility() : array
7272
*/
7373
public function score(array $predictions, array $labels) : float
7474
{
75-
$table = new ContingencyTable()->generate($labels, $predictions);
75+
$table = (new ContingencyTable())->generate($labels, $predictions);
7676

7777
$table = Matrix::build($table->toArray());
7878

src/CrossValidation/Metrics/VMeasure.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public function compatibility() : array
7979
*/
8080
public function score(array $predictions, array $labels) : float
8181
{
82-
$homogeneity = new Homogeneity()->score($predictions, $labels);
83-
$completeness = new Completeness()->score($predictions, $labels);
82+
$homogeneity = (new Homogeneity())->score($predictions, $labels);
83+
$completeness = (new Completeness())->score($predictions, $labels);
8484

8585
return (1.0 + $this->beta) * $homogeneity * $completeness
8686
/ (($this->beta * $homogeneity + $completeness) ?: EPSILON);

0 commit comments

Comments
 (0)