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

PredictSingle Error for binary classifier #47

Open
amod99 opened this issue May 24, 2020 · 1 comment
Open

PredictSingle Error for binary classifier #47

amod99 opened this issue May 24, 2020 · 1 comment

Comments

@amod99
Copy link

amod99 commented May 24, 2020

I am getting below error when trying to predict for single example on binary classifier model.
java.lang.IllegalStateException: Can't invoke predictSingle() because this model outputs multiple values: 0
Below is code :

Predictor predictor = new Predictor(
new java.io.FileInputStream("path-to-model-file"));

// Create feature vector from sparse representation by map
FVec fVecSparse = FVec.Transformer.fromMap(
new java.util.HashMap<Integer, Double>() {{
put(49722683, 0.);
put(123455, 1.);
put(50000001, 1.3979400086720377);

                }});        

double pred = predictor.predictSingle(fVecSparse);
@amod99
Copy link
Author

amod99 commented May 25, 2020

Please see this thread dmlc/xgboost#5695 . Can you add support for latest xgboost model format ?

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

1 participant