mirror of https://github.com/CGAL/cgal
Bugfix: prevent classification cost from going negative
This commit is contained in:
parent
40e497a6da
commit
34bc6f18e8
|
|
@ -147,7 +147,11 @@ public:
|
||||||
m_rfc->evaluate (ft.data(), prob.data());
|
m_rfc->evaluate (ft.data(), prob.data());
|
||||||
|
|
||||||
for (std::size_t i = 0; i < out.size(); ++ i)
|
for (std::size_t i = 0; i < out.size(); ++ i)
|
||||||
|
{
|
||||||
out[i] = - std::log (prob[i]);
|
out[i] = - std::log (prob[i]);
|
||||||
|
if (out[i] < 0.f)
|
||||||
|
out[i] = -out[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void save_configuration (const char* filename)
|
void save_configuration (const char* filename)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue