SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SquaredHingeLoss.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2011 Shashwat Lal Das
8  * Copyright (c) 2011 Berlin Institute of Technohingey and Max-Planck-Society.
9  */
10 
12 
13 using namespace shogun;
14 
16 {
17  float64_t z = prediction * label;
18  if (z < 1)
19  return 0.5 * (1-z) * (1-z);
20  return 0;
21 }
22 
24 {
25  float64_t z = prediction * label;
26  if (z < 1)
27  return z-1;
28  return 0;
29 }
30 
32 {
33  float64_t z = prediction * label;
34  if (z < 1)
35  return 1;
36  return 0;
37 }
38 
40 {
42  return -1;
43 }
44 
46 {
48  return -1;
49 }

SHOGUN Machine Learning Toolbox - Documentation