Skip to content

Error when compiling exported Java code using javac: Too many constants #298

@kijz

Description

@kijz

Hi!

I have problems when compiling the generated Java Code from m2cgen.
I am using an XGBClassifier with n_estimators = 400.
The generated code is ~360k lines long, which is around 17MB.

Unfortunately, this code does not compile with javac as i get this error:

Model.java:1: error: too many constants
public class Model {
       ^
1 error

Using the approach suggested in #297, i have managed to split the score function into subroutines, which unfortunately does not fix my problem.

Is there any workaround for this type of error?
Manually adjusting the file is not really an option since i am planning to create a large number of models and compare them

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions