Skip to content

Sampling From Each Group#138

Merged
jeff-hernandez merged 157 commits intomasterfrom
label_select
Jun 26, 2020
Merged

Sampling From Each Group#138
jeff-hernandez merged 157 commits intomasterfrom
label_select

Conversation

@jeff-hernandez
Copy link
Copy Markdown
Contributor

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

Closes #124 by adding the parameter per_instance, which determines whether or not the sampling should be applied to each group. Working through the code, it made sense to make this parameter boolean. This added more functionality by allowing users to sample a fraction of the labels from each group.

Example

>>> lt
   entity labels
0       0      a
1       0      a
2       0      b
3       0      b
4       1      a
5       1      a
6       1      b
7       1      b
>>> frac = {'a': 1, 'b': .5}
>>> lt.sample(frac=frac, per_instance=True)
   entity labels
0       0      a
1       0      a
2       0      b
4       1      a
5       1      a
7       1      b

@codecov
Copy link
Copy Markdown

codecov bot commented May 28, 2020

Codecov Report

Merging #138 into master will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #138   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           26        26           
  Lines         1064      1085   +21     
=========================================
+ Hits          1064      1085   +21     
Impacted Files Coverage Δ
composeml/label_times/object.py 100.00% <100.00%> (ø)
...mposeml/tests/test_label_transforms/test_sample.py 100.00% <100.00%> (ø)

@jeff-hernandez jeff-hernandez changed the base branch from bin_transform to master June 22, 2020 18:31
@jeff-hernandez jeff-hernandez changed the base branch from master to bin_transform June 22, 2020 18:31
@jeff-hernandez jeff-hernandez changed the base branch from bin_transform to master June 23, 2020 20:04
@jeff-hernandez jeff-hernandez changed the base branch from master to sample_per_instance June 23, 2020 20:54
@jeff-hernandez jeff-hernandez changed the base branch from sample_per_instance to master June 23, 2020 20:55
@jeff-hernandez jeff-hernandez changed the title Selects Individual Target Sampling From Each Group Jun 26, 2020
@jeff-hernandez jeff-hernandez requested a review from frances-h June 26, 2020 18:24
Copy link
Copy Markdown
Contributor

@frances-h frances-h left a comment

Choose a reason for hiding this comment

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

👍 lgtm

@jeff-hernandez jeff-hernandez merged commit 7e6a450 into master Jun 26, 2020
@jeff-hernandez
Copy link
Copy Markdown
Contributor Author

This PR was repurposed to apply the changes from #144.

@jeff-hernandez jeff-hernandez deleted the label_select branch June 26, 2020 19:49
@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.

Sampling with a Label Dictionary

2 participants