PHP Class Phpml\Metric\ClassificationReport

Show file Open project: php-ai/php-ml Class Usage Examples

Public Methods

Method Description
__construct ( array $actualLabels, array $predictedLabels )
getAverage ( ) : array
getF1score ( ) : array
getPrecision ( ) : array
getRecall ( ) : array
getSupport ( ) : array

Private Methods

Method Description
computeAverage ( )
computeF1Score ( float $precision, float $recall ) : float
computeMetrics ( array $truePositive, array $falsePositive, array $falseNegative )
computePrecision ( integer $truePositive, integer $falsePositive ) : float | string
computeRecall ( integer $truePositive, integer $falseNegative ) : float | string
getLabelIndexedArray ( array $actualLabels, array $predictedLabels ) : array

Method Details

__construct() public method

public __construct ( array $actualLabels, array $predictedLabels )
$actualLabels array
$predictedLabels array

getAverage() public method

public getAverage ( ) : array
return array

getF1score() public method

public getF1score ( ) : array
return array

getPrecision() public method

public getPrecision ( ) : array
return array

getRecall() public method

public getRecall ( ) : array
return array

getSupport() public method

public getSupport ( ) : array
return array