From: Jason Stover Date: Mon, 10 Apr 2006 00:25:33 +0000 (+0000) Subject: fixed prediction bug X-Git-Tag: v0.6.0~994 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=762f47ec7fcfe1bfd9a404dae6ce285e61b1df57;p=pspp-builds.git fixed prediction bug --- diff --git a/src/math/linreg/coefficient.c b/src/math/linreg/coefficient.c index 5efde99e..2154ffe4 100644 --- a/src/math/linreg/coefficient.c +++ b/src/math/linreg/coefficient.c @@ -209,7 +209,7 @@ pspp_linreg_get_coeff (const pspp_linreg_cache * c, tmp = pspp_linreg_coeff_get_var (result, 0); i++; } - if (i == c->n_coeffs) + if (i > c->n_coeffs) { return NULL; } diff --git a/src/math/linreg/predict.c b/src/math/linreg/predict.c index 0bab23c8..49e24434 100644 --- a/src/math/linreg/predict.c +++ b/src/math/linreg/predict.c @@ -62,7 +62,7 @@ pspp_linreg_predict (const struct variable **predictors, { coe = pspp_linreg_get_coeff (c, predictors[j], vals[j]); i = 1; - while (found[i] != coe && i < c->n_coeffs) + while (found[i] == coe && i < c->n_coeffs) { i++; }