alteryx / alteryx/woodwork

Add Binary LogicalType

未关闭
#1,256 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
new feature
主要语言
Python
星标
155
派生
24
PR 合并指标
30 天内没有已合并 PR

描述

As a developer, I wish I could use Woodwork to categorize columns that contain only one of two values with a logical type of `Binary`. This would be useful in setting up machine learning classification problems as users would clearly know that the target column with a `Binary` logical type contains only two values and they should structure the problem as a binary classification and not a multi-class classification.

The `Binary` logical type should have a dtype of `category` as it should work with multiple data types including strings, integers and doubles. Missing values should be allowed. This should not include boolean values of `True` and `False` as those should be recognized as a `Boolean` or `BooleanNullable` logical type. `Binary` should be a child type of `Categorical`.

#### Code Example

```python
import pandas as pd
import woodwork as ww
from woodwork.logical_types import Binary

df = pd.DataFrame({"binary_col": ["yes", "no", "no", "yes"]})
df.ww.init()

assert isinstance(df.ww.logical_types["binary_col"], Binary)

```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。