Skip to content

Commit

Permalink
Merge branch 'master' into intercept-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
dswah authored Jul 6, 2018
2 parents 6253643 + 77c82e5 commit 77ff2a5
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions pygam/pygam.py
Original file line number Diff line number Diff line change
Expand Up @@ -2539,6 +2539,9 @@ class LinearGAM(GAM):
tol : float, default: 1e-4
Tolerance for stopping criteria.
verbose : bool, default: False
whether to show pyGAM warnings
Attributes
----------
coef_ : array, shape (n_classes, m_features)
Expand Down Expand Up @@ -2572,7 +2575,7 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
penalties='auto', dtype='auto', tol=1e-4, scale=None,
callbacks=['deviance', 'diffs'],
fit_intercept=True, fit_linear=False, fit_splines=True,
constraints=None):
constraints=None, verbose=False):
self.scale = scale
super(LinearGAM, self).__init__(distribution=NormalDist(scale=self.scale),
link='identity',
Expand All @@ -2587,7 +2590,8 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
fit_intercept=fit_intercept,
fit_linear=fit_linear,
fit_splines=fit_splines,
constraints=constraints)
constraints=constraints,
verbose=verbose)

self._exclude += ['distribution', 'link']

Expand Down Expand Up @@ -2734,6 +2738,9 @@ class LogisticGAM(GAM):
tol : float, default: 1e-4
Tolerance for stopping criteria.
verbose : bool, default: False
whether to show pyGAM warnings
Attributes
----------
coef_ : array, shape (n_classes, m_features)
Expand Down Expand Up @@ -2767,7 +2774,7 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
penalties='auto', dtype='auto', tol=1e-4,
callbacks=['deviance', 'diffs', 'accuracy'],
fit_intercept=True, fit_linear=False, fit_splines=True,
constraints=None):
constraints=None, verbose=False):

# call super
super(LogisticGAM, self).__init__(distribution='binomial',
Expand All @@ -2783,7 +2790,8 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
fit_intercept=fit_intercept,
fit_linear=fit_linear,
fit_splines=fit_splines,
constraints=constraints)
constraints=constraints,
verbose=verbose)
# ignore any variables
self._exclude += ['distribution', 'link']

Expand Down Expand Up @@ -2955,6 +2963,9 @@ class PoissonGAM(GAM):
tol : float, default: 1e-4
Tolerance for stopping criteria.
verbose : bool, default: False
whether to show pyGAM warnings
Attributes
----------
coef_ : array, shape (n_classes, m_features)
Expand Down Expand Up @@ -2988,7 +2999,7 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
penalties='auto', dtype='auto', tol=1e-4,
callbacks=['deviance', 'diffs'],
fit_intercept=True, fit_linear=False, fit_splines=True,
constraints=None):
constraints=None, verbose=False):

# call super
super(PoissonGAM, self).__init__(distribution='poisson',
Expand All @@ -3004,7 +3015,8 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
fit_intercept=fit_intercept,
fit_linear=fit_linear,
fit_splines=fit_splines,
constraints=constraints)
constraints=constraints,
verbose=verbose)
# ignore any variables
self._exclude += ['distribution', 'link']

Expand Down Expand Up @@ -3379,6 +3391,9 @@ class GammaGAM(GAM):
tol : float, default: 1e-4
Tolerance for stopping criteria.
verbose : bool, default: False
whether to show pyGAM warnings
Attributes
----------
coef_ : array, shape (n_classes, m_features)
Expand Down Expand Up @@ -3412,7 +3427,7 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
penalties='auto', dtype='auto', tol=1e-4, scale=None,
callbacks=['deviance', 'diffs'],
fit_intercept=True, fit_linear=False, fit_splines=True,
constraints=None):
constraints=None, verbose=False):
self.scale = scale
super(GammaGAM, self).__init__(distribution=GammaDist(scale=self.scale),
link='log',
Expand All @@ -3427,7 +3442,8 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
fit_intercept=fit_intercept,
fit_linear=fit_linear,
fit_splines=fit_splines,
constraints=constraints)
constraints=constraints,
verbose=verbose)

self._exclude += ['distribution', 'link']

Expand Down Expand Up @@ -3565,6 +3581,9 @@ class InvGaussGAM(GAM):
tol : float, default: 1e-4
Tolerance for stopping criteria.
verbose : bool, default: False
whether to show pyGAM warnings
Attributes
----------
coef_ : array, shape (n_classes, m_features)
Expand Down Expand Up @@ -3598,7 +3617,7 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
penalties='auto', dtype='auto', tol=1e-4, scale=None,
callbacks=['deviance', 'diffs'],
fit_intercept=True, fit_linear=False, fit_splines=True,
constraints=None):
constraints=None, verbose=False):
self.scale = scale
super(InvGaussGAM, self).__init__(distribution=InvGaussDist(scale=self.scale),
link='log',
Expand All @@ -3613,7 +3632,8 @@ def __init__(self, lam=0.6, max_iter=100, n_splines=25, spline_order=3,
fit_intercept=fit_intercept,
fit_linear=fit_linear,
fit_splines=fit_splines,
constraints=constraints)
constraints=constraints,
verbose=verbose)

self._exclude += ['distribution', 'link']

Expand Down

0 comments on commit 77ff2a5

Please sign in to comment.