[Scipy-svn] r2312 - trunk/Lib/sandbox/models
scipy-svn at scipy.org
scipy-svn at scipy.org
Wed Nov 8 01:02:40 EST 2006
Author: timl
Date: 2006-11-08 00:02:34 -0600 (Wed, 08 Nov 2006)
New Revision: 2312
Modified:
trunk/Lib/sandbox/models/model.py
trunk/Lib/sandbox/models/rlm.py
Log:
remove unused/needed **keywords args
Modified: trunk/Lib/sandbox/models/model.py
===================================================================
--- trunk/Lib/sandbox/models/model.py 2006-11-08 06:01:28 UTC (rev 2311)
+++ trunk/Lib/sandbox/models/model.py 2006-11-08 06:02:34 UTC (rev 2312)
@@ -11,10 +11,10 @@
but lays out the methods expected of any subclass.
"""
- def __init__(self, **keywords):
+ def __init__(self):
pass
- def initialize(self, **keywords):
+ def initialize(self):
"""
Initialize (possibly re-initialize) a Model instance. For
instance, the design matrix of a linear model may change
@@ -22,20 +22,20 @@
"""
raise NotImplementedError
- def fit(self, **keywords):
+ def fit(self):
"""
Fit a model to data.
"""
raise NotImplementedError
- def predict(self, **keywords):
+ def predict(self, design=None):
"""
After a model has been fit, results are (assumed to be) stored
in self.results, which itself should have a predict method.
"""
- self.results.predict(**keywords)
+ self.results.predict(design)
- def view(self, **keywords):
+ def view(self):
"""
View results of a model.
"""
@@ -43,27 +43,27 @@
class LikelihoodModel(Model):
- def logL(self, theta, **extra):
+ def logL(self, theta):
"""
Log-likelihood of model.
"""
raise NotImplementedError
- def score(self, theta, **extra):
+ def score(self, theta):
"""
Score function of model = gradient of logL with respect to
theta.
"""
raise NotImplementedError
- def information(self, theta, **extra):
+ def information(self, theta):
"""
Score function of model = - Hessian of logL with respect to
theta.
"""
raise NotImplementedError
- def newton(self, theta, **extra):
+ def newton(self, theta):
def f(theta):
return -self.logL(theta)
self.results = scipy.optimize.fmin(f, theta)
Modified: trunk/Lib/sandbox/models/rlm.py
===================================================================
--- trunk/Lib/sandbox/models/rlm.py 2006-11-08 06:01:28 UTC (rev 2311)
+++ trunk/Lib/sandbox/models/rlm.py 2006-11-08 06:02:34 UTC (rev 2312)
@@ -8,7 +8,7 @@
niter = 20
scale_est = 'MAD'
- def __init__(self, design, M=norms.Hampel(), **keywords):
+ def __init__(self, design, M=norms.Hampel()):
self.M = M
self.weights = 1
self.initialize(design)
@@ -64,7 +64,7 @@
else:
return scale.scale_est(self, resid)**2
- def fit(self, Y, **keywords):
+ def fit(self, Y):
iter(self)
self.results = wls_model.fit(self, Y)
More information about the Scipy-svn
mailing list