8
8
FLOAT_EPS = np .finfo (float ).eps
9
9
10
10
11
- class Link ( object ) :
11
+ class Link :
12
12
"""
13
13
A generic link function for one-parameter exponential family.
14
14
15
15
`Link` does nothing, but lays out the methods expected of any subclass.
16
16
"""
17
17
18
- def __call__ (self , p ):
18
+ def __call__ (self , p ): # noqa ARG002
19
19
"""
20
20
Return the value of the link function. This is just a placeholder.
21
21
@@ -31,7 +31,7 @@ def __call__(self, p):
31
31
"""
32
32
return NotImplementedError
33
33
34
- def inverse (self , z ):
34
+ def inverse (self , z ): # noqa ARG002
35
35
"""
36
36
Inverse of the link function. Just a placeholder.
37
37
@@ -50,7 +50,7 @@ def inverse(self, z):
50
50
"""
51
51
return NotImplementedError
52
52
53
- def deriv (self , p ):
53
+ def deriv (self , p ): # noqa ARG002
54
54
"""
55
55
Derivative of the link function g'(p). Just a placeholder.
56
56
@@ -230,7 +230,7 @@ def deriv2(self, p):
230
230
return (2 * p - 1 ) / v ** 2
231
231
232
232
233
- class logit (Logit ):
233
+ class logit (Logit ): # noqa N801
234
234
pass
235
235
236
236
@@ -357,7 +357,7 @@ def inverse_deriv(self, z):
357
357
return np .power (z , (1 - self .power ) / self .power ) / self .power
358
358
359
359
360
- class inverse_power (Power ):
360
+ class inverse_power (Power ): # noqa N801
361
361
"""
362
362
The inverse transform
363
363
@@ -369,10 +369,10 @@ class inverse_power(Power):
369
369
"""
370
370
371
371
def __init__ (self ):
372
- super (inverse_power , self ).__init__ (power = - 1.0 )
372
+ super ().__init__ (power = - 1.0 )
373
373
374
374
375
- class sqrt (Power ):
375
+ class sqrt (Power ): # noqa N801
376
376
"""
377
377
The square-root transform
378
378
@@ -384,11 +384,11 @@ class sqrt(Power):
384
384
"""
385
385
386
386
def __init__ (self ):
387
- super (sqrt , self ).__init__ (power = 0.5 )
387
+ super ().__init__ (power = 0.5 )
388
388
389
389
390
- class inverse_squared (Power ):
391
- """
390
+ class inverse_squared (Power ): # noqa N801
391
+ r """
392
392
The inverse squared transform
393
393
394
394
Notes
@@ -399,10 +399,10 @@ class inverse_squared(Power):
399
399
"""
400
400
401
401
def __init__ (self ):
402
- super (inverse_squared , self ).__init__ (power = - 2.0 )
402
+ super ().__init__ (power = - 2.0 )
403
403
404
404
405
- class identity (Power ):
405
+ class identity (Power ): # noqa N801
406
406
"""
407
407
The identity transform
408
408
@@ -414,7 +414,7 @@ class identity(Power):
414
414
"""
415
415
416
416
def __init__ (self ):
417
- super (identity , self ).__init__ (power = 1.0 )
417
+ super ().__init__ (power = 1.0 )
418
418
419
419
420
420
class Log (Link ):
@@ -430,7 +430,7 @@ class Log(Link):
430
430
def _clean (self , x ):
431
431
return np .clip (x , FLOAT_EPS , np .inf )
432
432
433
- def __call__ (self , p , ** extra ):
433
+ def __call__ (self , p ):
434
434
"""
435
435
Log transform link function
436
436
@@ -531,7 +531,7 @@ def inverse_deriv(self, z):
531
531
return np .exp (z )
532
532
533
533
534
- class log (Log ):
534
+ class log (Log ): # noqa N801
535
535
"""
536
536
The log transform
537
537
@@ -655,7 +655,7 @@ def inverse_deriv(self, z):
655
655
return 1 / self .deriv (self .inverse (z ))
656
656
657
657
658
- class probit (CDFLink ):
658
+ class probit (CDFLink ): # noqa N801
659
659
"""
660
660
The probit (standard normal CDF) transform
661
661
@@ -669,7 +669,7 @@ class probit(CDFLink):
669
669
pass
670
670
671
671
672
- class cauchy (CDFLink ):
672
+ class cauchy (CDFLink ): # noqa N801
673
673
"""
674
674
The Cauchy (standard Cauchy CDF) transform
675
675
@@ -681,7 +681,7 @@ class cauchy(CDFLink):
681
681
"""
682
682
683
683
def __init__ (self ):
684
- super (cauchy , self ).__init__ (dbn = scipy .stats .cauchy )
684
+ super ().__init__ (dbn = scipy .stats .cauchy )
685
685
686
686
def deriv2 (self , p ):
687
687
"""
@@ -814,7 +814,7 @@ def inverse_deriv(self, z):
814
814
return np .exp (z - np .exp (z ))
815
815
816
816
817
- class cloglog (CLogLog ):
817
+ class cloglog (CLogLog ): # noqa N801
818
818
"""
819
819
The CLogLog transform link function.
820
820
@@ -829,7 +829,7 @@ class cloglog(CLogLog):
829
829
pass
830
830
831
831
832
- class NegativeBinomial ( object ) :
832
+ class NegativeBinomial :
833
833
"""
834
834
The negative binomial link function
835
835
@@ -950,7 +950,7 @@ def inverse_deriv(self, z):
950
950
return t / (self .alpha * (1 - t ) ** 2 )
951
951
952
952
953
- class nbinom (NegativeBinomial ):
953
+ class nbinom (NegativeBinomial ): # noqa N801
954
954
"""
955
955
The negative binomial link function.
956
956
0 commit comments