Sundar0989 / XuniVerse

xverse (XuniVerse) is collection of transformers for feature engineering and feature selection
MIT License
116 stars 38 forks source link

Transform issue on WOE #6

Open hanzhichao2000 opened 4 years ago

hanzhichao2000 commented 4 years ago

TypeError Traceback (most recent call last)

in ----> 1 clf.transform(X).head() ~/.conda/envs/most-reg/lib/python3.7/site-packages/xverse/transformer/_woe.py in transform(self, X, y) 308 Estimator has to be fitted to apply transformations.") 309 --> 310 outX[new_column_name] = tempX.replace(self.woe_bins[original_column_name]) 311 312 #transformed dataframe ~/.local/lib/python3.7/site-packages/pandas/core/series.py in replace(self, to_replace, value, inplace, limit, regex, method) 4567 limit=limit, 4568 regex=regex, -> 4569 method=method, 4570 ) 4571 ~/.local/lib/python3.7/site-packages/pandas/core/generic.py in replace(self, to_replace, value, inplace, limit, regex, method) 6490 6491 return self.replace( -> 6492 to_replace, value, inplace=inplace, limit=limit, regex=regex 6493 ) 6494 else: ~/.local/lib/python3.7/site-packages/pandas/core/series.py in replace(self, to_replace, value, inplace, limit, regex, method) 4567 limit=limit, 4568 regex=regex, -> 4569 method=method, 4570 ) 4571 ~/.local/lib/python3.7/site-packages/pandas/core/generic.py in replace(self, to_replace, value, inplace, limit, regex, method) 6536 dest_list=value, 6537 inplace=inplace, -> 6538 regex=regex, 6539 ) 6540 ~/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py in replace_list(self, src_list, dest_list, inplace, regex) 612 mask = ~isna(values) 613 --> 614 masks = [comp(s, mask, regex) for s in src_list] 615 616 result_blocks = [] ~/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py in (.0) 612 mask = ~isna(values) 613 --> 614 masks = [comp(s, mask, regex) for s in src_list] 615 616 result_blocks = [] ~/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py in comp(s, mask, regex) 606 607 s = com.maybe_box_datetimelike(s) --> 608 return _compare_or_regex_search(values, s, regex, mask) 609 610 # Calculate the mask once, prior to the call of comp ~/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py in _compare_or_regex_search(a, b, regex, mask) 1966 result = tmp 1967 -> 1968 _check_comparison_types(result, a, b) 1969 return result 1970 ~/.local/lib/python3.7/site-packages/pandas/core/internals/managers.py in _check_comparison_types(result, a, b) 1934 1935 raise TypeError( -> 1936 f"Cannot compare types {repr(type_names[0])} and {repr(type_names[1])}" 1937 ) 1938 TypeError: Cannot compare types 'ndarray(dtype=object)' and 'Interval' pandas version - 1.1.0
hanzhichao2000 commented 4 years ago

data is got from Xverse.ipynb

ikunal95 commented 4 years ago

Hi is there any update on this facing the same issue.