|
@@ -77,13 +77,13 @@ public class XGBoostTrain {
|
|
String[] fv = StringUtils.split(":");
|
|
String[] fv = StringUtils.split(":");
|
|
map.put(fv[0], NumberUtils.toDouble(fv[1], 0.0));
|
|
map.put(fv[0], NumberUtils.toDouble(fv[1], 0.0));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ int[] indices = new int[features.length];
|
|
|
|
+ double[] values = new double[features.length];
|
|
for (int i = 0; i < features.size(); i++) {
|
|
for (int i = 0; i < features.size(); i++) {
|
|
indices[i] = i;
|
|
indices[i] = i;
|
|
values[i] = map.getOrDefault(features.get(i), 0.0);
|
|
values[i] = map.getOrDefault(features.get(i), 0.0);
|
|
}
|
|
}
|
|
-
|
|
|
|
- int[] indices = new int[features.length];
|
|
|
|
- double[] values = new double[features.length];
|
|
|
|
SparseVector vector = new SparseVector(indices.length, indices, values);
|
|
SparseVector vector = new SparseVector(indices.length, indices, values);
|
|
return RowFactory.create(label, vector);
|
|
return RowFactory.create(label, vector);
|
|
});
|
|
});
|