|
@@ -9,8 +9,10 @@ import org.apache.commons.lang.math.NumberUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
+import java.io.File;
|
|
|
import java.io.InputStream;
|
|
|
import java.io.InputStreamReader;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
@@ -81,7 +83,8 @@ public class XGBoostModel extends Model {
|
|
|
public boolean loadFromStream(InputStream in) throws Exception {
|
|
|
String modelDir = PropertiesUtil.getString("model.xgboost.path");
|
|
|
CompressUtil.decompressGzFile(in, modelDir);
|
|
|
- XGBoostClassificationModel model2 = XGBoostClassificationModel.load("file://" + modelDir);
|
|
|
+ String absolutePath =new File(rpath).getAbsolutePath();
|
|
|
+ XGBoostClassificationModel model2 = XGBoostClassificationModel.load("file://" + absolutePath);
|
|
|
model2.setMissing(0.0f);
|
|
|
this.model = model2;
|
|
|
return true;
|