liveBook · Manning

Mean squared error

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

A metric equal to the average of the squared differences between predicted and observed values.

Mean squared error (MSE) measures average squared prediction error: subtract each predicted value from its observed value, square the difference, and average the results. Lower MSE indicates a closer fit. section 8.2.2

Comparing polynomial candidates

For a third-order polynomial, a real-valued genetic algorithm represents each candidate as coefficients [a, b, c, d]. The candidate [1, 2, 3, 4] produces an MSE of 122.83, while [2, 2, 2, 2] produces 3,662.32. The first candidate therefore receives the better fitness for this minimization problem. section 8.2.2

A practical MSE workflow is:

  • Evaluate the polynomial at each supplied x value. section 8.2.2
  • Compute squared errors against the corresponding observed y values and average them. section 8.2.2
  • Use the resulting score to compare genetic-algorithm candidates during optimization. section 8.2.2

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Works through two candidate calculations and connects the score to fitness, without developing statistical limitations.
Examples
Uses five curve-fitting data points and compares coefficient vectors [1, 2, 3, 4] and [2, 2, 2, 2].
What it assumes
Assumes familiarity with polynomial coefficients, observed versus predicted values, and real-valued genetic algorithms.
What you can do after
Apply MSE to compare polynomial predictions and configure it as a minimization objective in pymoo.
How it connects
Connects curve fitting, polynomial regression, genetic algorithms, fitness evaluation, crossover, and mutation.

Also explained in

Compare how 13 books explain mean squared error →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.