Comments (9)
@vruusmann hopefully you'll be able to help me. I generated PMML files for the models in the jpmml-lightgbm package to compare to my model and some of them contain "transformedLgbmValue". I'm however struggling to get this to work with the openscoring-service. Any help would be much appreciated cheers.
from openscoring.
It's interesting that the same (and possibly very major) issue gets reported twice by two different people in such a short timeframe.
Issue 47 is about XGBoost, whereas this issue is about LightGBM. However, the exception condition is exactly the same - the second stage of a GBT model (a RegressionModel
element that performs the logit transformation) thinks that the first stage of the GBT model (a MiningModel
element) returned a missing value as a prediction.
This issue provides a fully reproducible example, so I can observe this exceptional behaviour myself - thanks for that!
I'm puzzled right now. In most cases this exception means that the first stage of the GBT model was executed with incomplete input. But I can see that in this case the argument data record is complete (contains values for all seven input fields).
from openscoring.
The most puzzling part for me is that if I download the latest 1.4.8 release of the JPMML-Evaluator command-line application, and convert the JSON request to a CSV file request, then the prediction succeeds without problem:
$ java -jar pmml-evaluator-example-executable-1.4.8.jar --model lightgbm.pmml --input input.csv --output output.csv
If there was a problem with the PMML file, or the 1.4.8 version of the JPMML-Evaluator library, then the above execution should fail with the same org.jpmml.evaluator.MissingFieldException: Field "transformedLgbmValue" is not defined
message. But the prediction is successful - this suggests that there's something wrong with the Openscoring REST web service layer.
It's worth pointing out that issue 47 reports that the latest 1.4.X release of Openscoring works fine. It's the 2.0-SNAPSHOT codebase (ie. git clone) that is broken.
from openscoring.
On line 60 of the example lightgbm.pmml.txt
file there is the following OutputField
element declaration:
<OutputField name="transformedLgbmValue" optype="continuous" dataType="double" feature="transformedValue" isFinalResult="false">
If the value of the OutputField@isFinalResult
attribute is changed from false
to true
, then the scoring works fine:
<OutputField name="transformedLgbmValue" optype="continuous" dataType="double" feature="transformedValue" isFinalResult="true">
This attribute value was toggled in one of the latest JPMML-LightGBM (as well as JPMML-XGBoost) releases. Both false
and true
values are valid in that location. However, looks like that Openscoring is using an output field filtering strategy, which is pruning non-final output field values a bit too aggressively.
from openscoring.
@vruusmann so the current solution is to modify the xgb/lgb pmml file manually?
from openscoring.
Cheers @vruusmann
from openscoring.
I am getting Field "expDecisionFunction(0)" is not defined
for an iris.pmml
created from GradientBoostingClassifier
by sklearn2pmml
.
Is this related or should I create a separate issue?
from openscoring.
@sam-s If you're absolutely sure that your input data record is complete (ie. there are no missing/omitted) values, then it's the same thing
from openscoring.
It's possible to disable output field filtering by commenting out this line (invocation of ModelEvaluatorBuilder#setOutputFilter(OutputFilters.KEEP_FINAL_RESULTS)
):
https://github.com/openscoring/openscoring/blob/master/openscoring-service/src/main/java/org/openscoring/service/Openscoring.java#L195
This issue only affects the WIP codebase. If you've bothered to build a WIP version manually, then my recommendation is that you should comment out the above line, and rebuild.
from openscoring.
Related Issues (20)
- Excess use of memory by pmml.gz files HOT 1
- Openscoring war deployment on Tomcat- admin role authorization HOT 2
- get the predictions results HOT 1
- [Question] Default folder for loading models? HOT 1
- tensorflow serving support HOT 2
- Client side throw an exception that java.lang.IllegalStateException: InjectionManagerFactory not found. HOT 2
- .pmml not reconize on upload
- Is there a configuration for enabling/disabling REST endpoints HOT 1
- Error: SEVERE: Failed to evaluate java.lang.NumberFormatException: For input string: "X" HOT 2
- feature request: add deploy method - pip/docker HOT 2
- How to enable CORS for the Server HOT 1
- the lastest jar version 2.0 "xgbValue" is not defined HOT 1
- IllegalArgumentException: Attribute 'GradientBoostingClassifier.loss_' has an unsupported value (Python class BinomialDeviance) HOT 1
- Service should log information about exceptional conditions before raising an exception HOT 6
- "message" : "Attribute with value RegressionTable@targetCategory=1 is not valid" HOT 4
- How to define the model.version? HOT 1
- openscoring-docker -- PMML 4.4 not supported HOT 1
- Missing derived field declaration HOT 2
- Secured requests 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 openscoring.