How do we unpack a DimensionTuple?
See original GitHub issueAsk the question
I’m trying to unpack the prediction results after calling model.predict(data)
, I get a ArrayList
of Prediction
items.
Each Prediction
item in my case is of type Regressor.DimensionTuple
, there is a getOutput()
method and a getValues()
on it but neither give me the prediction value (numeric). It seems there isn’t an easy method/API to get this out.
When I call this xgbModel.predict(data).get(0).getOutput()
, I get this (DIM-0,5.982707500457764)
When I call this xgbModel.predict(data).get(0).getOutput().getValues()
, I get this [D@6b788c95
, the getDimensionNamesString()
works but not the one to get the value corresponding to it.
What am I not doing? This I believe is an important function. I have been looking at the docs at https://tribuo.org/learn/4.0/javadoc/org/tribuo/regression/Regressor.DimensionTuple.html
Is your question about a specific Tribuo class? Class Regressor.DimensionTuple,
Additional context Using the prediciton results to do further analysis.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Nice work @Craigacp loving these new PRs and changes
We could add a
public DimensionTuple get(int idx)
method toRegressor
which would return the single dimension requested, and then you could callgetValue()
on that if you wanted, but it’s about the same.