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 String
DEF_CSV_INPUT_NAME
static String
DEF_INPUT_NAME
static String
DEF_MODEL_NAME
static String
DIR_DATASETS
static String
DIR_MODELS
-
Constructor Summary
Constructors Constructor Description LibSvmIO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static double
atof(String s)
protected static int
atoi(String s)
static String
defaultInputDirectory(String name)
static String
defaultInputPath(String name)
static String
defaultInputPath(String name, boolean isCsv)
static String
defaultModelDirectory(String name)
static String
defaultModelPath(String name)
static svm_model
loadModel(String filename)
static RegressionInputs
loadRegression(String filename)
Load CSV format if file ends with ".csv", or LIBSVM data format otherwise.static RegressionInputs
loadRegressionCsv(String filename)
static RegressionInputs
loadRegressionOriginalFormat(String filename)
protected static int
readNLines(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
-
-