src/Matcher.php
public function getNormalizedScoresByAttribute(Attribute $attribute): Collection
    {
        $scores = $this->getScoresByAttribute($attribute);

        $max = $scores->max();

        return $scores->map(function ($score) use ($max) {
            return is_null($score) ? null : ($score / $max);
        });
    }
public function getNormalizedScoresByAttribute(Attribute $attribute): Collection
    {
        $scores = $this->getScoresByAttribute($attribute);

        $max = $scores->max();

        return $scores->map(function ($score) use ($max) {
            return is_null($score) ? null : ($score / $max);
        });
    }
public function getNormalizedScoresByAttribute ( Attribute $ attribute ) : Collection { $ scores = $ this -> getScoresByAttribute ( $ attribute ) ; $ max = $ scores -> max ( ) ; return $ scores -> map ( function ( $ score ) use ( $ max ) { return is_null ( $ score ) ? null : ( $ score / $ max ) ; } ) ; }
This method does the same as the 'getScoresByAttribute' method
but has the scores normalized.

@param  \Pbmedia\Specifications\Interfaces\Attribute   $attribute
@return \Illuminate\Support\Collection
This method does the same as the getScoresByAttribute method but has the scores normalized .