Skip to content

Commit

Permalink
Added comments to localize where readonly mode is broken
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurmensch committed Jul 1, 2015
1 parent 36ac873 commit b492b44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sklearn/utils/estimator_checks.py
Expand Up @@ -712,6 +712,7 @@ def check_estimators_partial_fit_n_features(name, Alg):

def check_clustering(name, Alg, readonly=False):
X, y = _make_blobs_with_mode(n_samples=50, random_state=1, readonly=readonly)
# TODO: this breaks read only mode
X, y = shuffle(X, y, random_state=7)
X = StandardScaler().fit_transform(X)
n_samples, n_features = X.shape
Expand Down Expand Up @@ -1045,7 +1046,7 @@ def check_regressors_int(name, Regressor):


def check_regressors_train_readonly(name, Regressors):
check_regressors_train(name, Regressors, readonly=False)
check_regressors_train(name, Regressors, readonly=True)


def check_regressors_train(name, Regressor, readonly=False):
Expand Down
6 changes: 3 additions & 3 deletions sklearn/utils/validation.py
Expand Up @@ -363,10 +363,10 @@ def check_array(array, accept_sparse=None, dtype="numeric", order=None,
else:
if ensure_2d:
array = np.atleast_2d(array)
if copy:
array = np.array(array, dtype=dtype, order=order, copy=copy)
else:
if not copy:
array = np.asarray(array, dtype=dtype, order=order)
else:
array = np.array(array, dtype=dtype, order=order, copy=copy)
# make sure we actually converted to numeric:
if dtype_numeric and array.dtype.kind == "O":
array = array.astype(np.float64)
Expand Down

0 comments on commit b492b44

Please sign in to comment.