Error methods commonly used in deep learning include:

  • Standard Deviation:

Standard deviation, also known as mean square deviation, is the arithmetic square root of variance, reflecting the degree of dispersion of data. The smaller the standard deviation, the smaller the deviation from the mean, and vice versa.

Formula is:

The python code is:

Def get_average(records): return sum(records)/len(records) # variance def get_average(records): Average = get_average(records) return sum([(x-Average) ** 2 for x in records])/len(records) # standard deviation def get_standard_deviation(records): variance = get_variance(records) return math.sqrt(variance)Copy the code
  • MSE(mean-square error)

The mean square error reflects the degree of difference between the estimator and the estimator. The smaller the MSE, the more accurate the prediction.

Formula is:

 

The python code is:

def get_mse(records_real, records_predict):
    if len(records_real) == len(records_predict):
        return sum([(x - y) ** 2 for x, y in zip(records_real, records_predict)]) / len(records_real)
    else:
        return None
Copy the code
  • Root mean squared error RMSE (root mean squared error)

The root mean square error is the arithmetic square root of the mean square error. Formula is:

The python code is:

def get_rmse(records_real, records_predict):
    mse = get_mse(records_real, records_predict)
    if mse:
        return math.sqrt(mse)
    else:
        return None
Copy the code
  • MAE (Mean Absolute Error)

The python code is:

def get_mae(records_real, records_predict):
    if len(records_real) == len(records_predict):
        return sum([abs(x - y) for x, y in zip(records_real, records_predict)]) / len(records_real)
    else:
        return None
Copy the code

References:

【 1 】 blog.csdn.net/cqfdcw/arti…

【 2 】 blog.csdn.net/mouday/arti…