Sha256: 780684ca7236e4c99a4e7fd81dea7f5d6dde4925d6b1ca6282a16a9a1c9f1152
Contents?: true
Size: 1.11 KB
Versions: 7
Compression:
Stored size: 1.11 KB
Contents
#ifndef __sparse_data_set_h__ #define __sparse_data_set_h__ #include "data_set/data_set.h" #include "sparse_example.h" namespace DataSet { class SparseDataSet : public DataSet { void perform_count() { int example_category_index = 0; SparseExample::Value *value; for(vector<Example *>::iterator example = examples.begin(); example < examples.end(); example++) { example_category_index = (int)((*example)->get_value(category_index)); for(int i = 0; i < (*example)->size; i++) { value = &(((SparseExample *)(*example))->values[i]); features[value->index]->count_example(value->value, example_category_index); } } } void perform_index() { } public: SparseDataSet() : DataSet() {} SparseDataSet(DataSet *other) : DataSet(other) {} SparseDataSet *clone_without_examples() { return new SparseDataSet(this); } SparseExample *new_example(int buffer_size = 0) { SparseExample *example = new SparseExample(buffer_size); examples.push_back(example); return example; } }; } #endif
Version data entries
7 entries across 7 versions & 1 rubygems