diff --git a/src/py/crankshaft/crankshaft/regression/gwr/gwr.py b/src/py/crankshaft/crankshaft/regression/gwr/gwr.py index 155b95b..5b273a7 100644 --- a/src/py/crankshaft/crankshaft/regression/gwr/gwr.py +++ b/src/py/crankshaft/crankshaft/regression/gwr/gwr.py @@ -35,8 +35,8 @@ def gwr(subquery, dep_var, ind_vars, fixed=False, kernel='bisquare'): stand_errs = model.bse.reshape((-1)) predicted = np.repeat(model.predy.reshape((-1,)), k+1) residuals = np.repeat(model.resid_response.reshape((-1,)), k+1) - r_squared = np.tile(model.localR2.reshape((-1,)), k+1) + r_squared = np.repeat(model.localR2.reshape((-1,)), k+1) rowid = np.tile(rowid, k+1).reshape((-1,)) - var_name = np.tile(ind_vars, k+1).reshape((-1,)) - + ind_vars.insert(0, 'intercept') + var_name = np.tile(ind_vars, n).reshape((-1,)) return zip(coefficients, stand_errs, t_vals, predicted, residuals, r_squared, rowid, var_name)