Skip to content

Commit

Permalink
adding random state to baseliners
Browse files Browse the repository at this point in the history
  • Loading branch information
silil committed Sep 20, 2024
1 parent 7193130 commit 6d07cc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/triage/component/catwalk/baselines/rankers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class PercentileRankOneFeature:
def __init__(self, feature, low_value_high_score=None, descend=None):
def __init__(self, feature, low_value_high_score=None, descend=None, random_state=42):
logger.warning("DEPRECATION WARNING: PercentileRankOneFeature is being replaced by "
"BaselineRankMultiFeature. Note, however, that the scores returned by the new "
"ranker cannot be interpreted as percentiles."
Expand All @@ -31,6 +31,7 @@ def __init__(self, feature, low_value_high_score=None, descend=None):
if low_value_high_score is None:
low_value_high_score = False

self.random_state = random_state
self.feature = feature # which feature to rank on
self.low_value_high_score = (
low_value_high_score
Expand Down
3 changes: 2 additions & 1 deletion src/triage/component/catwalk/baselines/thresholders.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ class may be abstracted into a BaseThreshold class and more complicated
where rules and operators that combine them can be nested).
"""

def __init__(self, rules, logical_operator="or"):
def __init__(self, rules, logical_operator="or", random_state=42):
self.random_state = random_state
self.rules = rules
self.logical_operator = logical_operator
self.feature_importances_ = None
Expand Down

0 comments on commit 6d07cc2

Please sign in to comment.