e85cb30e6adb96462791fb07c084c87ac8f69c9f,pdpipe/col_generation.py,OneHotEncode,__init__,#OneHotEncode#Any#Any#Any#Any#Any#Any#,200
Before Change
**kwargs
):
if columns is None:
self._columns = None
else:
self._columns = _interpret_columns_param(columns)
self._dummy_na = dummy_na
if exclude_columns is None:
self._exclude_columns = []
else:
self._exclude_columns = _interpret_columns_param(exclude_columns)
self._col_subset = col_subset
self._drop_first = drop_first
self._drop = drop
self._dummy_col_map = {}
self._encoder_map = {}
col_str = _list_str(self._columns)
super_kwargs = {
"exmsg": OneHotEncode._DEF_1HENCODE_EXC_MSG.format(col_str),
"appmsg": OneHotEncode._DEF_1HENCODE_APP_MSG.format(
col_str or "all columns"
),
"desc": "One-hot encode {}".format(
col_str or "all categorical columns"
),
}
super_kwargs.update(**kwargs)
super().__init__(**super_kwargs)
def _prec(self, df):
After Change
if columns is None:
columns = OfDtypes(["object", "category"])
else:
columns = columns_to_qualifier(columns)
if exclude_columns:
exclude_columns = columns_to_qualifier(exclude_columns)
columns = columns - exclude_columns
self._dummy_na = dummy_na
self._col_subset = col_subset
self._drop_first = drop_first
self._drop = drop
self._dummy_col_map = {}
self._encoder_map = {}
super_kwargs = {
"columns": columns,
"desc_temp": "One-hot encode {}",
}
super_kwargs.update(**kwargs)
super().__init__(**super_kwargs)
def _prec(self, df):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: shaypal5/pdpipe
Commit Name: e85cb30e6adb96462791fb07c084c87ac8f69c9f
Time: 2020-02-09
Author: shaypal5@gmail.com
File Name: pdpipe/col_generation.py
Class Name: OneHotEncode
Method Name: __init__
Project Name: shaypal5/pdpipe
Commit Name: 46aea54b80a6f7516447a84b3d66d9502fe3834a
Time: 2020-02-09
Author: shaypal5@gmail.com
File Name: pdpipe/basic_stages.py
Class Name: RowDrop
Method Name: __init__
Project Name: shaypal5/pdpipe
Commit Name: da3630c4eccc04079e465256786f65d6d87e7b1f
Time: 2020-02-16
Author: shaypal5@gmail.com
File Name: pdpipe/sklearn_stages.py
Class Name: Encode
Method Name: __init__
Project Name: shaypal5/pdpipe
Commit Name: e85cb30e6adb96462791fb07c084c87ac8f69c9f
Time: 2020-02-09
Author: shaypal5@gmail.com
File Name: pdpipe/col_generation.py
Class Name: OneHotEncode
Method Name: __init__