- Hands-On Neural Network Programming with C#
- Matt R. Cole
- 105字
- 2025-02-24 05:32:27
Mean squared error regression metric
Mean squared error (MSE) is a metric that measures the average of the squares of the errors. More concretely, it measures the average distance between the estimated values and what is estimated. A mean squared error is always non-negative, and values that are closer to zero are considered more acceptable. SharpLearning makes it incredibly easy to calculate this error metric, as depicted in the following code:
var targets = new double[] { 1.0, 2.3, 3.1, 4.4, 5.8 };
var predictions = new double[] { 1.0, 2.0, 3.0, 4.0, 5.0 };
var sut = new MeanSquaredErrorRegressionMetric();
var actual = sut.Error(targets, predictions);