Continue refactoring

This commit is contained in:
2025-02-27 11:37:30 +01:00
parent 2dcd073299
commit 610c2a6a4a
2 changed files with 1 additions and 8 deletions

View File

@@ -46,7 +46,6 @@ namespace platform {
bool debug = false;
Xaode aode_;
torch::Tensor weights_;
bool fitted = false;
const std::string CLASSIFIER_NOT_FITTED = "Classifier has not been fitted";
inline void normalize_weights(int num_instances)
{

View File

@@ -182,7 +182,6 @@ namespace platform {
}
}
}
// -------------------------------------------------------
// computeProbabilities
// -------------------------------------------------------
@@ -257,7 +256,6 @@ namespace platform {
}
matrixState_ = MatrixState::PROBS;
}
// -------------------------------------------------------
// predict_proba_spode
// -------------------------------------------------------
@@ -372,10 +370,7 @@ namespace platform {
}
void normalize(std::vector<double>& probs) const
{
double sum = 0;
for (double d : probs) {
sum += d;
}
double sum = std::accumulate(probs.begin(), probs.end(), 0.0);
if (std::isnan(sum)) {
throw std::runtime_error("Can't normalize array. Sum is NaN.");
}
@@ -420,7 +415,6 @@ namespace platform {
active_parents.pop_back();
}
private:
// -----------
// MEMBER DATA