Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #9 from shaddyab/master
Browse files Browse the repository at this point in the history
fixing Indentation in base.py
  • Loading branch information
rsyi authored Dec 6, 2019
2 parents 8508b37 + 661deb8 commit 850a8a0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pylift/methods/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BaseProxyMethod:
randomized search scoring function. If a list of scoring_methods is
passed, a dictionary can also be passed here, where the keys are the
scoring_method strings and the values are the scoring cutoff for those
specific methods.
specific methods.
sklearn_model : scikit-learn regressor
Model used for grid searching and fitting.
Expand Down Expand Up @@ -264,7 +264,7 @@ def __init__(self, df, transform_func, untransform_func, col_treatment='Treatmen
'estimator': self.sklearn_model(),
**default_params
}
self.bayes_search_params = {
self.bayes_search_params = {
'estimator': self.sklearn_model(),
**default_params
}
Expand Down Expand Up @@ -366,15 +366,15 @@ def grid_search(self, **kwargs):
def bayes_search(self, **kwargs):
"""
Grid search using skopt.BayesSearchCV
Any parameters typically associated with BayesSearchCV (see
Scikit-Optimize documentation) can be passed as keyword arguments to
Scikit-Optimize documentation) can be passed as keyword arguments to
this function.
The final dictionary used for the grid search is saved to
`self.bayes_search_params`. This is updated with any parameters that
are passed.
Examples
--------
# Passing kwargs.
Expand All @@ -384,7 +384,7 @@ def bayes_search(self, **kwargs):
self.bayes_search_ = BayesSearchCV(**self.bayes_search_params)
self.bayes_search_.fit(self.x_train, self.transformed_y_train)
return self.bayes_search_

def fit(self, productionize=False, **kwargs):
"""A fit wrapper around any sklearn Regressor.
Expand Down Expand Up @@ -594,4 +594,3 @@ def plot(self, plot_type='cgains', ax=None, n_bins=None, show_noise_fits=False,
ax.plot([x[0], x[-1]], [bs_means[0], bs_means[-1]], '--', color=[0.6,0.6,0.6])

return ax

0 comments on commit 850a8a0

Please sign in to comment.