GPMSCLooEstimates.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /**
  2. * @file GPMSCLooEstimates.h
  3. * @author Erik Rodner
  4. * @date 03/07/2010
  5. */
  6. #ifndef _NICE_OBJREC_GPMSCLOOESTIMATESINCLUDE
  7. #define _NICE_OBJREC_GPMSCLOOESTIMATESINCLUDE
  8. #include "core/vector/VectorT.h"
  9. #include "vislearning/math/kernels/KernelData.h"
  10. #include "vislearning/regression/gpregression/modelselcrit/GPModelSelectionCriterion.h"
  11. #include "core/optimization/limun/OptimizationProblemFirst.h"
  12. namespace OBJREC {
  13. /** @class GPMSCLooLikelihoodRegression
  14. * Estimates the LOO preditictive log probability
  15. * @author Erik Rodner
  16. */
  17. class GPMSCLooLikelihoodRegression : public GPModelSelectionCriterion
  18. {
  19. protected:
  20. bool weightedLooProb;
  21. NICE::Vector selection;
  22. public:
  23. GPMSCLooLikelihoodRegression ( bool weightedLooProb = false );
  24. GPMSCLooLikelihoodRegression ( bool weightedLooProb, const NICE::Vector & selection );
  25. virtual ~GPMSCLooLikelihoodRegression () {};
  26. virtual double computeObjective ( KernelData *kernelData, const NICE::Vector & labels ) const;
  27. virtual double computeObjective ( const NICE::Vector & invKernelMatrixDiag, const NICE::Vector & alpha,
  28. const NICE::Vector & labels ) const;
  29. };
  30. /** @class GPMSCLooLikelihoodClassification
  31. * Estimates the LOO preditictive log probability (Regression with
  32. * additional squash function)
  33. * @author Erik Rodner
  34. */
  35. class GPMSCLooLikelihoodClassification : public GPMSCLooLikelihoodRegression
  36. {
  37. protected:
  38. public:
  39. GPMSCLooLikelihoodClassification ();
  40. GPMSCLooLikelihoodClassification ( const NICE::Vector & selection );
  41. virtual ~GPMSCLooLikelihoodClassification () {};
  42. virtual double computeObjective ( const NICE::Vector & invKernelMatrixDiag, const NICE::Vector & alpha,
  43. const NICE::Vector & labels ) const;
  44. };
  45. /** @class GPMSCLooLikelihoodClassificationFixed
  46. * Estimates the LOO preditictive log probability (Regression with
  47. * additional fixed squash function)
  48. * @author Erik Rodner
  49. */
  50. class GPMSCLooLikelihoodClassificationFixed : public GPMSCLooLikelihoodRegression
  51. {
  52. protected:
  53. public:
  54. GPMSCLooLikelihoodClassificationFixed ();
  55. GPMSCLooLikelihoodClassificationFixed ( const NICE::Vector & selection );
  56. virtual ~GPMSCLooLikelihoodClassificationFixed () {};
  57. virtual double computeObjective ( const NICE::Vector & invKernelMatrixDiag, const NICE::Vector & alpha,
  58. const NICE::Vector & labels ) const;
  59. };
  60. /** @class GPMSCLooLabor
  61. * @author Erik Rodner
  62. */
  63. class GPMSCLooLabor : public GPMSCLooLikelihoodRegression
  64. {
  65. protected:
  66. public:
  67. GPMSCLooLabor ();
  68. GPMSCLooLabor ( const NICE::Vector & selection );
  69. virtual ~GPMSCLooLabor () {};
  70. virtual double computeObjective ( const NICE::Vector & invKernelMatrixDiag, const NICE::Vector & alpha,
  71. const NICE::Vector & labels ) const;
  72. };
  73. /** @class GPMSCLooLikelihoodClassificationOptProb
  74. * Optimizaton problem for
  75. * Estimates the LOO preditictive log probability (Regression with
  76. * additional squash function)
  77. * as presented in Rasmussen, Williams (page 148)
  78. * @author Erik Rodner
  79. */
  80. class GPMSCLooLikelihoodClassificationOptProb : public NICE::OptimizationProblemFirst
  81. {
  82. protected:
  83. NICE::Vector labels;
  84. NICE::Vector selection;
  85. NICE::Vector looMu;
  86. NICE::Vector looVariance;
  87. bool verbose;
  88. public:
  89. GPMSCLooLikelihoodClassificationOptProb ( const NICE::Vector & labels,
  90. const NICE::Vector & selection, const NICE::Vector & looMu, const NICE::Vector & looVariance,
  91. bool verbose = false );
  92. double computeObjective();
  93. void computeGradient( NICE::Vector & newGradient );
  94. };
  95. /** @class GPMSCLooVarious
  96. * Estimates various measures using the LOO estimates
  97. * @author Erik Rodner
  98. */
  99. class GPMSCLooVarious : public GPMSCLooLikelihoodRegression
  100. {
  101. public:
  102. enum {
  103. P_RECOGNITIONRATE = 0,
  104. P_AUC,
  105. P_AVGPREC
  106. };
  107. protected:
  108. int type;
  109. public:
  110. GPMSCLooVarious ( int type );
  111. GPMSCLooVarious ( int type, const NICE::Vector & selection );
  112. virtual ~GPMSCLooVarious () {};
  113. virtual double computeObjective ( const NICE::Vector & invKernelMatrixDiag, const NICE::Vector & alpha,
  114. const NICE::Vector & labels ) const;
  115. };
  116. /** @class GPMSCConditionalLikelihood
  117. * Estimates the conditional marginal likelihood
  118. * @author Erik Rodner
  119. */
  120. class GPMSCConditionalLikelihood : public GPModelSelectionCriterion
  121. {
  122. protected:
  123. NICE::Vector selection;
  124. public:
  125. GPMSCConditionalLikelihood ( const NICE::Vector & selection );
  126. virtual ~GPMSCConditionalLikelihood () {};
  127. virtual double computeObjective ( KernelData *kernelData, const NICE::Vector & labels ) const;
  128. };
  129. }
  130. #endif