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

Remove the possibility in DFtoVW to provide constant values #2601

Merged
merged 7 commits into from Oct 14, 2020

Conversation

etiennekintzler
Copy link
Contributor

This PR fix issue #2600.

Changes

  • The feature that allow the user to supply constant value instead of column names as argument in classes DFtoVW (and friends) is removed.
  • In the Feature class, the name provided can only be a constant string now and not a column name. Indeed, since now the user cannot choose whether the argument name is a constant or a column name, it's by default a constant.

@@ -1458,7 +1441,7 @@ def __init__(self, colname, expected_type, min_value=None):

Parameters
----------
colname: str/int/float
colname: any hashable type (str/int/float/tuple/etc.)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not actually link to the current PR. It's just that pandas accept all these types as colname (same as allowed keys for dict type I think).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you think it's worthwhile adding that as a comment in the code itself to avoid confusion with vw format, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I could specify the type directly as colname: any valid pandas's column name (str/int/float/etc.)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with being more explicit mentioning panda's here

Comment on lines 1620 to 1621

name = AttributeDescriptor("name", expected_type=(int, float))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semirelated to this PR but @lalo what do you think of changing the name arg into label (and same for MulticlassLabel, etc.)

Copy link
Collaborator

@lalo lalo Oct 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it stands with our current docs, if you refer to https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Input-format you can see that the terminology uses 'label' even for multiclass.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i've just change it !

@lalo lalo merged commit 54a3778 into VowpalWabbit:master Oct 14, 2020
@lalo
Copy link
Collaborator

lalo commented Oct 14, 2020

Great work and congrats on your fifth pull request to VW @etiennekintzler

@etiennekintzler
Copy link
Contributor Author

Thanks ! 👍

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

Successfully merging this pull request may close these issues.

None yet

2 participants