-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add support to sklearn TargetEncoder #1137
base: main
Are you sure you want to change the base?
Conversation
Thanks for the contribution. One line should be removed. Everything else looks good. |
[("input", StringTensorType([None, X.shape[1]]))], | ||
target_opset=TARGET_OPSET, | ||
) | ||
self.assertTrue(model_onnx is not None) |
Check notice
Code scanning / CodeQL
Imprecise assert Note test
target_opset=TARGET_OPSET, | ||
) | ||
self.assertTrue(model_onnx is not None) | ||
self.assertTrue(model_onnx.graph.node is not None) |
Check notice
Code scanning / CodeQL
Imprecise assert Note test
[("input", Int64TensorType([None, X.shape[1]]))], | ||
target_opset=TARGET_OPSET, | ||
) | ||
self.assertTrue(model_onnx is not None) |
Check notice
Code scanning / CodeQL
Imprecise assert Note test
target_opset=TARGET_OPSET, | ||
) | ||
self.assertTrue(model_onnx is not None) | ||
self.assertTrue(model_onnx.graph.node is not None) |
Check notice
Code scanning / CodeQL
Imprecise assert Note test
model_onnx = convert_sklearn( | ||
model, "ordinal encoder two string cats", inputs, target_opset=TARGET_OPSET | ||
) | ||
self.assertTrue(model_onnx is not None) |
Check notice
Code scanning / CodeQL
Imprecise assert Note test
Signed-off-by: boccaff <[email protected]>
Signed-off-by: boccaff <[email protected]>
Signed-off-by: boccaff <[email protected]>
e945a85
to
e243865
Compare
Thanks for the comments @xadupre. I've removed the line, and solved a couple of the CodeQL suggestions (removed an unused import and an unused variable). The rest of the CodeQL suggested changes would diverge from the other implementations. For the |
Signed-off-by: boccaff <[email protected]>
Signed-off-by: boccaff <[email protected]>
This PR implements a converter and a shape calculator for the TargetEncoder class introduced in Scikit-learn 1.5. The code follows much of the implementation of the converter for Ordinal Encoder.
A partial suit of tests is already implemented, but there is at least a couple of additional tests that I would like to add (missing values and using the smooth parameter from sklearn, even though I think it shouldn't matter).