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

Levels #70

Closed
JockLawrie opened this issue May 6, 2022 · 5 comments
Closed

Levels #70

JockLawrie opened this issue May 6, 2022 · 5 comments
Assignees
Labels
feature good first issue Good for newcomers

Comments

@JockLawrie
Copy link

Hi there,

Is there appetite for a SetLevels transform that resets the levels of a column of scitype Finite?

Something along the lines of: SetLevels(:mycol, levels)

I often receive binary data with levels ["yes", "no"] and need to reorder them as ["no", "yes"], or simply recast them as [0, 1].

Another example is replacing alphabetical order with a more meaningful order.
E.g., ["large", "medium", "small"] changes to ["small", "medium", "large"]

@juliohm juliohm added the feature label May 6, 2022
@juliohm
Copy link
Member

juliohm commented May 6, 2022

It would be nice to have a transform Levels(:col1 => levels1, :col2 => levels2, ...) that sets the levels of columns as you mentioned.

Can you help with a PR? :)

@juliohm
Copy link
Member

juliohm commented May 10, 2022

@JockLawrie are you planning to work on this?

@juliohm juliohm changed the title Set the levels of a categorical variable Levels May 10, 2022
@juliohm juliohm added the good first issue Good for newcomers label May 10, 2022
@Frank-III
Copy link
Contributor

@JockLawrie are you planning to work on this?

I would like to work on this one. I suppose the syntax to be Levels(:cols1 => levels1, :col2 => level2; ordered = [:cols1, :cols3]) with the order keyword param to indicate the column we would like to set order to be true is ok?

@juliohm
Copy link
Member

juliohm commented May 22, 2022

@Frank-III thank you for considering the contribution. Yes, the syntax is great. I will assign you to the issue and we can review the PR moving forward.

I was thinking if maybe this transform could be renamed to Categorical but we can think about it later when the PR is ready.

@juliohm
Copy link
Member

juliohm commented May 27, 2022

Fixed in master.

@juliohm juliohm closed this as completed May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants