Answers.Body: <p><span class="math-container">$$1-\sum_i(e_i-a_i)^2$$</span></p>
  <p><span class="math-container">$\sum$</span> - there just means sum. It is the greek letter for S.  You can rewrite the above formula as</p>
  <p><span class="math-container">$$1 -[(e_1 - a_1)^2+(e_2-a_2)^2+(e_3-a_3)^2+\ldots ]$$</span></p>
  <p><span class="math-container">$\sum$</span> just helps us avoid writing dozens of <span class="math-container">$+$</span> signs. Read <a href="https://en.wikipedia.org/wiki/Summation" rel="nofollow noreferrer">more here</a>.</p>
  <p>What they are doing here is taking the difference of expected value <span class="math-container">$e_1$</span> and the actual value <span class="math-container">$a_1$</span> for the 1st example, and so on. The difference can be positive (<span class="math-container">$e_1 &gt; a_1$</span>) or negative (<span class="math-container">$e_1 &lt; a_1$</span>), so usually we square the difference to make it positive number.</p>
  <p>The rest is there in the docs. Try putting in concrete imagined values for <span class="math-container">$a_i$</span> and <span class="math-container">$e_i$</span>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-20T12:00:25.603Z
Answers.LastActivityDate: 2021-01-14T17:43:58.430Z
Answers.LastEditDate: 2021-01-14T17:43:58.430Z
Answers.UserDisplayName: Pratik Deoghare
Answers.Body: <p>The <span class="math-container">$\sum$</span> means that they take a sum of the squared difference of each pair of expected/predicted values (<span class="math-container">$e_i$</span>) and actual values (<span class="math-container">$a_i$</span>)</p>
  <p>That gives them an error metric of how far off they are from their desired result. The goal is generally to optimize the algorithms against such an error function, in this case, to get it as close to one as possible.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-19T23:33:17.980Z
Answers.LastActivityDate: 2021-01-14T16:49:34.477Z
Answers.LastEditDate: 2021-01-14T16:49:34.477Z
Answers.UserDisplayName: guest
Answers.Body: <p>It sums the squared error for the output vs the expected output, this isnt something you need to do for each experiment they are simply telling you the metric they are using as fitness for the genomes in the xor example experiment, in other experiments you could use something else. If you were training it to play video games you set your fitness to be a numerical representation of how well the genome played the game, so you dont always need to have an expected value as long as your fitness function uses a meaningful metric as the fitness value. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-17T14:36:45.017Z
Answers.LastActivityDate: 2019-09-17T14:36:45.017Z
Answers.UserDisplayName: nickw
Body: <p>I have looked at the documentation for the NEAT Python API found <a href="https://neat-python.readthedocs.io/en/latest/xor_example.html" rel="nofollow noreferrer">here</a>, where it's written</p>
  <blockquote>
  <p>The error for each genome is <span class="math-container">$1-\sum_i(e_i-a_i)^2$</span></p>
  </blockquote>
  <p>I have not yet learned calculus, so I can't understand this formula. So, can someone please explain what the calculation means?</p>
  
Tags: <math><neat><neuroevolution><notation>
Title: What does the formula $1-\sum_i(e_i-a_i)^2$ mean in this NEAT Python API?
UserDisplayName: A Twizzler
ThreadText: # What does the formula $1-\sum_i(e_i-a_i)^2$ mean in this NEAT Python API?
  
  (Asked by: username_0 on 2019-04-19)
  
  I have looked at the documentation for the NEAT Python API found [here](https://neat-python.readthedocs.io/en/latest/xor_example.html), where it's written
  
  > The error for each genome is $1-\sum\_i(e\_i-a\_i)^2$
  
  I have not yet learned calculus, so I can't understand this formula. So, can someone please explain what the calculation means?
  
  **Tags:** math, neat, neuroevolution, notation
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2019-04-20. Score: 2
  
  $$1-\sum\_i(e\_i-a\_i)^2$$
  
  $\sum$ - there just means sum. It is the greek letter for S. You can rewrite the above formula as
  
  $$1 -[(e\_1 - a\_1)^2+(e\_2-a\_2)^2+(e\_3-a\_3)^2+\ldots ]$$
  
  $\sum$ just helps us avoid writing dozens of $+$ signs. Read [more here](https://en.wikipedia.org/wiki/Summation).
  
  What they are doing here is taking the difference of expected value $e\_1$ and the actual value $a\_1$ for the 1st example, and so on. The difference can be positive ($e\_1 > a\_1$) or negative ($e\_1 < a\_1$), so usually we square the difference to make it positive number.
  
  The rest is there in the docs. Try putting in concrete imagined values for $a\_i$ and $e\_i$.
  
  
  ---
  
  ### Answer by username_2 on 2019-04-19. Score: 0
  
  The $\sum$ means that they take a sum of the squared difference of each pair of expected/predicted values ($e\_i$) and actual values ($a\_i$)
  
  That gives them an error metric of how far off they are from their desired result. The goal is generally to optimize the algorithms against such an error function, in this case, to get it as close to one as possible.
  
  
  ---
  
  ### Answer by username_3 on 2019-09-17. Score: 0
  
  It sums the squared error for the output vs the expected output, this isnt something you need to do for each experiment they are simply telling you the metric they are using as fitness for the genomes in the xor example experiment, in other experiments you could use something else. If you were training it to play video games you set your fitness to be a numerical representation of how well the genome played the game, so you dont always need to have an expected value as long as your fitness function uses a meaningful metric as the fitness value.
  
  
  ---
  
  