jpmml / jpmml-r

Java library and command-line application for converting R models to PMML
GNU Affero General Public License v3.0
33 stars 8 forks source link

Add support for the tweedie distribution in GLM models #12

Open ghost opened 4 years ago

ghost commented 4 years ago

Hi,

I need to convert a GLM with tweedie link function in R to pmml. I see the current version only support binomial or gaussian. Is there a way to do this or if you can guide me where to specify the parameter for link function in pmml. I have checked on pmml.org they support tweedie distribution.

Regards Deepankar Arora

vruusmann commented 4 years ago

IIRC, the tweedie distribution uses exp as the inverse link function.

You can "transform" and ordinary (regression-type-) RegressionModel element to a tweedie one by specifying RegressionModel@normalizationMethod="exp".

vruusmann commented 4 years ago

A rather trivial code change.

It's currently not implemented, because the R2PMML/JPMML-R integration testing suite does not include a suitable dataset. Should import the "Visit" dataset from JPMML-LightGBM or JPMML-XGBoost integration testing suites.