# Meta Errors

**URL:** <https://discourse.pushlanguage.org/t/meta-errors/243>\
**Category:** Orientation\
**Created:** [October 27, 2015, 12:42am UTC](https://discourse.pushlanguage.org/t/meta-errors/243 "2015-10-27T00:42:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thelmuth](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.pushlanguage.org/thelmuth/32/2_2.png) [@thelmuth](https://discourse.pushlanguage.org/u/thelmuth)\
**Post date:** [October 27, 2015, 12:42am UTC](https://discourse.pushlanguage.org/t/meta-errors/243/1 "2015-10-27T00:42:06Z")

</div>

A recent addition to Clojush is the ability to have **meta-error** values along with the normal error values. The idea of meta-errors is that they are used during selection just like normal errors, but they aren’t taken into consideration when determining whether a program is a solution to a problem.

An example will help illustrate the utility of meta-errors. Let’s say you want to include the size of a program as an error value (or “test case”) that should be minimized. This seems like a potentially interesting thing to do, especially when using lexicase selection, where the size will just be one extra test case. But, when Clojush is determining whether a program solves a problem, we don’t care about the size error value – in fact, that value should never be zero, so if we included it in our “do we have a solution” check, we would never find a solution. So, we can include it as a meta-error, which will allow us to use size in parent selection, but not in checking for solutions.

In the [Clojush implementation of meta-errors](https://github.com/lspector/Clojush/blob/762721bdd5ade221e9a0530f167f194f5452a310/src/clojush/evaluate.clj#L25-L43), a meta-error can be one of two things:

1. A keyword for a built-in meta-error category, which at the time of writing includes the following:

- :size (minimize size of program)
- :compressibility (minimize amount a program compresses compared to itself) (NOTE: Not yet implemented)
- :total-error (minimize total error)
- :unsolved-cases (maximize number of cases with zero error)
- :rand (a random floating-point value)
- :rand-bit (randomly 0 or 1)
- :age (minimize genealogical age of program)

1. A function that takes an individual and an argmap and returns a meta error value.

---

<div class="post-metadata">

**Author:** ![bill](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.pushlanguage.org/bill/32/6_2.png) [@bill](https://discourse.pushlanguage.org/u/bill)\
**Post date:** [October 27, 2015, 5:52pm UTC](https://discourse.pushlanguage.org/t/meta-errors/243/2 "2015-10-27T17:52:03Z")

</div>

> [@thelmuth](#):
>
> …so if we included it in our “do we have a solution” check…

So except for calculating and recording them, they’re not used for selection at all? Just monitored over the course of a run?

---

<div class="post-metadata">

**Author:** ![thelmuth](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.pushlanguage.org/thelmuth/32/2_2.png) [@thelmuth](https://discourse.pushlanguage.org/u/thelmuth)\
**Post date:** [October 28, 2015, 12:49pm UTC](https://discourse.pushlanguage.org/t/meta-errors/243/3 "2015-10-28T12:49:43Z")

</div>

> [@bill](#):
>
> So except for calculating and recording them, they’re not used for selection at all? Just monitored over the course of a run?

> [@thelmuth](#):
>
> The idea of meta-errors is that they are used during selection just like normal errors, but they aren’t taken into consideration when determining whether a program is a solution to a problem.

Does that help?
