Skip to content

Commit

Permalink
Make ReliefF and RReliefF replicable by default
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Feb 12, 2025
1 parent e67650f commit 041ff6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Orange/preprocess/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ class ReliefF(Scorer):
friendly_name = "ReliefF"
preprocessors = Scorer.preprocessors + [RemoveNaNColumns()]

def __init__(self, n_iterations=50, k_nearest=10, random_state=None):
def __init__(self, n_iterations=50, k_nearest=10, random_state=0):
self.n_iterations = n_iterations
self.k_nearest = k_nearest
self.random_state = random_state
Expand Down Expand Up @@ -386,7 +386,7 @@ class RReliefF(Scorer):
friendly_name = "RReliefF"
preprocessors = Scorer.preprocessors + [RemoveNaNColumns()]

def __init__(self, n_iterations=50, k_nearest=50, random_state=None):
def __init__(self, n_iterations=50, k_nearest=50, random_state=0):
self.n_iterations = n_iterations
self.k_nearest = k_nearest
self.random_state = random_state
Expand Down
4 changes: 2 additions & 2 deletions Orange/tests/test_score_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ def test_relieff(self):
weights = ReliefF()(old_breast, None)

np.testing.assert_array_equal(
ReliefF(random_state=1)(self.breast, None),
ReliefF(random_state=1)(self.breast, None)
ReliefF()(self.breast, None),
ReliefF()(self.breast, None)
)

def test_rrelieff(self):
Expand Down

0 comments on commit 041ff6d

Please sign in to comment.