Similar to what is described in #5637, LinearSVC predict returns a float dtype rather than integer, which breaks compatibility with third-party tools that assume classifier predictions are integers and operate on them accordingly.
>>> v_clf.predict(X)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/corey/.virtualenvs/wine-cultivator/lib/python3.11/site-packages/sklearn/ensemble/_voting.py", line 444, in predict
maj = np.apply_along_axis(
^^^^^^^^^^^^^^^^^^^^
File "/home/corey/.virtualenvs/wine-cultivator/lib/python3.11/site-packages/numpy/lib/shape_base.py", line 379, in apply_along_axis
res = asanyarray(func1d(inarr_view[ind0], *args, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/corey/.virtualenvs/wine-cultivator/lib/python3.11/site-packages/sklearn/ensemble/_voting.py", line 445, in <lambda>
lambda x: np.argmax(np.bincount(x, weights=self._weights_not_none)),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'
Environment Details:
Bare-metal
Linux Mint 21.3 Virginia, base: Ubuntu 22.04
NVIDIA GeForce RTX 4090 and driver 555.42.02
CUDA: 12.5
Method of cuDF & cuML install: pip [cuml-cu12 24.6.1]
Similar to what is described in #5637, LinearSVC
predict
returns a float dtype rather than integer, which breaks compatibility with third-party tools that assume classifier predictions are integers and operate on them accordingly.For example, with Scikit's
VotingClassifier
, we get the following error:Environment Details: