[pktools] 98/375: pkclassify_nn.cc bring result to scale [0:1]

Bas Couwenberg sebastic at xs4all.nl
Wed Dec 3 21:54:03 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 9dba6dd0fbdb91cb9d8321d7bae5cbdb7e80dc8c
Author: user <user at osgeolive.(none)>
Date:   Thu Apr 25 15:28:26 2013 +0200

    pkclassify_nn.cc bring result to scale [0:1]
---
 doc/createappsdox.sh      | 2 +-
 src/apps/pkclassify_nn.cc | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/createappsdox.sh b/doc/createappsdox.sh
index fb69da6..57b1942 100755
--- a/doc/createappsdox.sh
+++ b/doc/createappsdox.sh
@@ -60,4 +60,4 @@ echo "Savannah repository for homepage can only be maintained via cvs"
 #rsync -avz <orig html>/ ~/tmp/pktools/html
 #cvs add *
 #cvs commit -m "update of repository homepage"
-#rm -r ~/tmp/pktools
\ No newline at end of file
+#rm -r ~/tmp/pktools
diff --git a/src/apps/pkclassify_nn.cc b/src/apps/pkclassify_nn.cc
index f59d2a5..d67d1d4 100644
--- a/src/apps/pkclassify_nn.cc
+++ b/src/apps/pkclassify_nn.cc
@@ -795,6 +795,7 @@ int main(int argc, char *argv[])
 	      normPrior+=linePrior[iclass][icol];
 	  }
           for(int iclass=0;iclass<nclass;++iclass){
+	    result[iclass]=(result[iclass]+1.0)/2.0;//bring back to scale [0,1]
 	    if(priorimg_opt.size())
 	      priors[iclass]=linePrior[iclass][icol]/normPrior;//todo: check if correct for all cases... (automatic classValueMap and manual input for names and values)
             switch(comb_opt[0]){
@@ -979,6 +980,7 @@ int main(int argc, char *argv[])
           }
           //calculate posterior prob of bag 
           for(int iclass=0;iclass<nclass;++iclass){
+	    result[iclass]=(result[iclass]+1.0)/2.0;//bring back to scale [0,1]
             switch(comb_opt[0]){
             default:
             case(0)://sum rule

-- 
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