Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/mcgrad/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
_PANDAS_GROUPBY_INCLUDE_GROUPS: bool
try:
_pandas_version: tuple[int, ...] = tuple(
int(x)
for x in pd.__version__.split(".")[:2] # pyre-ignore[16]
int(x) for x in pd.__version__.split(".")[:2]
)
_PANDAS_GROUPBY_INCLUDE_GROUPS = _pandas_version >= (2, 2)
except (ValueError, AttributeError):
Expand Down
1 change: 0 additions & 1 deletion src/mcgrad/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,6 @@ def feature_importance(self) -> pd.DataFrame:
{
# Ordering of features here relies on two things 1) that MCGrad.extract_features returns first categoricals then
# numericals and 2) that .fit method concatenates logits to the end of the feature matrix
# pyre-ignore[58] if either feature_names attribute is None an error is raised above
"feature": self.categorical_feature_names
+ self.numerical_feature_names
+ [self._PREDICTION_FEATURE_NAME],
Expand Down
2 changes: 0 additions & 2 deletions src/mcgrad/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,6 @@ def _rank_calibration_error(
:return: tuple (RCE, label_cdfs, prediction_cdfs)
"""
# break ties
# pyrefly: ignore [bad-argument-type]
rng = np.random.RandomState(42) if rng is None else rng
eps = rng.uniform(0, 1, labels.shape[0]) * CALIBRATION_ERROR_EPSILON
labels = labels + eps
Expand Down Expand Up @@ -2128,7 +2127,6 @@ def soft_label_log_loss(
return float(np.mean(loss))


# pyre-ignore[16]: Setting __name__ so wrap_sklearn_metric_func
# identifies this metric as "log_loss" for early-stopping heuristics.
soft_label_log_loss.__name__ = "log_loss"

Expand Down
1 change: 0 additions & 1 deletion src/mcgrad/tutorials/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def format(self, record: logging.LogRecord) -> str:
hours = total_seconds // 3600
minutes = (total_seconds % 3600) // 60
seconds = total_seconds % 60
# pyre-ignore[16]: Dynamic attribute for elapsed time formatting
record.elapsed = f"[{hours:02d}:{minutes:02d}:{seconds:02d}]"
else:
record.elapsed = ""
Expand Down
Loading