public class LibSVMParser extends BaseClassifierEvaluationParser
BaseClassifierEvaluationParser.InstanceClassInfo
ClassifierEvaluationParser.ParseOption
Modifier and Type | Field and Description |
---|---|
static Pattern |
labelsPattern |
static Pattern |
pCost |
static Pattern |
pDegree |
static Pattern |
pGamma |
static Pattern |
pKernel |
static Pattern |
pWeight |
static Pattern |
totalSVPattern |
wsDotPattern, wsPattern
NO, YES
Constructor and Description |
---|
LibSVMParser() |
Modifier and Type | Method and Description |
---|---|
protected SVMClassifierEvaluation |
initClassifierEval(String name,
String experiment,
String label,
String options,
String instanceIdFile) |
protected List<Integer> |
parseClassIds(BufferedReader predictionReader)
parse class ids from first line in prediction file.
|
void |
parseDirectory(File dataDir,
File outputDir)
parse directory.
|
Integer |
parseModel(String modelFile)
parse svm-train model file to get the number of support vectors.
|
protected void |
parseOptions(SVMClassifierEvaluation eval,
String options) |
protected void |
parsePredictions(String predictionFile,
String instanceFile,
Properties props,
String instanceIdFile,
SVMClassifierEvaluation eval)
parse predicted class ids, probabilities; correlate to target class ids
and instance ids.
|
protected void |
parseResults(File dataDir,
File outputDir,
String model,
String predict,
SVMClassifierEvaluation eval,
Properties props)
parse the results in the specified output dir.
|
protected void |
storeResults(File dataDir,
Properties props,
SVMClassifierEvaluation eval)
store the parsed classifier evaluation
|
checkFileRead, extractFirstToken, getClassifierEvaluationDao, getFileBaseName, initClassifierEvaluation, initClassifierEvaluationFromProperties, loadClassIdMap, loadClassInfo, loadInstanceClassInfo, loadProps, parseDoubleOption, parseInstanceIds, parseIntOption, setClassifierEvaluationDao, storeSemiSupervised, updateSemiSupervisedPredictions, updateSemiSupervisedPredictions
public static Pattern labelsPattern
public static Pattern totalSVPattern
public static Pattern pKernel
public static Pattern pGamma
public static Pattern pCost
public static Pattern pWeight
public static Pattern pDegree
public Integer parseModel(String modelFile) throws IOException
modelFile
- IOException
protected List<Integer> parseClassIds(BufferedReader predictionReader) throws IOException
predictionReader
- IOException
protected SVMClassifierEvaluation initClassifierEval(String name, String experiment, String label, String options, String instanceIdFile)
protected void parsePredictions(String predictionFile, String instanceFile, Properties props, String instanceIdFile, SVMClassifierEvaluation eval) throws IOException
predictionFile
- prediction (output)instanceFile
- input data file; contains target class idsprops
- instanceIdFile
- instance ids corresponding to lines in input data fileeval
- IOException
protected void parseOptions(SVMClassifierEvaluation eval, String options)
public void parseDirectory(File dataDir, File outputDir) throws IOException
IOException
protected void storeResults(File dataDir, Properties props, SVMClassifierEvaluation eval) throws IOException
props
- eval
- IOException
protected void parseResults(File dataDir, File outputDir, String model, String predict, SVMClassifierEvaluation eval, Properties props) throws IOException
dataDir
- outputDir
- model
- predict
- eval
- props
- IOException
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.