Skip to content
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

java.lang.IllegalArgumentException: reg:squarederror #174

Closed
matigurten opened this issue Oct 20, 2019 · 1 comment
Closed

java.lang.IllegalArgumentException: reg:squarederror #174

matigurten opened this issue Oct 20, 2019 · 1 comment

Comments

@matigurten
Copy link

matigurten commented Oct 20, 2019

I create and fit a pipeline with the following model:

XGBRF_Regressor_pipe = Pipeline([
    ('scaler', StandardScaler()),
    ('reg', xgb.XGBRFRegressor(n_estimators= 5, criterion="mse", max_depth=5, random_state=0, objective ='reg:squarederror'))])

Because when I don't use " objective ='reg:squarederror' " a warning rises saying:

[22:05:01] WARNING: C:/Jenkins/workspace/xgboost-win64_release_0.90/src/objective/regression_obj.cu:152: reg:linear is now deprecated in favor of reg:squarederror.

Converting it to PMML gives the following error:

Standard output is empty
Standard error:
 20, 2019 9:58:25 PM org.jpmml.sklearn.Main run
INFO: Parsing PKL..
 20, 2019 9:58:25 PM org.jpmml.sklearn.Main run
INFO: Parsed PKL in 38 ms.
 20, 2019 9:58:25 PM org.jpmml.sklearn.Main run
INFO: Converting..
 20, 2019 9:58:26 PM org.jpmml.sklearn.Main run
SEVERE: Failed to convert
java.lang.IllegalArgumentException: reg:squarederror
	at org.jpmml.xgboost.Learner.load(Learner.java:97)
	at org.jpmml.xgboost.XGBoostUtil.loadLearner(XGBoostUtil.java:53)
	at xgboost.sklearn.Booster.loadLearner(Booster.java:52)
	at xgboost.sklearn.Booster.getLearner(Booster.java:42)
	at xgboost.sklearn.BoosterUtil.getLearner(BoosterUtil.java:72)
	at xgboost.sklearn.BoosterUtil.getNumberOfFeatures(BoosterUtil.java:40)
	at xgboost.sklearn.XGBRegressor.getNumberOfFeatures(XGBRegressor.java:35)
	at sklearn2pmml.pipeline.PMMLPipeline.encodePMML(PMMLPipeline.java:222)
	at org.jpmml.sklearn.Main.run(Main.java:145)
	at org.jpmml.sklearn.Main.main(Main.java:94)

Exception in thread "main" java.lang.IllegalArgumentException: reg:squarederror
	at org.jpmml.xgboost.Learner.load(Learner.java:97)
	at org.jpmml.xgboost.XGBoostUtil.loadLearner(XGBoostUtil.java:53)
	at xgboost.sklearn.Booster.loadLearner(Booster.java:52)
	at xgboost.sklearn.Booster.getLearner(Booster.java:42)
	at xgboost.sklearn.BoosterUtil.getLearner(BoosterUtil.java:72)
	at xgboost.sklearn.BoosterUtil.getNumberOfFeatures(BoosterUtil.java:40)
	at xgboost.sklearn.XGBRegressor.getNumberOfFeatures(XGBRegressor.java:35)
	at sklearn2pmml.pipeline.PMMLPipeline.encodePMML(PMMLPipeline.java:222)
	at org.jpmml.sklearn.Main.run(Main.java:145)
	at org.jpmml.sklearn.Main.main(Main.java:94)

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-18-94a7e51504f7> in <module>()
----> 1 pmml_export(my_model, X_train[normalization_features], model_name, use_nyoka = False)

C:\Barak\Python\V9\A_Utils.ipynb in pmml_export(my_model, X_train, filename, pmml_path, downgrade, save_pickle, use_nyoka)
    674    "cell_type": "code",
    675    "execution_count": 18,
--> 676    "metadata": {
    677     "ExecuteTime": {
    678      "end_time": "2019-10-18T01:22:31.104164Z",

c:\users\mati\appdata\local\programs\python\python36\lib\site-packages\sklearn2pmml\__init__.py in sklearn2pmml(pipeline, pmml, user_classpath, with_repr, debug, java_encoding)
    251                                 print("Standard error is empty")
    252                 if retcode:
--> 253                         raise RuntimeError("The JPMML-SkLearn conversion application has failed. The Java executable should have printed more information about the failure into its standard output and/or standard error streams")
    254         finally:
    255                 if debug:

RuntimeError: The JPMML-SkLearn conversion application has failed. The Java executable should have printed more information about the failure into its standard output and/or standard error streams
@vruusmann
Copy link
Member

Duplicate of jpmml/jpmml-xgboost#43

Has got nothing to do with the JPMML-Evaluator library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants