Skip to content

Commit

Permalink
fixed mockregressor
Browse files Browse the repository at this point in the history
  • Loading branch information
BalzaniEdoardo committed Oct 8, 2024
1 parent 3e55ce7 commit 4fdcf32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/nemos/glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ def update(
return opt_step

def get_optimal_solver_params_config(self):
"""Return the functions for computing default step and batch size for the solver."""
return glm_compute_optimal_stepsize_configs(self)


Expand Down
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def initialize_params(self, *args, **kwargs):
def _predict_and_compute_loss(self, params, X, y):
pass

def get_optimal_solver_params_config(self):
return None, None, None


class MockRegressorNested(MockRegressor):
def __init__(self, other_param: int, std_param: int = 0):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def predict(self, X: Union[NDArray, jnp.ndarray]) -> jnp.ndarray:
def score(self, X, y, score_type="pseudo-r2-McFadden"):
pass

def get_optimal_solver_params_config(self):
return None, None, None

class BadEstimator(Base):
def __init__(self, param1, *args):
Expand Down

0 comments on commit 4fdcf32

Please sign in to comment.