Model.Metric

Click here to view source code.

class Metric:

It contains functions Metric.MSE, Metric.R2, and Metric.PCC.

Metric.MSE

def MSE(real,
        predict):

It is used to calculate mean square error.

PARAMETERS:

  • real - The real value.

  • predict - The predicted value.

OUTPUTS:

  • mse - The mean square error.

Metric.R2

def R2(real,
       predict):

It is used to calculate r square.

PARAMETERS:

  • real - The real value.

  • predict - The predicted value.

OUTPUTS:

  • r2 - The r square.

Metric.PCC

def PCC(real,
        predict):

It is used to calculate pearson correlation coefficient.

PARAMETERS:

  • real - The real value.

  • predict - The predicted value.

OUTPUTS:

  • pcc - The pearson correlation coefficient.