Package org.instantsvm.utils
Class LibSvmIO
- java.lang.Object
-
- org.instantsvm.utils.LibSvmIO
-
public class LibSvmIO extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEF_CSV_INPUT_NAMEstatic StringDEF_INPUT_NAMEstatic StringDEF_MODEL_NAMEstatic StringDIR_DATASETSstatic StringDIR_MODELS
-
Constructor Summary
Constructors Constructor Description LibSvmIO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static doubleatof(String s)protected static intatoi(String s)static StringdefaultInputDirectory(String name)static StringdefaultInputPath(String name)static StringdefaultInputPath(String name, boolean isCsv)static StringdefaultModelDirectory(String name)static StringdefaultModelPath(String name)static svm_modelloadModel(String filename)static RegressionInputsloadRegression(String filename)Load CSV format if file ends with ".csv", or LIBSVM data format otherwise.static RegressionInputsloadRegressionCsv(String filename)static RegressionInputsloadRegressionOriginalFormat(String filename)protected static intreadNLines(String filename)
-
-
-
Field Detail
-
DIR_DATASETS
public static final String DIR_DATASETS
- See Also:
- Constant Field Values
-
DIR_MODELS
public static final String DIR_MODELS
- See Also:
- Constant Field Values
-
DEF_INPUT_NAME
public static final String DEF_INPUT_NAME
- See Also:
- Constant Field Values
-
DEF_CSV_INPUT_NAME
public static final String DEF_CSV_INPUT_NAME
- See Also:
- Constant Field Values
-
DEF_MODEL_NAME
public static final String DEF_MODEL_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
loadRegression
public static RegressionInputs loadRegression(String filename) throws IOException
Load CSV format if file ends with ".csv", or LIBSVM data format otherwise.- Throws:
IOException
-
loadRegressionOriginalFormat
public static RegressionInputs loadRegressionOriginalFormat(String filename) throws IOException
- Throws:
IOException
-
loadModel
public static svm_model loadModel(String filename) throws IOException
- Throws:
IOException
-
atof
protected static double atof(String s)
-
atoi
protected static int atoi(String s)
-
loadRegressionCsv
public static RegressionInputs loadRegressionCsv(String filename) throws IOException
- Throws:
IOException
-
readNLines
protected static int readNLines(String filename) throws IOException
- Throws:
IOException
-
-