diff --git a/dislib/classification/knn/base.py b/dislib/classification/knn/base.py index 2a16e2f7..5935d47d 100644 --- a/dislib/classification/knn/base.py +++ b/dislib/classification/knn/base.py @@ -53,7 +53,7 @@ class KNeighborsClassifier(BaseEstimator): but different labels, the results will depend on the ordering of the training data. https://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm - + Examples -------- >>> import dislib as ds diff --git a/dislib/data/array.py b/dislib/data/array.py index dc481d92..c29337ea 100644 --- a/dislib/data/array.py +++ b/dislib/data/array.py @@ -12,6 +12,7 @@ from scipy.sparse import issparse, csr_matrix from sklearn.utils import check_random_state import math +import sys class Array(object): @@ -73,8 +74,10 @@ def __init__(self, blocks, top_left_shape, reg_shape, shape, sparse, def __del__(self): if self._delete: - [compss_delete_object(b) for r_block in self._blocks for b in - r_block] + for r_block in self._blocks: + for b in r_block: + if sys.getrefcount(b) <= 3: + compss_delete_object(b) def __str__(self): return "ds-array(blocks=(...), top_left_shape=%r, reg_shape=%r, " \