MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / solve_one_class

Function solve_one_class

ml/src/svm.cpp:1760–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1758}
1759
1760static void
1761solve_one_class(const svm_problem* prob,
1762 const svm_parameter* param,
1763 double* alpha,
1764 Solver::SolutionInfo* si)
1765{
1766 int l = prob->l;
1767 double* zeros = new double[l];
1768 schar* ones = new schar[l];
1769
1770 int n = static_cast<int>(param->nu * prob->l); // # of alpha's at upper bound
1771
1772 for (int i = 0; i < n; i++)
1773 alpha[i] = 1;
1774
1775 if (n < prob->l)
1776 alpha[n] = param->nu * prob->l - n;
1777
1778 for (int i = n + 1; i < l; i++)
1779 alpha[i] = 0;
1780
1781 for (int i = 0; i < l; i++) {
1782 zeros[i] = 0;
1783 ones[i] = 1;
1784 }
1785
1786 Solver s;
1787
1788 s.Solve(l,
1789 ONE_CLASS_Q(*prob, *param),
1790 zeros,
1791 ones,
1792 alpha,
1793 1.0,
1794 1.0,
1795 param->eps,
1796 si,
1797 param->shrinking);
1798
1799 delete[] zeros;
1800 delete[] ones;
1801}
1802
1803static void
1804solve_epsilon_svr(const svm_problem* prob,

Callers 1

svm_train_oneFunction · 0.85

Calls 2

ONE_CLASS_QClass · 0.85
SolveMethod · 0.45

Tested by

no test coverage detected