You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/xxx/scratch.py", line 8, in <module>
VWClassifier(ftrl=True).fit(X, y)
File "/xxx/python3.8/site-packages/vowpalwabbit/sklearn.py", line 568, in fit
return VW.fit(self, X=X, y=y, sample_weight=sample_weight)
File "/xxx/python3.8/site-packages/vowpalwabbit/sklearn.py", line 348, in fit
X = tovw(
File "/xxx/python3.8/site-packages/vowpalwabbit/sklearn.py", line 831, in tovw
dump_svmlight_file(x, np.zeros(rows), s)
File "/xxx/python3.8/site-packages/sklearn/datasets/_svmlight_format_io.py", line 525, in dump_svmlight_file
_dump_svmlight(X, y, f, multilabel, one_based, comment, query_id)
File "/xxx/python3.8/site-packages/sklearn/datasets/_svmlight_format_io.py", line 395, in _dump_svmlight
_dump_svmlight_file(
File "sklearn/datasets/_svmlight_format_fast.pyx", line 233, in sklearn.datasets._svmlight_format_fast._dump_svmlight_file
File "sklearn/datasets/_svmlight_format_fast.pyx", line 131, in sklearn.datasets._svmlight_format_fast.__pyx_fused_cpdef
TypeError: Function call with ambiguous argument types
Note the odd original type of X -- this is output from another feature generator. It is possible to convert X first to int64 and then to category to circumvent the problem mostly. Only a cleanup error remains.
For the moment, it is a viable option to first convert X to a signed integer type and then to categorical, however that might not always be the case. Furthermore, this behaviour should probably be documented.
How to reproduce
See above.
Version
vowpalwabbit==9.8.0
OS
macos
Language
python
Additional context
No response
The text was updated successfully, but these errors were encountered:
Thanks for opening this. I looked into it and we're using a function in sklearn that seems to not work for unsigned types. I've added a more descriptive type error (#4610) and opened an issue (#4609) to track a real fix for this.
Describe the bug
Running the following python code
gives a quite mysterious
Note the odd original type of
X
-- this is output from another feature generator. It is possible to convert X first toint64
and then tocategory
to circumvent the problem mostly. Only a cleanup error remains.For the moment, it is a viable option to first convert X to a signed integer type and then to categorical, however that might not always be the case. Furthermore, this behaviour should probably be documented.
How to reproduce
See above.
Version
vowpalwabbit==9.8.0
OS
macos
Language
python
Additional context
No response
The text was updated successfully, but these errors were encountered: