]> granicus.if.org Git - liblinear/commitdiff
fixed csr_scale resize
authorSinacam <stinkingmadgod@gmail.com>
Fri, 5 Aug 2022 12:09:44 +0000 (20:09 +0800)
committerSinacam <stinkingmadgod@gmail.com>
Sun, 7 Aug 2022 09:23:25 +0000 (17:23 +0800)
python/liblinear/commonutil.py

index 02e64d72aeb8193045f273cc730e56e89d65cb31..6ec304b52f4b1760ebbc4d91135fcb065bf15b7b 100644 (file)
@@ -160,8 +160,8 @@ def csr_scale(x, scale_param):
 
     if not n == len(coef):
         print("WARNING: The dimension of scaling parameters and feature number do not match.", file=sys.stderr)
-        coef = resize(coef, n)
-        offset = resize(offset, n)
+        coef = np.resize(coef, n)
+        offset = np.resize(offset, n)
 
     # scaled_x = x * diag(coef) + ones(l, 1) * offset'
     offset = sparse.csr_matrix(offset.reshape(1, n))