Cost function: Difference between revisions
(Created page with "==Definition== ===For a single piece of data=== The '''cost function''' associated with a given machine learning problem is a function that takes as input a guess for the fu...") |
No edit summary |
||
| Line 13: | Line 13: | ||
* For prediction problems associated with discrete variables, the predicted value is a probability and the actual value is simply a discrete value (0 or 1). The cost function is a function <math>C(p,v)</math> of two variables (the predicted probability and actual value) satisfying the following conditions: | * For prediction problems associated with discrete variables, the predicted value is a probability and the actual value is simply a discrete value (0 or 1). The cost function is a function <math>C(p,v)</math> of two variables (the predicted probability and actual value) satisfying the following conditions: | ||
** <math>C(1,1) = 0</math> | ** <math>C(1,1) = 0</math> | ||
** <math>C(0,0) = 0</math> | ** <math>C(0,0) = 0</math> | ||
** For <math>p \le q</math>, <math>C(q,1) \le C(p,1)</math> | ** For <math>p \le q</math>, <math>C(q,1) \le C(p,1)</math> | ||
** For <math>p \le q</math>, <math>C(p,0) \le C(q,0)</math> | ** For <math>p \le q</math>, <math>C(p,0) \le C(q,0)</math> | ||
Revision as of 23:34, 18 June 2014
Definition
For a single piece of data
The cost function associated with a given machine learning problem is a function that takes as input a guess for the function and the observed output and the predicted function value and then associates to that a number measuring how far the observed output is from the predicted function value.
- For prediction problems associated with continuous variables, both the predicted value and the actual value are continuous variables. The cost function is a function of two variables (the predicted value and actual value) satisfying the following conditions:
- for all
- For , and
The cost function need not satisfy the triangle inequality; in fact, typical cost functions penalize bigger errors superlinearly.
- For prediction problems associated with discrete variables, the predicted value is a probability and the actual value is simply a discrete value (0 or 1). The cost function is a function of two variables (the predicted probability and actual value) satisfying the following conditions:
- For ,
- For ,