Sha256: 57f366c81176c3fa6fe10c58058c3176f232ecba43d47e21284af291137436ed

Contents?: true

Size: 1.02 KB

Versions: 7

Compression:

Stored size: 1.02 KB

Contents

#ifndef __dense_data_set_h__
#define __dense_data_set_h__
#include "dense_example.h"

namespace DataSet {
  class DenseDataSet : public DataSet {
    void perform_count() {
      int example_category_index = 0;
      double value = 0.0;
      
      for(vector<Example *>::iterator example = examples.begin(); example < examples.end(); example++) {
        example_category_index = (int)((*example)->get_value(category_index));
        for(unsigned int i = 0; i < features.size(); i++) {
          value = (*example)->get_value(i);
          features[i]->count_example(value, example_category_index);
        }
      }
    }
    
    void perform_index() {
    }
    
  public:
    DenseDataSet() : DataSet() {}
    DenseDataSet(DataSet *other) : DataSet(other) {}
    
    DenseDataSet *clone_without_examples() {
      return new DenseDataSet(this);
    }
    
    DenseExample *new_example() {
      DenseExample *example = new DenseExample(features.size());
      examples.push_back(example);
      return example;
    }
  };
}

#endif

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
thera-0.0.7 lib/quarry/src/data_set/dense/dense_data_set.h
thera-0.0.6 lib/quarry/src/data_set/dense/dense_data_set.h
thera-0.0.5 lib/quarry/src/data_set/dense/dense_data_set.h
thera-0.0.4 lib/quarry/src/data_set/dense/dense_data_set.h
thera-0.0.3 lib/quarry/src/data_set/dense/dense_data_set.h
thera-0.0.2 lib/quarry/src/data_set/dense/dense_data_set.h
thera-0.0.1 lib/quarry/src/data_set/dense/dense_data_set.h