Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void doSomething(const std::vector<int> & randFeatures, const std::vector<int>& inBagSamples, const matrix<float>& data ){
- std::vector<std::pair<float, int> > responses;
- std::vector<int>::const_iterator it(randFeatures.begin());
- std::vector<int>::const_iterator end(randFeatures.end());
- std::vector<int>::const_iterator bagIt;
- std::vector<int>::const_iterator bagEnd(inBagSamples.end());
- float fmaxRes = FLT_MIN, fminRes = FLT_MAX;
- float treshdiff = 0.0;
- float curThreshold = 0.0;
- while ( it != end )
- {
- responses.clear();
- responses.reserve(inBagSamples.size());
- bagIt = inBagSamples.begin();
- while ( bagIt != bagEnd )
- {
- responses.push_back(std::pair<float, int>(data(*bagIt,*it),*bagIt));
- ++bagIt;
- }
- sort(responses.begin(), responses.end());
- fminRes = responses.front().first;
- fmaxRes = responses.back().first;
- treshdiff = fmaxRes - fminRes;
- if( treshdiff > 0 ){
- curThreshold = randomDouble(treshmin, treshmax);
- //.......
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement