Skip to content

Commit

Permalink
lowercase inline comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GStechschulte committed Nov 28, 2023
1 parent 79f945b commit ebb1ab0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions bambi/interpret/effects.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def get_summary_df(self, response_dim: np.ndarray) -> pd.DataFrame:
for 'comparisons' and 'slopes', then a subset of the 'preds' data is used
to build the summary.
"""
# Scenario 1
# scenario 1
if len(self.variable.values) > 2 and self.kind == "comparisons":
summary_df = self.preds_data.drop(columns=self.variable.name).drop_duplicates()
covariates_cols = summary_df.columns
Expand All @@ -353,7 +353,7 @@ def get_summary_df(self, response_dim: np.ndarray) -> pd.DataFrame:
contrast_values, summary_df.shape[0] // len(contrast_values), axis=0
)
contrast_values = [tuple(elem) for elem in contrast_values]
# Scenario 2
# scenario 2
elif len(response_dim) > 1:
summary_df = self.preds_data.drop(columns=self.variable.name).drop_duplicates()
covariates_cols = summary_df.columns
Expand All @@ -364,7 +364,7 @@ def get_summary_df(self, response_dim: np.ndarray) -> pd.DataFrame:
response_dim, summary_df.shape[0] // len(response_dim)
)
contrast_values = [tuple(contrast_values)] * summary_df.shape[0]
# Scenario 3 & 4
# scenario 3 & 4
else:
wrt = {}
for idx, _ in enumerate(self.variable.values):
Expand Down Expand Up @@ -686,7 +686,6 @@ def comparisons(
)
response_transform = transforms.get(response_name, identity)

# 'comparisons' not be limited to ("main", "group", "panel")
comparisons_data = create_differences_data(
conditional_info, contrast_info, effect_type="comparisons"
)
Expand Down Expand Up @@ -830,7 +829,6 @@ def slopes(
if not 0 < prob < 1:
raise ValueError(f"'prob' must be greater than 0 and smaller than 1. It is {prob}.")

# 'slopes' should not be limited to ("main", "group", "panel")
conditional_info = ConditionalInfo(model, conditional)

grid = bool(conditional_info.covariates)
Expand Down Expand Up @@ -863,7 +861,7 @@ def slopes(
response_dim = np.empty(0)

predictive_difference = PredictiveDifferences(
model, slopes_data, wrt_info, conditional_info, response, use_hdi, effect_type
model, slopes_data, wrt_info, conditional_info, response, use_hdi, kind=effect_type
)
slopes_summary = predictive_difference.get_estimate(
idata, response_transform, "diff", slope, eps, prob
Expand Down

0 comments on commit ebb1ab0

Please sign in to comment.