I have the following problem if anyone has a hint. I have made a map of attributes in my dataset. I map it like the one below, which has 300+ columns, ie, the size of the map “myAttrs” is 300+
Map<String, String> myAttrs = new HashMap<String, String>();
myAttrs.put(“Attr-1”, “Col-1”);
myAttrs.put(“Attr-2”, “Col-2”);
myAttrs.put(“Attr-3”, “Col-3”);
…
…
…
myAttrs.put(“Attr-m”, “Col-m”);
Booster booster = XGBoost.train(train, params, nround, watches, null, null);
booster.setAttrs(myAttrs);
Set myNameSet = myAttrs.keySet();
String[] featureNamesArr = myNameSet.toArray(new String[myNameSet.size()]);
String importanceType = Booster.FeatureImportanceType.GAIN;
Map<String,Double> myScore = booster.getScore(featureNamesArr, importanceType);
The size of the map “myScore” is not 300+. I saw only 5 output scores.
Why is it has 5 rather than 300+ importance-scores?
Any tip would be much appreciated.
Thanks.