EstimatorSpec

Chapter Goals:

  • Learn how to evaluate a regression model
  • Use the EstimatorSpec object to organize results from training, evaluation, and prediction

A. Regression evaluation

Unlike classification models, we can’t use the accuracy metric to evaluate regression. Since the output of regression models is a real number, rather than a class prediction, there’s no definite way to say what is “correct” or “incorrect”.

However, we can tell how good a model output is based on its distance from the corresponding label. For example, if the label for some data observation was 0.2 and the model returned 0.199, the prediction is excellent. On the other hand, if the model returned 812.11, the prediction is likely very poor. ...