Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method for changing a Y/N column to 1/0 should be made generic #456

Open
danwellisch1 opened this issue Dec 13, 2017 · 0 comments
Open

Method for changing a Y/N column to 1/0 should be made generic #456

danwellisch1 opened this issue Dec 13, 2017 · 0 comments

Comments

@danwellisch1
Copy link
Contributor

The below method, currently in transformers.py should take 2 more parameters, e.g. positiveValue and negativeValue such that in the positiveValue = ''Y" and negativeValue = "N" in one case. I think this might be what the TODO is saying, but formalizing into an issue. When I ran the Wisconsin Cancer data set, I had to duplicate this method as a quick fix and hard code M for the positive value and B for the negative value. We need to have one method to do this so it can handle any specified positive or negative value for the prediction column.

class DataFrameConvertTargetToBinary(TransformerMixin):
# TODO Note that this makes healthcareai only handle N/Y in pred column
"""
# Replace 'Y'/'N' with 1/0
X[self.target_column].replace(['Y', 'N'], [1, 0], inplace=True)
.
.
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant