summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-05-13 17:09:34 -0700
committerChris Dyer <cdyer@cs.cmu.edu>2012-05-13 17:09:34 -0700
commit7001792f10cb17d88ed2d4c58364b6304bbd0816 (patch)
tree65689bf82f97be5834d5d2e570cbad92e5f373f6
parentb56da6f08c4f59b562a102671ac3deb135b0538a (diff)
put creg in its own top-level folder
-rw-r--r--creg/Makefile.am11
-rw-r--r--creg/README7
-rw-r--r--creg/creg.cc (renamed from training/creg.cc)6
-rw-r--r--creg/json_feature_map_lexer.h (renamed from utils/json_feature_map_lexer.h)0
-rw-r--r--creg/json_feature_map_lexer.ll (renamed from utils/json_feature_map_lexer.ll)0
-rw-r--r--creg/test_data/iris.testfeat50
-rw-r--r--creg/test_data/iris.testresp50
-rw-r--r--creg/test_data/iris.trainfeat100
-rw-r--r--creg/test_data/iris.trainresp100
-rw-r--r--training/Makefile.am4
-rw-r--r--training/liblbfgs/lbfgs++.h1
-rw-r--r--utils/Makefile.am4
12 files changed, 322 insertions, 11 deletions
diff --git a/creg/Makefile.am b/creg/Makefile.am
new file mode 100644
index 00000000..9e25b838
--- /dev/null
+++ b/creg/Makefile.am
@@ -0,0 +1,11 @@
+bin_PROGRAMS = \
+ creg
+
+creg_SOURCES = creg.cc json_feature_map_lexer.cc
+creg_LDADD = $(top_srcdir)/training/liblbfgs/liblbfgs.a $(top_srcdir)/utils/libutils.a -lz
+
+json_feature_map_lexer.cc: json_feature_map_lexer.ll
+ $(LEX) -s -8 -CF -o$@ $<
+
+AM_CPPFLAGS = -W -Wall -DNDEBUG -I$(top_srcdir)/utils -I$(top_srcdir)/training
+
diff --git a/creg/README b/creg/README
new file mode 100644
index 00000000..2c04c83b
--- /dev/null
+++ b/creg/README
@@ -0,0 +1,7 @@
+creg is a fast tool for training linear and logistic regression models with
+l_1 and l_2 regularization. Its data (feature and response) format is compatible
+with ARKRegression.
+
+Example invokation:
+$ ./creg -x test_data/iris.trainfeat -y test_data/iris.trainresp --l2 100
+
diff --git a/training/creg.cc b/creg/creg.cc
index 58adea00..43f01bc4 100644
--- a/training/creg.cc
+++ b/creg/creg.cc
@@ -26,7 +26,7 @@ void InitCommandLine(int argc, char** argv, po::variables_map* conf) {
("l1",po::value<double>()->default_value(0.0), "l_1 regularization strength")
("l2",po::value<double>()->default_value(0.0), "l_2 regularization strength")
("weights,w", po::value<string>(), "Initial weights")
- ("epsilon,e", po::value<double>()->default_value(1e-4), "Epsilon for convergence test. Terminates when ||g|| < epsilon * max(1, ||x||)")
+ ("epsilon,e", po::value<double>()->default_value(1e-4), "Epsilon for convergence test. Terminates when ||g|| < epsilon * max(1, ||w||)")
("memory_buffers,m",po::value<unsigned>()->default_value(40), "Number of memory buffers for LBFGS")
("help,h", "Help");
po::options_description dcmdline_options;
@@ -191,7 +191,7 @@ struct UnivariateSquaredLoss : public BaseLoss {
fill(g, g + x.size(), 0.0);
double cll = 0;
vector<double> dotprods(1); // univariate prediction
- for (int i = 0; i < training.size(); ++i) {
+ for (unsigned i = 0; i < training.size(); ++i) {
const SparseVector<float>& fmapx = training[i].x;
const double refy = training[i].y.value;
ComputeDotProducts(fmapx, x, &dotprods);
@@ -219,7 +219,7 @@ struct MulticlassLogLoss : public BaseLoss {
vector<double> dotprods(K - 1); // K-1 degrees of freedom
vector<prob_t> probs(K);
double cll = 0;
- for (int i = 0; i < training.size(); ++i) {
+ for (unsigned i = 0; i < training.size(); ++i) {
const SparseVector<float>& fmapx = training[i].x;
const unsigned refy = training[i].y.label;
//cerr << "FMAP: " << fmapx << endl;
diff --git a/utils/json_feature_map_lexer.h b/creg/json_feature_map_lexer.h
index 3324aa29..3324aa29 100644
--- a/utils/json_feature_map_lexer.h
+++ b/creg/json_feature_map_lexer.h
diff --git a/utils/json_feature_map_lexer.ll b/creg/json_feature_map_lexer.ll
index 372b52f5..372b52f5 100644
--- a/utils/json_feature_map_lexer.ll
+++ b/creg/json_feature_map_lexer.ll
diff --git a/creg/test_data/iris.testfeat b/creg/test_data/iris.testfeat
new file mode 100644
index 00000000..f7528f81
--- /dev/null
+++ b/creg/test_data/iris.testfeat
@@ -0,0 +1,50 @@
+100 {"sepal-length": 4.9, "sepal-width": 2.5, "petal-length": 4.5, "petal-width": 1.7}
+101 {"sepal-length": 6.5, "sepal-width": 3.0, "petal-length": 5.2, "petal-width": 2.0}
+102 {"sepal-length": 4.4, "sepal-width": 3.0, "petal-length": 1.3, "petal-width": 0.2}
+103 {"sepal-length": 5.0, "sepal-width": 3.4, "petal-length": 1.5, "petal-width": 0.2}
+104 {"sepal-length": 5.0, "sepal-width": 3.0, "petal-length": 1.6, "petal-width": 0.2}
+105 {"sepal-length": 5.1, "sepal-width": 3.4, "petal-length": 1.5, "petal-width": 0.2}
+106 {"sepal-length": 5.5, "sepal-width": 2.3, "petal-length": 4.0, "petal-width": 1.3}
+107 {"sepal-length": 5.5, "sepal-width": 2.6, "petal-length": 4.4, "petal-width": 1.2}
+108 {"sepal-length": 5.4, "sepal-width": 3.4, "petal-length": 1.7, "petal-width": 0.2}
+109 {"sepal-length": 5.5, "sepal-width": 2.4, "petal-length": 3.7, "petal-width": 1.0}
+110 {"sepal-length": 6.7, "sepal-width": 3.0, "petal-length": 5.0, "petal-width": 1.7}
+111 {"sepal-length": 6.4, "sepal-width": 2.8, "petal-length": 5.6, "petal-width": 2.2}
+112 {"sepal-length": 5.5, "sepal-width": 4.2, "petal-length": 1.4, "petal-width": 0.2}
+113 {"sepal-length": 5.9, "sepal-width": 3.0, "petal-length": 4.2, "petal-width": 1.5}
+114 {"sepal-length": 4.9, "sepal-width": 3.1, "petal-length": 1.5, "petal-width": 0.1}
+115 {"sepal-length": 7.7, "sepal-width": 2.6, "petal-length": 6.9, "petal-width": 2.3}
+116 {"sepal-length": 5.0, "sepal-width": 3.6, "petal-length": 1.4, "petal-width": 0.2}
+117 {"sepal-length": 6.3, "sepal-width": 2.3, "petal-length": 4.4, "petal-width": 1.3}
+118 {"sepal-length": 6.7, "sepal-width": 3.3, "petal-length": 5.7, "petal-width": 2.1}
+119 {"sepal-length": 5.8, "sepal-width": 2.7, "petal-length": 5.1, "petal-width": 1.9}
+120 {"sepal-length": 5.2, "sepal-width": 2.7, "petal-length": 3.9, "petal-width": 1.4}
+121 {"sepal-length": 5.0, "sepal-width": 3.5, "petal-length": 1.6, "petal-width": 0.6}
+122 {"sepal-length": 5.0, "sepal-width": 3.2, "petal-length": 1.2, "petal-width": 0.2}
+123 {"sepal-length": 6.7, "sepal-width": 3.0, "petal-length": 5.2, "petal-width": 2.3}
+124 {"sepal-length": 5.5, "sepal-width": 2.5, "petal-length": 4.0, "petal-width": 1.3}
+125 {"sepal-length": 5.6, "sepal-width": 3.0, "petal-length": 4.5, "petal-width": 1.5}
+126 {"sepal-length": 6.6, "sepal-width": 3.0, "petal-length": 4.4, "petal-width": 1.4}
+127 {"sepal-length": 5.1, "sepal-width": 3.8, "petal-length": 1.6, "petal-width": 0.2}
+128 {"sepal-length": 5.9, "sepal-width": 3.0, "petal-length": 5.1, "petal-width": 1.8}
+129 {"sepal-length": 6.2, "sepal-width": 3.4, "petal-length": 5.4, "petal-width": 2.3}
+130 {"sepal-length": 5.6, "sepal-width": 2.8, "petal-length": 4.9, "petal-width": 2.0}
+131 {"sepal-length": 5.7, "sepal-width": 2.9, "petal-length": 4.2, "petal-width": 1.3}
+132 {"sepal-length": 6.2, "sepal-width": 2.9, "petal-length": 4.3, "petal-width": 1.3}
+133 {"sepal-length": 6.0, "sepal-width": 3.4, "petal-length": 4.5, "petal-width": 1.6}
+134 {"sepal-length": 5.4, "sepal-width": 3.9, "petal-length": 1.7, "petal-width": 0.4}
+135 {"sepal-length": 6.3, "sepal-width": 3.3, "petal-length": 6.0, "petal-width": 2.5}
+136 {"sepal-length": 6.5, "sepal-width": 3.2, "petal-length": 5.1, "petal-width": 2.0}
+137 {"sepal-length": 5.1, "sepal-width": 2.5, "petal-length": 3.0, "petal-width": 1.1}
+138 {"sepal-length": 4.3, "sepal-width": 3.0, "petal-length": 1.1, "petal-width": 0.1}
+139 {"sepal-length": 5.7, "sepal-width": 2.5, "petal-length": 5.0, "petal-width": 2.0}
+140 {"sepal-length": 6.0, "sepal-width": 2.2, "petal-length": 5.0, "petal-width": 1.5}
+141 {"sepal-length": 6.4, "sepal-width": 3.2, "petal-length": 5.3, "petal-width": 2.3}
+142 {"sepal-length": 6.5, "sepal-width": 2.8, "petal-length": 4.6, "petal-width": 1.5}
+143 {"sepal-length": 5.5, "sepal-width": 3.5, "petal-length": 1.3, "petal-width": 0.2}
+144 {"sepal-length": 4.7, "sepal-width": 3.2, "petal-length": 1.3, "petal-width": 0.2}
+145 {"sepal-length": 4.6, "sepal-width": 3.4, "petal-length": 1.4, "petal-width": 0.3}
+146 {"sepal-length": 5.7, "sepal-width": 2.6, "petal-length": 3.5, "petal-width": 1.0}
+147 {"sepal-length": 5.8, "sepal-width": 2.8, "petal-length": 5.1, "petal-width": 2.4}
+148 {"sepal-length": 7.7, "sepal-width": 2.8, "petal-length": 6.7, "petal-width": 2.0}
+149 {"sepal-length": 6.3, "sepal-width": 2.9, "petal-length": 5.6, "petal-width": 1.8}
diff --git a/creg/test_data/iris.testresp b/creg/test_data/iris.testresp
new file mode 100644
index 00000000..0952e4da
--- /dev/null
+++ b/creg/test_data/iris.testresp
@@ -0,0 +1,50 @@
+100 Iris-virginica
+101 Iris-virginica
+102 Iris-setosa
+103 Iris-setosa
+104 Iris-setosa
+105 Iris-setosa
+106 Iris-versicolor
+107 Iris-versicolor
+108 Iris-setosa
+109 Iris-versicolor
+110 Iris-versicolor
+111 Iris-virginica
+112 Iris-setosa
+113 Iris-versicolor
+114 Iris-setosa
+115 Iris-virginica
+116 Iris-setosa
+117 Iris-versicolor
+118 Iris-virginica
+119 Iris-virginica
+120 Iris-versicolor
+121 Iris-setosa
+122 Iris-setosa
+123 Iris-virginica
+124 Iris-versicolor
+125 Iris-versicolor
+126 Iris-versicolor
+127 Iris-setosa
+128 Iris-virginica
+129 Iris-virginica
+130 Iris-virginica
+131 Iris-versicolor
+132 Iris-versicolor
+133 Iris-versicolor
+134 Iris-setosa
+135 Iris-virginica
+136 Iris-virginica
+137 Iris-versicolor
+138 Iris-setosa
+139 Iris-virginica
+140 Iris-virginica
+141 Iris-virginica
+142 Iris-versicolor
+143 Iris-setosa
+144 Iris-setosa
+145 Iris-setosa
+146 Iris-versicolor
+147 Iris-virginica
+148 Iris-virginica
+149 Iris-virginica
diff --git a/creg/test_data/iris.trainfeat b/creg/test_data/iris.trainfeat
new file mode 100644
index 00000000..a930a446
--- /dev/null
+++ b/creg/test_data/iris.trainfeat
@@ -0,0 +1,100 @@
+0 {"sepal-length": 5.4, "sepal-width": 3.0, "petal-length": 4.5, "petal-width": 1.5}
+1 {"sepal-length": 5.0, "sepal-width": 3.4, "petal-length": 1.6, "petal-width": 0.4}
+2 {"sepal-length": 5.0, "sepal-width": 3.3, "petal-length": 1.4, "petal-width": 0.2}
+3 {"sepal-length": 5.7, "sepal-width": 2.8, "petal-length": 4.5, "petal-width": 1.3}
+4 {"sepal-length": 6.4, "sepal-width": 3.1, "petal-length": 5.5, "petal-width": 1.8}
+5 {"sepal-length": 7.9, "sepal-width": 3.8, "petal-length": 6.4, "petal-width": 2.0}
+6 {"sepal-length": 5.9, "sepal-width": 3.2, "petal-length": 4.8, "petal-width": 1.8}
+7 {"sepal-length": 6.7, "sepal-width": 2.5, "petal-length": 5.8, "petal-width": 1.8}
+8 {"sepal-length": 6.7, "sepal-width": 3.1, "petal-length": 4.4, "petal-width": 1.4}
+9 {"sepal-length": 6.3, "sepal-width": 2.5, "petal-length": 4.9, "petal-width": 1.5}
+10 {"sepal-length": 6.1, "sepal-width": 2.9, "petal-length": 4.7, "petal-width": 1.4}
+11 {"sepal-length": 6.3, "sepal-width": 3.3, "petal-length": 4.7, "petal-width": 1.6}
+12 {"sepal-length": 6.7, "sepal-width": 3.1, "petal-length": 4.7, "petal-width": 1.5}
+13 {"sepal-length": 6.2, "sepal-width": 2.8, "petal-length": 4.8, "petal-width": 1.8}
+14 {"sepal-length": 5.0, "sepal-width": 3.5, "petal-length": 1.3, "petal-width": 0.3}
+15 {"sepal-length": 5.4, "sepal-width": 3.9, "petal-length": 1.3, "petal-width": 0.4}
+16 {"sepal-length": 7.4, "sepal-width": 2.8, "petal-length": 6.1, "petal-width": 1.9}
+17 {"sepal-length": 7.2, "sepal-width": 3.2, "petal-length": 6.0, "petal-width": 1.8}
+18 {"sepal-length": 5.7, "sepal-width": 3.8, "petal-length": 1.7, "petal-width": 0.3}
+19 {"sepal-length": 4.5, "sepal-width": 2.3, "petal-length": 1.3, "petal-width": 0.3}
+20 {"sepal-length": 5.6, "sepal-width": 3.0, "petal-length": 4.1, "petal-width": 1.3}
+21 {"sepal-length": 6.8, "sepal-width": 3.0, "petal-length": 5.5, "petal-width": 2.1}
+22 {"sepal-length": 6.5, "sepal-width": 3.0, "petal-length": 5.8, "petal-width": 2.2}
+23 {"sepal-length": 4.4, "sepal-width": 3.2, "petal-length": 1.3, "petal-width": 0.2}
+24 {"sepal-length": 6.3, "sepal-width": 2.5, "petal-length": 5.0, "petal-width": 1.9}
+25 {"sepal-length": 4.4, "sepal-width": 2.9, "petal-length": 1.4, "petal-width": 0.2}
+26 {"sepal-length": 4.9, "sepal-width": 3.0, "petal-length": 1.4, "petal-width": 0.2}
+27 {"sepal-length": 5.4, "sepal-width": 3.4, "petal-length": 1.5, "petal-width": 0.4}
+28 {"sepal-length": 5.8, "sepal-width": 2.7, "petal-length": 3.9, "petal-width": 1.2}
+29 {"sepal-length": 5.6, "sepal-width": 2.5, "petal-length": 3.9, "petal-width": 1.1}
+30 {"sepal-length": 5.1, "sepal-width": 3.5, "petal-length": 1.4, "petal-width": 0.3}
+31 {"sepal-length": 5.6, "sepal-width": 2.7, "petal-length": 4.2, "petal-width": 1.3}
+32 {"sepal-length": 5.1, "sepal-width": 3.5, "petal-length": 1.4, "petal-width": 0.2}
+33 {"sepal-length": 6.4, "sepal-width": 2.7, "petal-length": 5.3, "petal-width": 1.9}
+34 {"sepal-length": 5.8, "sepal-width": 4.0, "petal-length": 1.2, "petal-width": 0.2}
+35 {"sepal-length": 5.2, "sepal-width": 3.4, "petal-length": 1.4, "petal-width": 0.2}
+36 {"sepal-length": 7.6, "sepal-width": 3.0, "petal-length": 6.6, "petal-width": 2.1}
+37 {"sepal-length": 5.8, "sepal-width": 2.7, "petal-length": 5.1, "petal-width": 1.9}
+38 {"sepal-length": 6.0, "sepal-width": 2.2, "petal-length": 4.0, "petal-width": 1.0}
+39 {"sepal-length": 7.7, "sepal-width": 3.0, "petal-length": 6.1, "petal-width": 2.3}
+40 {"sepal-length": 5.1, "sepal-width": 3.7, "petal-length": 1.5, "petal-width": 0.4}
+41 {"sepal-length": 6.1, "sepal-width": 2.6, "petal-length": 5.6, "petal-width": 1.4}
+42 {"sepal-length": 6.7, "sepal-width": 3.1, "petal-length": 5.6, "petal-width": 2.4}
+43 {"sepal-length": 7.7, "sepal-width": 3.8, "petal-length": 6.7, "petal-width": 2.2}
+44 {"sepal-length": 5.1, "sepal-width": 3.3, "petal-length": 1.7, "petal-width": 0.5}
+45 {"sepal-length": 6.3, "sepal-width": 2.8, "petal-length": 5.1, "petal-width": 1.5}
+46 {"sepal-length": 5.0, "sepal-width": 2.0, "petal-length": 3.5, "petal-width": 1.0}
+47 {"sepal-length": 5.1, "sepal-width": 3.8, "petal-length": 1.5, "petal-width": 0.3}
+48 {"sepal-length": 4.9, "sepal-width": 3.1, "petal-length": 1.5, "petal-width": 0.1}
+49 {"sepal-length": 6.1, "sepal-width": 3.0, "petal-length": 4.9, "petal-width": 1.8}
+50 {"sepal-length": 6.4, "sepal-width": 2.8, "petal-length": 5.6, "petal-width": 2.1}
+51 {"sepal-length": 6.5, "sepal-width": 3.0, "petal-length": 5.5, "petal-width": 1.8}
+52 {"sepal-length": 6.1, "sepal-width": 2.8, "petal-length": 4.7, "petal-width": 1.2}
+53 {"sepal-length": 6.1, "sepal-width": 2.8, "petal-length": 4.0, "petal-width": 1.3}
+54 {"sepal-length": 4.9, "sepal-width": 3.1, "petal-length": 1.5, "petal-width": 0.1}
+55 {"sepal-length": 6.8, "sepal-width": 2.8, "petal-length": 4.8, "petal-width": 1.4}
+56 {"sepal-length": 6.3, "sepal-width": 2.7, "petal-length": 4.9, "petal-width": 1.8}
+57 {"sepal-length": 4.6, "sepal-width": 3.2, "petal-length": 1.4, "petal-width": 0.2}
+58 {"sepal-length": 6.3, "sepal-width": 3.4, "petal-length": 5.6, "petal-width": 2.4}
+59 {"sepal-length": 5.7, "sepal-width": 4.4, "petal-length": 1.5, "petal-width": 0.4}
+60 {"sepal-length": 6.4, "sepal-width": 2.9, "petal-length": 4.3, "petal-width": 1.3}
+61 {"sepal-length": 7.2, "sepal-width": 3.6, "petal-length": 6.1, "petal-width": 2.5}
+62 {"sepal-length": 5.8, "sepal-width": 2.7, "petal-length": 4.1, "petal-width": 1.0}
+63 {"sepal-length": 6.0, "sepal-width": 3.0, "petal-length": 4.8, "petal-width": 1.8}
+64 {"sepal-length": 4.7, "sepal-width": 3.2, "petal-length": 1.6, "petal-width": 0.2}
+65 {"sepal-length": 6.9, "sepal-width": 3.2, "petal-length": 5.7, "petal-width": 2.3}
+66 {"sepal-length": 6.4, "sepal-width": 3.2, "petal-length": 4.5, "petal-width": 1.5}
+67 {"sepal-length": 6.9, "sepal-width": 3.1, "petal-length": 5.4, "petal-width": 2.1}
+68 {"sepal-length": 5.2, "sepal-width": 3.5, "petal-length": 1.5, "petal-width": 0.2}
+69 {"sepal-length": 5.3, "sepal-width": 3.7, "petal-length": 1.5, "petal-width": 0.2}
+70 {"sepal-length": 5.5, "sepal-width": 2.4, "petal-length": 3.8, "petal-width": 1.1}
+71 {"sepal-length": 4.8, "sepal-width": 3.4, "petal-length": 1.9, "petal-width": 0.2}
+72 {"sepal-length": 5.7, "sepal-width": 2.8, "petal-length": 4.1, "petal-width": 1.3}
+73 {"sepal-length": 4.9, "sepal-width": 2.4, "petal-length": 3.3, "petal-width": 1.0}
+74 {"sepal-length": 6.2, "sepal-width": 2.2, "petal-length": 4.5, "petal-width": 1.5}
+75 {"sepal-length": 6.7, "sepal-width": 3.3, "petal-length": 5.7, "petal-width": 2.5}
+76 {"sepal-length": 6.1, "sepal-width": 3.0, "petal-length": 4.6, "petal-width": 1.4}
+77 {"sepal-length": 4.6, "sepal-width": 3.6, "petal-length": 1.0, "petal-width": 0.2}
+78 {"sepal-length": 7.0, "sepal-width": 3.2, "petal-length": 4.7, "petal-width": 1.4}
+79 {"sepal-length": 6.6, "sepal-width": 2.9, "petal-length": 4.6, "petal-width": 1.3}
+80 {"sepal-length": 5.4, "sepal-width": 3.7, "petal-length": 1.5, "petal-width": 0.2}
+81 {"sepal-length": 4.8, "sepal-width": 3.0, "petal-length": 1.4, "petal-width": 0.3}
+82 {"sepal-length": 7.2, "sepal-width": 3.0, "petal-length": 5.8, "petal-width": 1.6}
+83 {"sepal-length": 7.1, "sepal-width": 3.0, "petal-length": 5.9, "petal-width": 2.1}
+84 {"sepal-length": 6.9, "sepal-width": 3.1, "petal-length": 4.9, "petal-width": 1.5}
+85 {"sepal-length": 4.8, "sepal-width": 3.0, "petal-length": 1.4, "petal-width": 0.1}
+86 {"sepal-length": 7.3, "sepal-width": 2.9, "petal-length": 6.3, "petal-width": 1.8}
+87 {"sepal-length": 6.0, "sepal-width": 2.7, "petal-length": 5.1, "petal-width": 1.6}
+88 {"sepal-length": 6.8, "sepal-width": 3.2, "petal-length": 5.9, "petal-width": 2.3}
+89 {"sepal-length": 4.6, "sepal-width": 3.1, "petal-length": 1.5, "petal-width": 0.2}
+90 {"sepal-length": 4.8, "sepal-width": 3.1, "petal-length": 1.6, "petal-width": 0.2}
+91 {"sepal-length": 5.0, "sepal-width": 2.3, "petal-length": 3.3, "petal-width": 1.0}
+92 {"sepal-length": 6.9, "sepal-width": 3.1, "petal-length": 5.1, "petal-width": 2.3}
+93 {"sepal-length": 5.7, "sepal-width": 3.0, "petal-length": 4.2, "petal-width": 1.2}
+94 {"sepal-length": 5.1, "sepal-width": 3.8, "petal-length": 1.9, "petal-width": 0.4}
+95 {"sepal-length": 6.0, "sepal-width": 2.9, "petal-length": 4.5, "petal-width": 1.5}
+96 {"sepal-length": 4.8, "sepal-width": 3.4, "petal-length": 1.6, "petal-width": 0.2}
+97 {"sepal-length": 5.2, "sepal-width": 4.1, "petal-length": 1.5, "petal-width": 0.1}
+98 {"sepal-length": 5.6, "sepal-width": 2.9, "petal-length": 3.6, "petal-width": 1.3}
+99 {"sepal-length": 5.8, "sepal-width": 2.6, "petal-length": 4.0, "petal-width": 1.2}
diff --git a/creg/test_data/iris.trainresp b/creg/test_data/iris.trainresp
new file mode 100644
index 00000000..d77bc6a2
--- /dev/null
+++ b/creg/test_data/iris.trainresp
@@ -0,0 +1,100 @@
+0 Iris-versicolor
+1 Iris-setosa
+2 Iris-setosa
+3 Iris-versicolor
+4 Iris-virginica
+5 Iris-virginica
+6 Iris-versicolor
+7 Iris-virginica
+8 Iris-versicolor
+9 Iris-versicolor
+10 Iris-versicolor
+11 Iris-versicolor
+12 Iris-versicolor
+13 Iris-virginica
+14 Iris-setosa
+15 Iris-setosa
+16 Iris-virginica
+17 Iris-virginica
+18 Iris-setosa
+19 Iris-setosa
+20 Iris-versicolor
+21 Iris-virginica
+22 Iris-virginica
+23 Iris-setosa
+24 Iris-virginica
+25 Iris-setosa
+26 Iris-setosa
+27 Iris-setosa
+28 Iris-versicolor
+29 Iris-versicolor
+30 Iris-setosa
+31 Iris-versicolor
+32 Iris-setosa
+33 Iris-virginica
+34 Iris-setosa
+35 Iris-setosa
+36 Iris-virginica
+37 Iris-virginica
+38 Iris-versicolor
+39 Iris-virginica
+40 Iris-setosa
+41 Iris-virginica
+42 Iris-virginica
+43 Iris-virginica
+44 Iris-setosa
+45 Iris-virginica
+46 Iris-versicolor
+47 Iris-setosa
+48 Iris-setosa
+49 Iris-virginica
+50 Iris-virginica
+51 Iris-virginica
+52 Iris-versicolor
+53 Iris-versicolor
+54 Iris-setosa
+55 Iris-versicolor
+56 Iris-virginica
+57 Iris-setosa
+58 Iris-virginica
+59 Iris-setosa
+60 Iris-versicolor
+61 Iris-virginica
+62 Iris-versicolor
+63 Iris-virginica
+64 Iris-setosa
+65 Iris-virginica
+66 Iris-versicolor
+67 Iris-virginica
+68 Iris-setosa
+69 Iris-setosa
+70 Iris-versicolor
+71 Iris-setosa
+72 Iris-versicolor
+73 Iris-versicolor
+74 Iris-versicolor
+75 Iris-virginica
+76 Iris-versicolor
+77 Iris-setosa
+78 Iris-versicolor
+79 Iris-versicolor
+80 Iris-setosa
+81 Iris-setosa
+82 Iris-virginica
+83 Iris-virginica
+84 Iris-versicolor
+85 Iris-setosa
+86 Iris-virginica
+87 Iris-versicolor
+88 Iris-virginica
+89 Iris-setosa
+90 Iris-setosa
+91 Iris-versicolor
+92 Iris-virginica
+93 Iris-versicolor
+94 Iris-setosa
+95 Iris-versicolor
+96 Iris-setosa
+97 Iris-setosa
+98 Iris-versicolor
+99 Iris-versicolor
diff --git a/training/Makefile.am b/training/Makefile.am
index 4b69ea94..991ac210 100644
--- a/training/Makefile.am
+++ b/training/Makefile.am
@@ -1,6 +1,5 @@
bin_PROGRAMS = \
model1 \
- creg \
lbl_model \
test_ngram \
mr_em_map_adapter \
@@ -24,9 +23,6 @@ noinst_PROGRAMS = \
TESTS = lbfgs_test optimize_test
-creg_SOURCES = creg.cc
-creg_LDADD = ./liblbfgs/liblbfgs.a $(top_srcdir)/utils/libutils.a -lz
-
mpi_online_optimize_SOURCES = mpi_online_optimize.cc online_optimizer.cc
mpi_online_optimize_LDADD = $(top_srcdir)/decoder/libcdec.a $(top_srcdir)/mteval/libmteval.a $(top_srcdir)/utils/libutils.a ../klm/lm/libklm.a ../klm/util/libklm_util.a -lz
diff --git a/training/liblbfgs/lbfgs++.h b/training/liblbfgs/lbfgs++.h
index 92ead955..2b40c19b 100644
--- a/training/liblbfgs/lbfgs++.h
+++ b/training/liblbfgs/lbfgs++.h
@@ -90,6 +90,7 @@ class LBFGS {
lbfgsfloatval_t *g,
const int n,
const lbfgsfloatval_t step) {
+ (void) x;
(void) n;
(void) step;
if (!silence) { ec++; std::cerr << '.'; }
diff --git a/utils/Makefile.am b/utils/Makefile.am
index b7da0f06..46650c75 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -33,16 +33,12 @@ libutils_a_SOURCES = \
sparse_vector.cc \
timing_stats.cc \
verbose.cc \
- json_feature_map_lexer.cc \
weights.cc
if HAVE_CMPH
libutils_a_SOURCES += perfect_hash.cc
endif
-json_feature_map_lexer.cc: json_feature_map_lexer.ll
- $(LEX) -s -8 -CF -o$@ $<
-
phmt_SOURCES = phmt.cc
ts_SOURCES = ts.cc
m_test_SOURCES = m_test.cc