Ejemplo n.º 1
0
def test_big(fit_intercept, is_sparse):
    with dask.config.set(scheduler='synchronous'):
        X, y = make_classification(is_sparse=is_sparse)
        lr = LogisticRegression(fit_intercept=fit_intercept)
        lr.fit(X, y)
        lr.predict(X)
        lr.predict_proba(X)
    if fit_intercept:
        assert lr.intercept_ is not None
Ejemplo n.º 2
0
def test_fit(fit_intercept, is_sparse):
    X, y = make_classification(n_samples=100,
                               n_features=5,
                               chunksize=10,
                               is_sparse=is_sparse)
    lr = LogisticRegression(fit_intercept=fit_intercept)
    lr.fit(X, y)
    lr.predict(X)
    lr.predict_proba(X)
Ejemplo n.º 3
0
def test_big(fit_intercept):
    import dask
    dask.set_options(get=dask.get)
    X, y = make_classification()
    lr = LogisticRegression(fit_intercept=fit_intercept)
    lr.fit(X, y)
    lr.predict(X)
    lr.predict_proba(X)
    if fit_intercept:
        assert lr.intercept_ is not None
Ejemplo n.º 4
0
def test_big(fit_intercept, is_sparse, is_cupy):
    with dask.config.set(scheduler='synchronous'):
        X, y = make_classification(is_sparse=is_sparse)
        if is_cupy and not is_sparse:
            cupy = pytest.importorskip('cupy')
            X, y = to_dask_cupy_array_xy(X, y, cupy)
        lr = LogisticRegression(fit_intercept=fit_intercept)
        lr.fit(X, y)
        lr.predict(X)
        lr.predict_proba(X)
    if fit_intercept:
        assert lr.intercept_ is not None
Ejemplo n.º 5
0
def test_fit(fit_intercept, is_sparse, is_cupy):
    X, y = make_classification(n_samples=100,
                               n_features=5,
                               chunksize=10,
                               is_sparse=is_sparse)

    if is_cupy and not is_sparse:
        cupy = pytest.importorskip('cupy')
        X, y = to_dask_cupy_array_xy(X, y, cupy)

    lr = LogisticRegression(fit_intercept=fit_intercept)
    lr.fit(X, y)
    lr.predict(X)
    lr.predict_proba(X)