From 1985c1273bb6ab23b54878a579a5f1b65968eab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Thu, 19 Dec 2019 17:48:38 +0100 Subject: [PATCH] More tabs --- src/py/crankshaft/crankshaft/regression/glm/iwls.py | 8 ++++---- .../crankshaft/crankshaft/regression/gwr/base/search.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/py/crankshaft/crankshaft/regression/glm/iwls.py b/src/py/crankshaft/crankshaft/regression/glm/iwls.py index 289ba52..0756e87 100644 --- a/src/py/crankshaft/crankshaft/regression/glm/iwls.py +++ b/src/py/crankshaft/crankshaft/regression/glm/iwls.py @@ -49,7 +49,7 @@ def iwls(y, x, family, offset=1.0, ini_betas=None, tol=1.0e-8, max_iter=200, wi= if isinstance(family, Binomial): y = family.link._clean(y) if isinstance(family, Poisson): - y_off = y/offset + y_off = y/offset y_off = family.starting_mu(y_off) v = family.predict(y_off) mu = family.starting_mu(y) @@ -58,13 +58,13 @@ def iwls(y, x, family, offset=1.0, ini_betas=None, tol=1.0e-8, max_iter=200, wi= v = family.predict(mu) while diff > tol and n_iter < max_iter: - n_iter += 1 + n_iter += 1 w = family.weights(mu) z = v + (family.link.deriv(mu)*(y-mu)) w = np.sqrt(w) if type(x) != np.ndarray: - w = sp.csr_matrix(w) - z = sp.csr_matrix(z) + w = sp.csr_matrix(w) + z = sp.csr_matrix(z) wx = spmultiply(x, w, array_out=False) wz = spmultiply(z, w, array_out=False) if wi is None: diff --git a/src/py/crankshaft/crankshaft/regression/gwr/base/search.py b/src/py/crankshaft/crankshaft/regression/gwr/base/search.py index c559da5..26e3fdd 100644 --- a/src/py/crankshaft/crankshaft/regression/gwr/base/search.py +++ b/src/py/crankshaft/crankshaft/regression/gwr/base/search.py @@ -47,14 +47,14 @@ def golden_section(a, c, delta, function, tol, max_iter, int_score=False): while np.abs(diff) > tol and iters < max_iter: iters += 1 if int_score: - b = np.round(b) - d = np.round(d) + b = np.round(b) + d = np.round(d) score_a = function(a) score_b = function(b) score_c = function(c) score_d = function(d) - + if score_b <= score_d: opt_val = b opt_score = score_b @@ -73,7 +73,7 @@ def golden_section(a, c, delta, function, tol, max_iter, int_score=False): #d = np.round(b) #if int_score: - # opt_val = np.round(opt_val) + # opt_val = np.round(opt_val) output.append((opt_val, opt_score)) diff = score_b - score_d score = opt_score