Sha256: 4092cb8d15283e209da1f6098a27b39d344c23e904dc1a472bbffb569bb3150c

Contents?: true

Size: 683 Bytes

Versions: 8

Compression:

Stored size: 683 Bytes

Contents

#ifndef __local_weight_h__
#define __local_weight_h__
#include "preprocessing/examples/example_preprocessor.h"

namespace Preprocessing {
  namespace Examples {
    
    class LocalWeight : public ExamplePreprocessor {
      void process(DataSet::Example *example) {
        int max_value = 0;
        double value;
        
        for(int i = 0; i < example->size; i++) {
          value = example->get_value(i);
          if(value > max_value)
            max_value = value;
        }
        
        for(int i = 0; i < example->size; i++) {
          value = example->get_value(i);
          example->set_value(i, value / max_value);
        }
      }
    };
    
  }
}

#endif

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
thera-0.0.8 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.7 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.6 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.5 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.4 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.3 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.2 lib/quarry/src/preprocessing/examples/weights/local_weight.h
thera-0.0.1 lib/quarry/src/preprocessing/examples/weights/local_weight.h