Skip to content

Commit

Permalink
fix errors pytest hoeffding_races
Browse files Browse the repository at this point in the history
  • Loading branch information
s23lachg committed Nov 30, 2024
1 parent 38d818e commit 6bc1833
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions river/model_selection/hoeffding_races.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ class HoeffdingRaceClassifier(base.Classifier):
['KNN']
"""

def __init__(
self,
models={"KNN": neighbors.KNNClassifier(), "Log_Reg": linear_model.LogisticRegression()},
delta=0.05,
metric=metrics.Accuracy(),
):
def __init__(self, models=None, delta=0.05, metric=None):
if models is None:
models = {
"KNN": neighbors.KNNClassifier(),
"Log_Reg": linear_model.LogisticRegression(),
}
if metric is None:
metric = metrics.Accuracy()

# Assign to instance variables
self.models = models
self.delta = delta
self.metric = metric
Expand Down Expand Up @@ -126,12 +130,16 @@ class HoeffdingRaceRegressor(base.Regressor):
"""

def __init__(
self,
models={"KNN": neighbors.KNNRegressor(), "Log_Reg": linear_model.LinearRegression()},
delta=0.05,
metric=metrics.MAE(),
):
def __init__(self, models=None, delta=0.05, metric=None):
if models is None:
models = {
"KNN": neighbors.KNNRegressor(),
"Log_Reg": linear_model.LinearRegression(),
}
if metric is None:
metric = metrics.MAE()

# Assign to instance variables
self.models = models
self.delta = delta
self.metric = metric
Expand Down

0 comments on commit 6bc1833

Please sign in to comment.