Python3 warnings

This commit is contained in:
Raúl Marín 2019-12-19 17:04:37 +01:00
parent 550e514726
commit 32b2068648

View File

@ -177,7 +177,6 @@ class GWR(GLM):
W = ak[kernel](coords, bw, points) W = ak[kernel](coords, bw, points)
except: except:
raise TypeError('Unsupported kernel function ', kernel) raise TypeError('Unsupported kernel function ', kernel)
return W return W
def fit(self, ini_params=None, tol=1.0e-5, max_iter=20, solve='iwls'): def fit(self, ini_params=None, tol=1.0e-5, max_iter=20, solve='iwls'):
@ -218,8 +217,7 @@ class GWR(GLM):
p = np.zeros((m, 1)) p = np.zeros((m, 1))
for i in range(m): for i in range(m):
wi = self.W[i].reshape((-1,1)) wi = self.W[i].reshape((-1,1))
rslt = iwls(self.y, self.X, self.family, self.offset, rslt = iwls(self.y, self.X, self.family, self.offset, ini_params, tol, max_iter, wi=wi)
ini_params, tol, max_iter, wi=wi)
params[i,:] = rslt[0].T params[i,:] = rslt[0].T
predy[i] = rslt[1][i] predy[i] = rslt[1][i]
v[i] = rslt[2][i] v[i] = rslt[2][i]
@ -259,7 +257,7 @@ class GWR(GLM):
fit_params : dict fit_params : dict
key-value pairs of parameters that will be passed into fit method to define estimation key-value pairs of parameters that will be passed into fit method to define estimation
routine; see fit method for more details routine; see fit method for more details
""" """
if (exog_scale is None) & (exog_resid is None): if (exog_scale is None) & (exog_resid is None):
train_gwr = self.fit(**fit_params) train_gwr = self.fit(**fit_params)