Advertisement
Guest User

Untitled

a guest
Feb 19th, 2012
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. void doSomething(const std::vector<int> & randFeatures, const std::vector<int>& inBagSamples, const matrix<float>& data ){
  2.  
  3.         std::vector<std::pair<float, int> > responses;
  4.  
  5.         std::vector<int>::const_iterator it(randFeatures.begin());
  6.         std::vector<int>::const_iterator end(randFeatures.end());
  7.         while ( it != end )
  8.         {
  9.             responses.clear();
  10.             responses.reserve(inBagSamples.size());
  11.             bagIt = inBagSamples.begin();
  12.             while ( bagIt != bagEnd )
  13.             {
  14.                 responses.push_back(std::pair<float, int>(data(*bagIt,*it),*bagIt));
  15.                 ++bagIt;
  16.             }
  17.             sort(responses.begin(), responses.end());
  18.             fminRes = responses.front().first;
  19.             fmaxRes = responses.back().first;
  20.            
  21.             treshdiff = fmaxRes - fminRes;
  22.            
  23.             if( treshdiff > 0 ){
  24.  
  25.                 curThreshold      = randomDouble(treshmin, treshmax);
  26.                 //.......
  27.             }
  28.  
  29.         }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement