Skip to content

Commit

Permalink
FIX:win libsvm convert tool & predict batch file
Browse files Browse the repository at this point in the history
  • Loading branch information
scharoun committed May 20, 2017
1 parent 9283552 commit 3ce9925
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/win_libsvm_convert_2_ytklearn.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
echo on
@Rem binary_classification@label1,label2, multi_classification@label1,label2,..., regression
set mode= ???
set mode=???

set x_delim="###"
set y_delim=","
Expand All @@ -11,6 +11,7 @@ set fs_scheme="???"
set libsvm_data_path="???"
set ytklearn_data_path="???"

cd ..
@start /b cmd /c java -Xmx1000m -XX:-OmitStackTraceInFastThrow -cp lib/* -Dlog4j.configuration=file:config/log4j.properties com.fenbi.ytklearn.utils.LibsvmConvertTool %mode% %x_delim% %y_delim% %features_delim% %feature_name_val_delim% %fs_scheme% %libsvm_data_path% %ytklearn_data_path%

pause
1 change: 1 addition & 0 deletions bin/win_predict.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set eval_metric="auc,mae"
@Rem value or leafid
set predict_type=value

cd ..
@start /b cmd /c java -Xmx1000m -XX:-OmitStackTraceInFastThrow -cp lib/* -Dlog4j.configuration=file:config/log4j.properties com.fenbi.ytklearn.predictor.Predicts %config_path% %model_name% %file_name% %transform% %transform_script_path% %resultSaveMode% %resultFileSuffix% %max_error_tol% %eval_metric% %predict_type%

pause
5 changes: 4 additions & 1 deletion src/main/java/com/fenbi/ytklearn/fs/LocalFileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ public Reader getReader(String path) throws IOException {

@Override
public Writer getWriter(String path) throws IOException {
mkdirs(new File(path).getParentFile().getAbsolutePath());
File parentFile = new File(path).getParentFile();
if (parentFile != null) {
mkdirs(parentFile.getAbsolutePath());
}
return new PrintWriter(path);
}

Expand Down

0 comments on commit 3ce9925

Please sign in to comment.