Skip to content

Commit

Permalink
rebuid and recheck
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMount committed May 20, 2021
1 parent 108a4f7 commit f94eb44
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
8 changes: 4 additions & 4 deletions coverage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ pkg/vtreat/cross_plan.py 50 11 78%
pkg/vtreat/stats_utils.py 82 3 96%
pkg/vtreat/transform.py 17 4 76%
pkg/vtreat/util.py 149 21 86%
pkg/vtreat/vtreat_api.py 285 57 80%
pkg/vtreat/vtreat_impl.py 650 86 87%
pkg/vtreat/vtreat_api.py 285 36 87%
pkg/vtreat/vtreat_impl.py 655 80 88%
-----------------------------------------------
TOTAL 1239 182 85%
TOTAL 1244 155 88%


============================= 28 passed in 19.27s ==============================
============================= 28 passed in 19.38s ==============================
20 changes: 16 additions & 4 deletions pkg/build/lib/vtreat/vtreat_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def transform(self, X):
"possibly called transform on same data used to fit\n" +
"(this causes over-fit, please use fit_transform() instead)")
res = vtreat_impl.pre_prep_frame(
X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_['cat_list']
X,
col_list=self.plan_['num_list'] + self.plan_['cat_list'],
cols_to_copy=self.cols_to_copy_,
cat_cols=self.plan_['cat_list']
)
res = vtreat_impl.perform_transform(x=res, transform=self, params=self.params_)
res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self)
Expand Down Expand Up @@ -274,7 +277,10 @@ def transform(self, X):
"possibly called transform on same data used to fit\n" +
"(this causes over-fit, please use fit_transform() instead)")
X = vtreat_impl.pre_prep_frame(
X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_['cat_list']
X,
col_list=self.plan_['num_list'] + self.plan_['cat_list'],
cols_to_copy=self.cols_to_copy_,
cat_cols=self.plan_['cat_list']
)
res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_)
res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self)
Expand Down Expand Up @@ -421,7 +427,10 @@ def transform(self, X):
"possibly called transform on same data used to fit\n" +
"(this causes over-fit, please use fit_transform() instead)")
X = vtreat_impl.pre_prep_frame(
X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_['cat_list']
X,
col_list=self.plan_['num_list'] + self.plan_['cat_list'],
cols_to_copy=self.cols_to_copy_,
cat_cols=self.plan_['cat_list']
)
res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_)
res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self)
Expand Down Expand Up @@ -558,7 +567,10 @@ def transform(self, X):
if self.last_fit_x_id_ is None:
raise ValueError("called transform on not yet fit treatment")
X = vtreat_impl.pre_prep_frame(
X, col_list=self.var_list_, cols_to_copy=self.cols_to_copy_, cat_cols=self.plan_['cat_list']
X,
col_list=self.plan_['num_list'] + self.plan_['cat_list'],
cols_to_copy=self.cols_to_copy_,
cat_cols=self.plan_['cat_list']
)
res = vtreat_impl.perform_transform(x=X, transform=self, params=self.params_)
res = vtreat_impl.limit_to_appropriate_columns(res=res, transform=self)
Expand Down
7 changes: 6 additions & 1 deletion pkg/build/lib/vtreat/vtreat_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,12 @@ def predict_proba(self, X):
def get_feature_names(self, input_features=None):
if self.score_frame_ is None:
raise ValueError("get_feature_names called on uninitialized vtreat transform")
if self.params_['filter_to_recommended']:
filter_to_recommended = False
try:
filter_to_recommended = self.params_['filter_to_recommended']
except KeyError:
pass
if filter_to_recommended:
new_vars = [self.score_frame_['variable'][i] for i in range(self.score_frame_.shape[0])
if self.score_frame_['has_range'][i] and self.score_frame_['recommended'][i]
and (input_features is None or self.score_frame_['orig_variable'][i] in input_features)]
Expand Down
Binary file modified pkg/dist/vtreat-0.5.0-py3-none-any.whl
Binary file not shown.
Binary file modified pkg/dist/vtreat-0.5.0.tar.gz
Binary file not shown.

0 comments on commit f94eb44

Please sign in to comment.