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
I would like to be able to pass the nullable pandas dtypes ("Int64", "Float64", "boolean") into sklearn's confusion_matrix function. Because the dtypes become object dtype when converted to numpy arrays we get ValueError: Classification metrics can't handle a mix of unknown and binary targets:
Describe the workflow you want to enable
I would like to be able to pass the nullable pandas dtypes ("Int64", "Float64", "boolean") into sklearn's
confusion_matrix
function. Because the dtypes become object dtype when converted to numpy arrays we getValueError: Classification metrics can't handle a mix of unknown and binary targets
:Repro with sklearn 1.2.1:
Describe your proposed solution
We should get the same behavior as when int64, float64, and bool dtypes are used, which is no error:
Describe alternatives you've considered, if relevant
Our current workaround is to convert the data to numpy arrays with the corresponding dtype that works prior to passing it into
confusion_matrix
Additional context
No response
The text was updated successfully, but these errors were encountered: