You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: causalpy/pymc_experiments.py
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
importwarnings
1
2
fromtypingimportOptional, Union
2
3
3
4
importarvizasaz
@@ -586,6 +587,11 @@ def __init__(
586
587
fmin=self.treatment_threshold-self.bandwidth
587
588
fmax=self.treatment_threshold+self.bandwidth
588
589
filtered_data=self.data.query(f"{fmin} <= x <= {fmax}")
590
+
iflen(filtered_data) <=10:
591
+
warnings.warn(
592
+
f"Choice of bandwidth parameter has lead to only {len(filtered_data)} remaining datapoints. Consider increasing the bandwidth parameter.", # noqa: E501
Copy file name to clipboardExpand all lines: causalpy/skl_experiments.py
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
importwarnings
1
2
fromtypingimportOptional
2
3
3
4
importmatplotlib.pyplotasplt
@@ -391,6 +392,11 @@ def __init__(
391
392
fmin=self.treatment_threshold-self.bandwidth
392
393
fmax=self.treatment_threshold+self.bandwidth
393
394
filtered_data=self.data.query(f"{fmin} <= x <= {fmax}")
395
+
iflen(filtered_data) <=10:
396
+
warnings.warn(
397
+
f"Choice of bandwidth parameter has lead to only {len(filtered_data)} remaining datapoints. Consider increasing the bandwidth parameter.", # noqa: E501
0 commit comments