Comments (22)
I'll have a look today.
from onnxmltools.
No sorry, I was busy with something else. I'll try to do it this month.
from onnxmltools.
I did not have time to work on this, doing some work with pytorch and onnx. I have 2 or 3 issues to fix on skl2onnx and onnxmltools. I planned to spend 2 or 3 days on them by the end of the month. Sorry for the delay again.
from onnxmltools.
Not yet. If only the training is different from XGBRgressor, it should not be too difficult to add. Let me investigate.
from onnxmltools.
@xadupre That would be great if there's a workaround on this!
from onnxmltools.
I created a PR to support these models. It seems to work with the same converter but it could be helpful to check on your side as well.
from onnxmltools.
@xadupre Thanks! Would you mind sending a link to the PR since I'm interested to know when it might make it to a release?
EDIT: I found it no worries. Let me know when/how to test this I'd be glad to do so.
from onnxmltools.
#665 (it appears above but maybe that's just for me).
from onnxmltools.
@xadupre yep saw that
from onnxmltools.
Hi @xadupre ! Do you have an estimate on when this is gonna make it to a next release?
from onnxmltools.
We plan to release a new version before December 14th.
from onnxmltools.
Thanks, much appreciated!
from onnxmltools.
The new version was released and fixes this issue. Feel free to reopen the issue if it does not work.
from onnxmltools.
I'll try and let you know, thank you!
from onnxmltools.
Hi @xadupre, I've tested the newest version with XGBRFClassifier
and seems the ONNX
probabilities are not matching those of the original model.
I got a simple XGBRFClassifier
trained as follows:
dataset = load_iris()
X, y = dataset.data, dataset.target
model = XGBRFClassifier()
model.fit(X, y)
and run the following code to get predictions and probabilities from both the original and the ONNX
equivalent:
onnx_model = onnx.load((tmp_path / "model.onnx").as_posix())
session = rt.InferenceSession((tmp_path / "model.onnx").as_posix())
data = np.random.rand(2, 4).astype(np.float32)
model_predictions = model.predict(data)
model_probabilities = model.predict_proba(data)
onnx_predictions, onnx_probabilities = session.run(
["label", "probabilities"], {"input": data}
)
However I'm getting different probabilities in the two occasions:
I'm using TARGET_OPSET=15
. Also, shouldn't all ONNX
probabilities sum up to 1 as with the original model?
from onnxmltools.
I was able to replicate the bug. I assumed XGBClassifier and XGBRFClassifier were the same when it comes to prediction since the code is the same. It turns out they are the same if n_estimators=1
and different for any value above. I did not find out where the difference is and how to retrieve that information at conversion time. I just know method get_num_boosting_rounds is different. It is only used at training. Maybe if you tell me what you are using XGBRFClassifier and not XGBClassifier, I would be able to guess where I should look at.
from onnxmltools.
@xadupre I'm using the default values for XGBRFClassifier
during training, just for testing purposes. Thanks for having a look at this, much appreciated!
from onnxmltools.
Hi @xadupre! Is it something trivial to fix or it seems like a bigger issue? Anything I can help you with?
from onnxmltools.
Sorry, I did not have time to look into this this week. It is not trivial to find (at least for me). Since the conversion of trees is working, I'm usually looking for wrong base values or a wrong number of estimators (early stopping). I parsed the dumped trees to look for additional information but nothing was obvious. My next step is to compare the dump between XGBClassifier and XGBRFClassifier on the same data to understand what the differences are. If the dump is different, then it is a converting issue. If the dump is the same, then the code for inference is different and I need to reflect that somehow in the onnx graph. Here is my current status.
from onnxmltools.
I see, no worries! Please let me know if there any developments on this bug fix :)
from onnxmltools.
Hi @xadupre, is there any progress on this bug?
from onnxmltools.
@xadupre is there any progress on this?
from onnxmltools.
Related Issues (20)
- Trying to export MultiOutputRegressor(LGBMRegressor()) to onnx
- XGBoost 2.0.0 breaking changes HOT 3
- cannot import name 'FEATURE_IMPORTANCE_TYPE_MAPPER' from 'lightgbm.basic' HOT 5
- XGBRegressor with objective='count:poisson' causes serialization to fail with no error message HOT 1
- Please help validate release candidate for ONNX 1.15.0rc1 HOT 1
- What version of TensorFlow is supported by onnxmltools? HOT 1
- `TreeEnsembleRegressor` introduces an additional batch dimension HOT 2
- Mismatch between XGBoost and converted onnx, with respect to "colsample_bytree"
- XGBoost best_ntree_limit is removed in 2.0 and trying to access this value HOT 1
- XGBClassifier conversion to onnx gives wrong predictions if dataset has only 2 categories (xgboost 2.0)
- XGBRegressor conversion to onnx gives wrong predictions for xgboost 2.0
- No module named 'onnxconverter_common' HOT 2
- onnx converted : xgboostRegressor multioutput model predicts 1 dimension instead of original 210 dimensions. HOT 3
- UNABLE_TO_INFER_SCHEMA on pyspark
- Integrate with ONNX 1.16.0 release branch HOT 1
- Please help validate release candidate for ONNX 1.16.0rc2 HOT 1
- Python 3.9 CoreML conversion HOT 5
- RandomForestClassifier: ONNX output converts all BRANCH_LEQ to BRANCH_EQ HOT 1
- Standard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxmltools.