-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding CTFipsQuery class and demo #138
Adding CTFipsQuery class and demo #138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please expand on the profiling, along the lines of what's in grouped_predictions.ipynb
, along the lines of:
def basic_run():
ci = CausalInsight(
outcome_dataset=outcome,
intervention_dataset=intervention,
num_samples=num_samples,
smoke_test=smoke_test,
)
ci.get_tau_samples()
percent_calc = ci.slider_values_to_interventions(intervened_percent=50, year = year)
assert percent_calc['intervened_transformed'] > -1
for fips in texas:
ci.get_fips_predictions(intervened_value=percent_calc['intervened_transformed'],
fips=fips, intervention_is_percentile=True)
profiler_basic = cProfile.Profile()
profiler_basic.enable()
basic_run()
profiler_basic.disable()
profiler_basic.print_stats(sort='cumulative')
Apart from adding a more thorough time performance test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the main reason of slowdown is multiple use of reduce:
4.174 0.035 4.174 0.035 {method 'reduce' of 'numpy.ufunc' objects}
at some point downstream we might investigate further if this is a major issue.
In this PR, I added
CTFipsQuery
, a demo that exemplifies its use, and appropriate tests.One challenge with
CTFipsQuery
is that it seems rather slow, the process of creating a comparison takes around 30-60 seconds.