Skip to content
Snippets Groups Projects
Commit f5f2db61 authored by Jordi Inglada's avatar Jordi Inglada
Browse files

BUG: modulo must be on the nb of input and not generated samples

parent ac462e23
No related branches found
No related tags found
No related merge requests found
......@@ -192,13 +192,13 @@ void smote(const SampleVectorType& inSamples,
std::srand(seed);
#pragma omp parallel for
for(size_t i=0; i<nbSamples; ++i)
{
const auto sampleIdx = std::rand()%nbSamples;
const auto sample = inSamples[sampleIdx];
const auto neighborIdx = nnVector[sampleIdx][std::rand()%nbNeighbors].index;
const auto neighbor = inSamples[neighborIdx];
newSamples[i] = smoteCombine(sample, neighbor, std::rand()/double{RAND_MAX});
}
{
const auto sampleIdx = std::rand()%(inSamples.size());
const auto sample = inSamples[sampleIdx];
const auto neighborIdx = nnVector[sampleIdx][std::rand()%nbNeighbors].index;
const auto neighbor = inSamples[neighborIdx];
newSamples[i] = smoteCombine(sample, neighbor, std::rand()/double{RAND_MAX});
}
}
}//end namespaces sampleAugmentation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment