2018-11-05 23:38:41 +00:00
|
|
|
import pytest
|
2018-10-22 10:51:03 +00:00
|
|
|
|
2018-11-05 23:38:41 +00:00
|
|
|
|
2021-04-08 07:01:51 +00:00
|
|
|
@pytest.mark.driver_timeout(40)
|
2018-11-05 23:38:41 +00:00
|
|
|
def test_scikit_learn(selenium_standalone, request):
|
2018-10-22 10:51:03 +00:00
|
|
|
selenium = selenium_standalone
|
|
|
|
selenium.load_package("scikit-learn")
|
2020-06-28 18:24:40 +00:00
|
|
|
assert (
|
|
|
|
selenium.run(
|
|
|
|
"""
|
2018-10-22 10:51:03 +00:00
|
|
|
import numpy as np
|
|
|
|
import sklearn
|
|
|
|
from sklearn.linear_model import LogisticRegression
|
|
|
|
|
|
|
|
rng = np.random.RandomState(42)
|
|
|
|
X = rng.rand(100, 20)
|
|
|
|
y = rng.randint(5, size=100)
|
|
|
|
|
|
|
|
estimator = LogisticRegression(solver='liblinear')
|
|
|
|
estimator.fit(X, y)
|
|
|
|
print(estimator.predict(X))
|
|
|
|
estimator.score(X, y)
|
2020-06-28 18:24:40 +00:00
|
|
|
"""
|
|
|
|
)
|
|
|
|
> 0
|
|
|
|
)
|