def __init__(self, model, ax=None, alphas=None,
cv=None, scoring=None, **kwargs):
# Check to make sure this is not a "RegressorCV"
name = model.__class__.__name__
if name.endswith("CV"):
raise YellowbrickTypeError((
"'{}' is a CV regularization model;"
" try AlphaSelection instead."
).format(name))
# Call super to initialize the class
super(ManualAlphaSelection, self).__init__(model, ax=ax, **kwargs)
# Set manual alpha selection parameters
self.alphas = alphas or np.logspace(-10, -2, 200)
self.errors = None
self.score_method = partial(cross_val_score, cv=cv, scoring=scoring)
评论列表
文章目录