Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
AntonioVitoMastromarino committed Mar 10, 2024
1 parent 41d6944 commit 4cfc29f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions epios/sampling_maker.py
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ def __call__(self,
Takes one ID and returns its class in the stratification.
Output:
result if output == None
result, observ if output == also_nums
result, observ if output == also_nums
observ if output == nums_only (input you need for re_scaler)
result is a DataFrame if keep_track == False
@@ -112,8 +112,10 @@ def count(x):
negative = x.value_counts().get('Negative', 0)
variance = positive * negative / (positive + negative)
# rescale the estimate to have unitary variance
if positive + negative == 0: return 0
else: return positive, negative, variance
if positive + negative == 0:
return 0
else:
return positive, negative, variance
else:
# in this case we want to approximate the number of positive/negative people into each class
classes = {stratify(id) for id in self.data.columns if id != 'time'}
@@ -152,12 +154,12 @@ def count(x):
else:
# in this case you have to update the sample each time depending on res
# this in order to deal with nonresponders and with additional sampling
next_people = people # list
next_people = people # list
res = []
for sampling_time in sampling_times:
STATUSES = self.data.loc[sampling_time, next_people] # Series
res.append(STATUSES.apply(self._testresult)) # list of Series
next_people = callback(res[-1]) # list
next_people = callback(res[-1]) # list

if post_proc:
# in this case we need a list of Series for each

0 comments on commit 4cfc29f

Please sign in to comment.