protected function score(Dataset $dataset) : array
    {
        $scores = array_fill(
            0,
            $dataset->numRows(),
            array_fill_keys($this->classes, 0.)
        );

        foreach ($this->ensemble as $i => $estimator) {
            $influence = $this->influences[$i];

            foreach ($estimator->predict($dataset) as $j => $prediction) {
                $scores[$j][$prediction] += $influence;
            }
        }

        return $scores;
    }
protected function score(Dataset $dataset) : array
    {
        $scores = array_fill(
            0,
            $dataset->numRows(),
            array_fill_keys($this->classes, 0.)
        );

        foreach ($this->ensemble as $i => $estimator) {
            $influence = $this->influences[$i];

            foreach ($estimator->predict($dataset) as $j => $prediction) {
                $scores[$j][$prediction] += $influence;
            }
        }

        return $scores;
    }
protected function score ( Dataset $ dataset ) : array { $ scores = array_fill ( 0 , $ dataset -> numRows ( ) , array_fill_keys ( $ this -> classes , 0. ) ) ; foreach ( $ this -> ensemble as $ i => $ estimator ) { $ influence = $ this -> influences [ $ i ] ; foreach ( $ estimator -> predict ( $ dataset ) as $ j => $ prediction ) { $ scores [ $ j ] [ $ prediction ] += $ influence ; } } return $ scores ; }
Return the influence scores for each sample in the dataset.

@param \Rubix\ML\Datasets\Dataset $dataset
@throws \RuntimeException
@throws \InvalidArgumentException
@return array
Return the influence scores for each sample in the dataset .