8000 TST writable coef_ and intercept_ on LogisticRegression · scikit-learn/scikit-learn@a164d57 · GitHub
[go: up one dir, main page]

Skip to content

Commit a164d57

Browse files
committed
TST writable coef_ and intercept_ on LogisticRegression
Solves issue #470.
1 parent 3ca3e95 commit a164d57

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sklearn/linear_model/tests/test_logistic.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ def test_inconsistent_input():
9494
rng.random_sample((3, 12)))
9595

9696

97+
def test_write_parameters():
98+
"""Test that we can write to coef_ and intercept_"""
99+
#rng = np.random.RandomState(0)
100+
#X = rng.random_sample((5, 10))
101+
#y = np.ones(X.shape[0])
102+
clf = logistic.LogisticRegression()
103+
clf.fit(X, Y1)
104+
clf.coef_[:] = 0
105+
clf.intercept_[:] = 0
106+
assert_array_equal(clf.decision_function(X), 0)
107+
108+
97109
@raises(ValueError)
98110
def test_nan():
99111
"""Test proper NaN handling.

0 commit comments

Comments
 (0)
0