utils
EPSILON = 1e-13 module-attribute ¶
logger = logging.getLogger(__name__) module-attribute ¶
invert(x) ¶
Invert an array.
:param x: [description] :type x: [type] :return: [description] :rtype: [type]
Source code in src/streamsight/algorithms/time_aware_item_knn/utils.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
to_binary(X) ¶
Converts a matrix to binary by setting all non-zero values to 1.
:param X: Matrix to convert to binary. :type X: csr_matrix :return: Binary matrix. :rtype: csr_matrix
Source code in src/streamsight/algorithms/time_aware_item_knn/utils.py
37 38 39 40 41 42 43 44 45 46 47 | |