public abstract class BaseClassifierEvaluationParser extends Object implements ClassifierEvaluationParser
Modifier and Type | Class and Description |
---|---|
static class |
BaseClassifierEvaluationParser.InstanceClassInfo |
ClassifierEvaluationParser.ParseOption
Modifier and Type | Field and Description |
---|---|
static Pattern |
wsDotPattern |
static Pattern |
wsPattern |
NO, YES
Constructor and Description |
---|
BaseClassifierEvaluationParser() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkFileRead(String file) |
static String |
extractFirstToken(String line,
Pattern tokDelimPattern) |
ClassifierEvaluationDao |
getClassifierEvaluationDao() |
protected String |
getFileBaseName(Properties kernelProps) |
protected void |
initClassifierEvaluation(String instanceIdFile,
ClassifierEvaluation eval) |
protected void |
initClassifierEvaluationFromProperties(Properties props,
ClassifierEvaluation eval) |
protected com.google.common.collect.BiMap<Integer,String> |
loadClassIdMap(File dataDir,
String label) |
protected List<List<Long>> |
loadClassInfo(File dataDir,
String classFileName) |
protected List<BaseClassifierEvaluationParser.InstanceClassInfo> |
loadInstanceClassInfo(File dataDir,
String classFileName) |
Properties |
loadProps(File outputDir)
load properties from outputDir/options.properties.
|
protected Double |
parseDoubleOption(Pattern pCost,
String options)
parse a number out of the libsvm command line that matches the specified
pattern.
|
List<Long> |
parseInstanceIds(String instanceIdFile) |
protected Integer |
parseIntOption(Pattern pKernel,
String options)
parse a number out of the libsvm command line that matches the specified
pattern.
|
void |
setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao) |
protected void |
storeSemiSupervised(Properties kernelProps,
ClassifierEvaluation ce,
com.google.common.collect.BiMap<Integer,String> classIdToNameMap) |
protected void |
updateSemiSupervisedPredictions(ClassifierEvaluation ce,
List<BaseClassifierEvaluationParser.InstanceClassInfo> listClassInfo,
boolean storeUnlabeled,
String[] predictedClassNames,
Map<String,Integer> classNameToIdMap) |
protected void |
updateSemiSupervisedPredictions(ClassifierEvaluation ce,
List<List<Long>> listClassInfo,
boolean storeUnlabeled,
int[] classIds)
used by semil & svmlin to store semisupervised predictions.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
parseDirectory
public static Pattern wsPattern
public static Pattern wsDotPattern
public ClassifierEvaluationDao getClassifierEvaluationDao()
public void setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao)
public List<Long> parseInstanceIds(String instanceIdFile) throws IOException
IOException
protected Double parseDoubleOption(Pattern pCost, String options)
pCost
- options
- protected Integer parseIntOption(Pattern pKernel, String options)
pKernel
- options
- protected void initClassifierEvaluation(String instanceIdFile, ClassifierEvaluation eval)
protected void initClassifierEvaluationFromProperties(Properties props, ClassifierEvaluation eval)
public Properties loadProps(File outputDir) throws FileNotFoundException, IOException
outputDir
- FileNotFoundException
IOException
protected boolean checkFileRead(String file)
protected String getFileBaseName(Properties kernelProps)
protected void storeSemiSupervised(Properties kernelProps, ClassifierEvaluation ce, com.google.common.collect.BiMap<Integer,String> classIdToNameMap)
protected void updateSemiSupervisedPredictions(ClassifierEvaluation ce, List<List<Long>> listClassInfo, boolean storeUnlabeled, int[] classIds)
ce
- updatedlistClassInfo
- the class info 0 - instance id, 1 - train/test, 2 - target
class idstoreUnlabeled
- should the unlabeled predictions be stored?classIds
- predicted class idsprotected void updateSemiSupervisedPredictions(ClassifierEvaluation ce, List<BaseClassifierEvaluationParser.InstanceClassInfo> listClassInfo, boolean storeUnlabeled, String[] predictedClassNames, Map<String,Integer> classNameToIdMap)
protected com.google.common.collect.BiMap<Integer,String> loadClassIdMap(File dataDir, String label) throws IOException
IOException
protected List<BaseClassifierEvaluationParser.InstanceClassInfo> loadInstanceClassInfo(File dataDir, String classFileName) throws IOException
IOException
protected List<List<Long>> loadClassInfo(File dataDir, String classFileName) throws IOException
IOException
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.