[HELP REQUESTED] Generalized Additive Models in Python
int
instead of np.int
'cp'
basis like so:GAM(s(0, basis='cp'))
GAM(f(0, coding='dummy'))
Models using this coding scheme are more statistically interpretable , and computationally less expensive than those using one-hot encodings.
not None
element existance judgement bug in terms.py
thanks @BeefOnionDumplings !np.int64
did not count as integers.
the following no longer fails:LinearGAM().gridsearch(X, y, n_splines=np.arange(5, 10)).summary()
randomsearch
gridsearch(...)
allows searching across a predefined grid of points, without doing the cartesian product, when grid is a np.ndarray
of shape (n_points, len(flatten(gam.lam)))
. This is useful for RandomSearchCV - style behavior.estimate_r_squared(X, y)
no longer raises AttributeError
dtype=auto
no longer allowed for termsintercept.lam = None
GAM(s(0) + s(1), n_splines=10).fit(X, y)
will broadcast n_splines=10
to all terms
GAM(lam=0.6).gridsearch(X, y)
worked for multi-dimensional X
but not
GAM(lam=0.6).gridsearch(X, y)
GAM(te(0, s(1, n_splines=5))).fit(X, y)
partial_dependence()
method can return meshgrids to help you make 3D plots of interaction termsExpectileGAM().fit_quantile(X, y, quantile=0.25)
generate_X_grid
and partial_dependence
methods require you to specify term=
instead of ~feature=
~toy_classification
datasetgenerate_X_grid
to GAM
methodpartial_dependence
by never needing to index with i+1_initial_estimate()
method no longer fails on value nudge for purely integer observationsinitial_estimate()