Skip to content

Infinity as Edges for Binning#133

Merged
jeff-hernandez merged 73 commits into
masterfrom
bin_transform
Jun 22, 2020
Merged

Infinity as Edges for Binning#133
jeff-hernandez merged 73 commits into
masterfrom
bin_transform

Conversation

@jeff-hernandez

@jeff-hernandez jeff-hernandez commented May 5, 2020

Copy link
Copy Markdown
Contributor

This closes #114 by supporting infinite edges when binning labels.

Example

Create a label times object.

>>> data = [226.93, 47.95, 283.46, 31.54]
>>> lt = LabelTimes({'target': data})
>>> lt
    target
0  226.93
1   47.95
2  283.46
3   31.54

Bin values using infinite edges.

>>> lt.bin(['-inf', 100, 'inf'])
            target
0   (100.0, inf]
1  (-inf, 100.0]
2   (100.0, inf]
3  (-inf, 100.0]

@jeff-hernandez jeff-hernandez requested a review from rwedge May 26, 2020 20:30
@jeff-hernandez jeff-hernandez changed the title Include Lowest and Highest when Binning Infinity as Edges for Binning May 26, 2020
@jeff-hernandez jeff-hernandez changed the base branch from label_times_refactor to master June 17, 2020 17:49
@jeff-hernandez jeff-hernandez changed the base branch from master to label_times_refactor June 17, 2020 17:49
@jeff-hernandez jeff-hernandez changed the base branch from label_times_refactor to master June 17, 2020 19:55
Comment thread composeml/label_times/object.py

@thehomebrewnerd thehomebrewnerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In general this looks good. Might be good to add a test in the unit tests to cover passing "inf" and "-inf" strings as bin edges along with a test to confirm that the precision parameter works as expected.

@jeff-hernandez

Copy link
Copy Markdown
Contributor Author

Thanks @thehomebrewnerd. The docstring examples are configured as doctests which are included as unit tests in pytest.

@rwedge rwedge left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@jeff-hernandez jeff-hernandez merged commit f95e9d7 into master Jun 22, 2020
@jeff-hernandez jeff-hernandez deleted the bin_transform branch June 26, 2020 19:50
@jeff-hernandez jeff-hernandez mentioned this pull request Jul 2, 2020
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.

Include Lowest and Highest when Binning

3 participants