32 #ifndef SHARK_OBJECTIVEFUNCTIONS_RADIUSMARGINQUOTIENT_H 33 #define SHARK_OBJECTIVEFUNCTIONS_RADIUSMARGINQUOTIENT_H 58 template<
class InputType,
class CacheType =
float>
82 {
return "RadiusMarginQuotient"; }
104 return result.
w2 * result.
R2;
124 result.
w2*(to_diagonal(result.
beta)-outer_prod(result.
beta,result.
beta))
129 return result.
w2 * result.
R2;
147 CachedMatrixType cache(&km);
152 ProblemType problem(svmProblem);
156 solver.
solve(stop, &prop);
158 result.
alpha = problem.getUnpermutedAlpha();
163 CachedMatrixType cache(&km);
168 RealVector linear(ell);
169 for (std::size_t i=0; i<ell; i++){
170 linear(i) = 0.5 * km(i, i);
172 SVMProblemType svmProblem(cache,linear,0.0,1.0);
173 ProblemType problem(svmProblem);
178 solver.
solve(stop, &prop);
180 result.
beta = problem.getUnpermutedAlpha();