Skip to content

Commit

Permalink
Some tests are now faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
vnmabus committed Oct 13, 2023
1 parent 4f0bd4c commit 9f74e24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions skfda/ml/classification/_logistic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class LogisticRegression(
>>> from skfda.datasets import make_gaussian_process
>>> from skfda.ml.classification import LogisticRegression
>>>
>>> n_samples = 10000
>>> n_features = 200
>>> n_samples = 2000
>>> n_features = 101
>>>
>>> def mean_1(t):
... return (np.abs(t - 0.25)
Expand All @@ -90,7 +90,7 @@ class LogisticRegression(
>>> np.allclose(sorted(lr.points_), [0.25, 0.5, 0.75], rtol=1e-2)
True
>>> lr.score(X[1::2],y[1::2])
0.7498
0.768
References:
.. footbibliography::
Expand Down
10 changes: 5 additions & 5 deletions skfda/tests/test_recursive_maxima_hunting.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def test_gaussian_homoscedastic(self) -> None:
join.
"""
n_samples = 10000
n_features = 100
n_samples = 1000
n_features = 101

def mean_1( # noqa: WPS430
t: np.typing.NDArray[np.float_],
Expand Down Expand Up @@ -66,7 +66,7 @@ def mean_1( # noqa: WPS430
rmh.fit(X, y)
point_mask = rmh.get_support()
points = X.grid_points[0][point_mask]
np.testing.assert_allclose(points, [0.25, 0.5, 0.75], rtol=1e-1)
np.testing.assert_allclose(points, [0.25, 0.5, 0.75], rtol=1e-2)

@pytest.mark.filterwarnings(
'ignore::sklearn.exceptions.ConvergenceWarning'
Expand All @@ -83,7 +83,7 @@ def test_fit_exponential(self) -> None:
"""
n_samples = 1000
n_features = 100
n_features = 101

def mean_1( # noqa: WPS430
t: np.typing.NDArray[np.float_],
Expand Down Expand Up @@ -129,7 +129,7 @@ def mean_1( # noqa: WPS430
rmh.fit(X, y)
point_mask = rmh.get_support()
points = X.grid_points[0][point_mask]
np.testing.assert_allclose(points, [0.25, 0.5, 0.75], rtol=1e-1)
np.testing.assert_allclose(points, [0.25, 0.5, 0.75], rtol=1e-2)


if __name__ == '__main__':
Expand Down

0 comments on commit 9f74e24

Please sign in to comment.