From 5e1ab3481551607f1c2a10027049044cd41f78ab Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sat, 24 Sep 2011 23:46:49 +0200 Subject: cleaning up --- dtrain/test/logreg/bin_class.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 dtrain/test/logreg/bin_class.h (limited to 'dtrain/test/logreg/bin_class.h') diff --git a/dtrain/test/logreg/bin_class.h b/dtrain/test/logreg/bin_class.h new file mode 100644 index 00000000..3466109a --- /dev/null +++ b/dtrain/test/logreg/bin_class.h @@ -0,0 +1,22 @@ +#ifndef _BIN_CLASS_H_ +#define _BIN_CLASS_H_ + +#include +#include "sparse_vector.h" + +struct TrainingInstance { + // TODO add other info? loss for MIRA-type updates? + SparseVector x_feature_map; + bool y; +}; + +struct Objective { + virtual ~Objective(); + + // returns f(x) and f'(x) + virtual double ObjectiveAndGradient(const SparseVector& x, + const std::vector& training_instances, + SparseVector* g) const = 0; +}; + +#endif -- cgit v1.2.3