Skip to content

Commit

Permalink
fix issue #381 (#382)
Browse files Browse the repository at this point in the history
* fixed method and added test

* added changelog entry

* Prepared changelog for release
  • Loading branch information
MarcAntoineSchmidtQC authored Jun 15, 2021
1 parent a2a7699 commit fdf378f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@ Changelog
=========

Unreleased
----------


1.4.2 - 2021-06-15
------------------
**Tutorials and documenation improvements**:

**Tutorials and documenation improvements:**

- Adding tutorials to the documentation
- Additional documentation improvements

**Bug fix:**

- Verbose progress bar now working again.

**Other:**

- Small improvement in documentation for the ``alpha_index`` argument to :func:`quantcore.glm.GeneralizedLinearRegressor.predict`.
- Pinned pre-commit hooks versions.

1.4.1 - 2021-05-01
------------------
Expand Down
2 changes: 1 addition & 1 deletion src/quantcore/glm/_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def _update(self, n_iter, iteration_runtime, cur_grad_norm):
step = max(self.n_bar_steps - (np.log10(cur_grad_norm) - np.log10(self.tol)), 0)
# round to two digits for beauty
self.t.n = np.round(step, 2)
self.t._update(0)
self.t.update(0)


class IRLSData:
Expand Down
8 changes: 8 additions & 0 deletions tests/glm/test_glm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1810,3 +1810,11 @@ def test_alpha_parametrization_fail(kwargs, regression_data):
with pytest.raises((ValueError, TypeError)):
model = GeneralizedLinearRegressor(**kwargs)
model.fit(X=X, y=y)


def test_verbose(regression_data, capsys):
X, y = regression_data
mdl = GeneralizedLinearRegressor(verbose=1)
mdl.fit(X=X, y=y)
captured = capsys.readouterr()
assert "Iteration" in captured.err

0 comments on commit fdf378f

Please sign in to comment.