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

[R-package] lgb.convert() functions should convert columns of type 'logical' #2678

Closed
jameslamb opened this issue Jan 12, 2020 · 3 comments · Fixed by #3269
Closed

[R-package] lgb.convert() functions should convert columns of type 'logical' #2678

jameslamb opened this issue Jan 12, 2020 · 3 comments · Fixed by #3269

Comments

@jameslamb
Copy link
Collaborator

jameslamb commented Jan 12, 2020

Summary

lgb.convert() and lgb.convert_with_rules() should convert columns of type "logical" to type "integer".

Motivation

The R package currently exports two functions that can be used to convert tabular datasets into model-ready form:

  • lgb.convert(): converts columns of type "character" and "factor" to "integer"
  • lgb.convert_with_rules(): similar to lgb.convert(), but returns a set of "rules" describing how non-numeric values were mapped to integer values. Also allows for user-provided rules, useful for cases where you want to be sure the encoding is the same on multiple datasets (e.g. training, test, and validation datasets)

These functions are intended to make it easier to create a model-ready dataset (all numeric or all integer). The fact that they do not convert columns of type "logical" means that they don't cover a very common case...converting TRUE/FALSE to 1/0.

@jameslamb
Copy link
Collaborator Author

Closed in favor of being in #2302. We decided to keep all feature requests in one place.

Welcome to contribute this feature! Please re-open this issue (or post a comment if you are not a topic starter) if you are actively working on implementing this feature.

@jameslamb jameslamb changed the title [R-package] lgb.prepare functions should convert columns of type 'logical' [R-package] lgb.convert() functions should convert columns of type 'logical' Aug 1, 2020
@jameslamb
Copy link
Collaborator Author

Just updated the title and description now that #3095 has been merged.

jameslamb added a commit that referenced this issue Aug 6, 2020
#2678, #2681) (#3269)

* [R-package] improvements to lgb.convert() functions (fixes #2678, #2681)

* more stuff

* update docs

* remove lgb.convert()

* put internal functions back

* update index
@guolinke guolinke reopened this Sep 6, 2020
@jameslamb
Copy link
Collaborator Author

oh this one can stay closed @guolinke . I fixed this in #3269

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