From dbb6b0fe3e32a04aad1545a68de5ece1b59c0be6 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Sat, 13 Mar 2010 10:07:43 +0100 Subject: [PATCH] bayes.pl: Fix deg --- bayes.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bayes.pl b/bayes.pl index 57a80c3..5c9dc38 100755 --- a/bayes.pl +++ b/bayes.pl @@ -22,7 +22,7 @@ while (

) { @_ = split(/,\s*/); my $n = $_[$dim + 2]; next unless $input{$_[0]}; - $output{$_[0]} = POSIX::floor($deg*$n/10); + $output{$_[0]} = POSIX::floor($deg*($n-1)/10); } close P; @@ -63,6 +63,7 @@ foreach my $fold (@folds) { my $p = $nb->predict(attributes=>$input{$pl}); my @sp = sort {$p->{$b} <=> $p->{$a}} keys %$p; my $top = $sp[0]; $top =~ s/div=//; + # my $top = rand($deg); - for comparing with random classifier # rescale to [-1,1] and calculate squared error my $se = (($output{$pl} - $top) * 2 / $deg) ** 2; $mse += $se; -- 2.11.4.GIT