Skip to content

Commit

Permalink
fixed random hash changes
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreFCruz committed Jun 21, 2024
1 parent 005088d commit 9b79f82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions folktexts/acs/acs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ def __hash__(self) -> int:
"from an insurance company (as opposed to being insured through an "
"employer, Medicare, Medicaid, or any other source)"
),
features=list({
features=sorted(list({
*acs_income_task.features,
*acs_public_coverage_task.features,
*acs_mobility_task.features,
*acs_employment_task.features,
*acs_travel_time_task.features,
}),
})),
target="HINS2",
cols_to_text=_acs_columns_map,
target_threshold=acs_health_insurance_threshold,
Expand Down
4 changes: 2 additions & 2 deletions folktexts/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ def __hash__(self) -> int:

return int(hash_dict(hash_params), 16)

def fit(self, X, y, *, false_pos_cost=1.0, false_neg_cost=1.0):
def fit(self, X, y, *, false_pos_cost=1.0, false_neg_cost=1.0, **kwargs):
"""Uses the provided data sample to fit the prediction threshold."""

# Compute risk estimates for the data
y_pred_scores = self.predict_proba(X)
y_pred_scores = self.predict_proba(X, **kwargs)
if len(y_pred_scores.shape) > 1:
y_pred_scores = y_pred_scores[:, -1]

Expand Down
2 changes: 1 addition & 1 deletion folktexts/threshold.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pandas as pd


@dataclasses.dataclass(frozen=True)
@dataclasses.dataclass(frozen=True, eq=True)
class Threshold:
"""A class to represent a threshold value and its comparison operator.
Expand Down

0 comments on commit 9b79f82

Please sign in to comment.