Skip to content

Commit b472d0a

Browse files
committed
fix a bug on scikit sparse fit
1 parent d1abaa3 commit b472d0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/thundersvm/thundersvm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ def _sparse_fit(self, X, y, solver_type, kernel):
226226
data = X.data.ctypes.data_as(POINTER(c_float))
227227
indices = X.indices.ctypes.data_as(POINTER(c_int32))
228228
indptr = X.indptr.ctypes.data_as(POINTER(c_int32))
229-
y = np.asarray(y, dtype=np.int32, order='C')
230-
label = y.ctypes.data_as(POINTER(c_int32))
229+
y = np.asarray(y, dtype=np.float32, order='C')
230+
label = y.ctypes.data_as(POINTER(c_float))
231231

232232
if self.class_weight is None:
233233
weight_size = 0

0 commit comments

Comments
 (0)