[pktools] 37/375: before doxygen

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:53:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch upstream-master
in repository pktools.

commit 843bdf715e37ac5b0e3b4cf87f4c7359957d71c1
Author: Pieter Kempeneers <kempenep at gmail.com>
Date:   Thu Jan 24 12:31:50 2013 +0100

    before doxygen
---
 ChangeLog                  | 2 ++
 src/apps/pkclassify_nn.cc  | 2 +-
 src/apps/pkclassify_svm.cc | 2 +-
 src/apps/pkopt_svm.cc      | 7 +++++--
 4 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3c7a046..93b1c13 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,8 +65,10 @@ version 2.4
  - pkclassify_svm
 	do not output input file if no input data was defined in verbose mode
 	update of header information
+	adding some short options
  - pkclassify_nn
 	support of cross validation
+	adding some short options
  - pkfs_svm (added)
 	feature selection tool for svm classification
  - pkfs_nn (added)
diff --git a/src/apps/pkclassify_nn.cc b/src/apps/pkclassify_nn.cc
index c9f678a..a8574d1 100644
--- a/src/apps/pkclassify_nn.cc
+++ b/src/apps/pkclassify_nn.cc
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
   Optionpk<string>  otype_opt("ot", "otype", "Data type for output image ({Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/CInt16/CInt32/CFloat32/CFloat64}). Empty string: inherit type from input image");
   Optionpk<string>  oformat_opt("of", "oformat", "Output image format (see also gdal_translate). Empty string: inherit from input image");
   Optionpk<string> option_opt("co", "co", "options: NAME=VALUE [-co COMPRESS=LZW] [-co INTERLEAVE=BAND]");
-  Optionpk<string> colorTable_opt("\0", "ct", "colour table in ascii format having 5 columns: id R G B ALFA (0: transparent, 255: solid)"); 
+  Optionpk<string> colorTable_opt("ct", "ct", "colour table in ascii format having 5 columns: id R G B ALFA (0: transparent, 255: solid)"); 
   Optionpk<string> prob_opt("\0", "prob", "probability image. Default is no probability image"); 
   Optionpk<short> verbose_opt("v", "verbose", "set to: 0 (results only), 1 (confusion matrix), 2 (debug)",0);
 
diff --git a/src/apps/pkclassify_svm.cc b/src/apps/pkclassify_svm.cc
index 2e36ce1..3c86021 100644
--- a/src/apps/pkclassify_svm.cc
+++ b/src/apps/pkclassify_svm.cc
@@ -137,7 +137,7 @@ int main(int argc, char *argv[])
   Optionpk<string> output_opt("o", "output", "output classification image"); 
   Optionpk<string>  oformat_opt("of", "oformat", "Output image format (see also gdal_translate). Empty string: inherit from input image");
   Optionpk<string> option_opt("co", "co", "options: NAME=VALUE [-co COMPRESS=LZW] [-co INTERLEAVE=BAND]");
-  Optionpk<string> colorTable_opt("\0", "ct", "colour table in ascii format having 5 columns: id R G B ALFA (0: transparent, 255: solid)"); 
+  Optionpk<string> colorTable_opt("ct", "ct", "colour table in ascii format having 5 columns: id R G B ALFA (0: transparent, 255: solid)"); 
   Optionpk<string> prob_opt("\0", "prob", "probability image."); 
   Optionpk<short> verbose_opt("v", "verbose", "set to: 0 (results only), 1 (confusion matrix), 2 (debug)",0);
 
diff --git a/src/apps/pkopt_svm.cc b/src/apps/pkopt_svm.cc
index 517f321..29ff82e 100644
--- a/src/apps/pkopt_svm.cc
+++ b/src/apps/pkopt_svm.cc
@@ -50,6 +50,7 @@ Optionpk<int> cache_opt("cache", "cache", "cache memory size in MB",100);
 Optionpk<float> epsilon_tol_opt("etol", "etol", "the tolerance of termination criterion",0.001);
 Optionpk<bool> shrinking_opt("shrink", "shrink", "whether to use the shrinking heuristics",false);
 Optionpk<bool> prob_est_opt("pe", "probest", "whether to train a SVC or SVR model for probability estimates",false);
+Optionpk<bool> costfunction_opt("cf", "cf", "use Overall Accuracy instead of kappa",false);
 // Optionpk<bool> weight_opt("wi", "wi", "set the parameter C of class i to weight*C, for C-SVC",true);
 Optionpk<unsigned short> cv_opt("cv", "cv", "n-fold cross validation mode",2);
 Optionpk<short> verbose_opt("v", "verbose", "set to: 0 (results only), 1 (confusion matrix), 2 (debug)",0);
@@ -142,8 +143,9 @@ double objFunction(const std::vector<double> &x, std::vector<double> &grad, void
     std::cout << "oa: " << oa << std::endl;
     std::cout << "kappa: " << kappa << std::endl;
   }
-  if(oa)
-    error=1.0/oa;
+  double cost=(costfunction_opt[0])? oa : kappa;
+  if(cost)
+    error=1.0/cost;
   return(error);
 }
 
@@ -204,6 +206,7 @@ int main(int argc, char *argv[])
   shrinking_opt.retrieveOption(argc,argv);
   prob_est_opt.retrieveOption(argc,argv);
   cv_opt.retrieveOption(argc,argv);
+  costfunction_opt.retrieveOption(argc,argv);
   maxit_opt.retrieveOption(argc,argv);
   tolerance_opt.retrieveOption(argc,argv);
   algorithm_opt.retrieveOption(argc,argv);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/pktools.git



More information about the Pkg-grass-devel mailing list