]> git.sesse.net Git - wloh/blobdiff - train.pl
Compute and calculate standard deviations.
[wloh] / train.pl
index 22a2741ccb8b12a71a81d1d9c065461cc4f00dd3..67b2b8d737e49f0dbde6f004923cc8f6af7b5c83 100755 (executable)
--- a/train.pl
+++ b/train.pl
@@ -56,13 +56,13 @@ while (my $ref = $q->fetchrow_hashref) {
 close DATA;
 
 $dbh->do('DELETE FROM ratings');
-my $iq = $dbh->prepare('INSERT INTO ratings ( id, rating ) VALUES (?, ?)');
+my $iq = $dbh->prepare('INSERT INTO ratings ( id, rating, rating_stddev ) VALUES (?, ?, ?)');
 
 open RATINGS, "$config::base_dir/bayeswf < $tmpnam |"
        or die "bayeswf: $!";
 while (<RATINGS>) {
-       /(.*) (.*)/ or next;
-       $iq->execute($2, $1);
+       /(.*) (.*) (.*)/ or next;
+       $iq->execute($3, $1, $2);
 }
 
 $dbh->commit;