public class KernelUtilImpl extends Object implements KernelUtil
Constructor and Description |
---|
KernelUtilImpl() |
Modifier and Type | Method and Description |
---|---|
void |
exportClassIds(String outdir,
Map<String,Integer> classIdMap,
String label)
export the class id to class name map.
|
void |
fillGramMatrix(KernelEvaluation kernelEvaluation,
SortedSet<Long> trainInstanceLabelMap,
double[][] trainGramMatrix) |
void |
fillLabelToClassToIndexMap(Map<String,SortedSet<String>> labelToClasMap,
Map<String,com.google.common.collect.BiMap<String,Integer>> labelToClassIndexMap)
assign numeric indices to string class names
|
void |
generateFolds(InstanceData instanceLabel,
Properties props)
generate folds from the label to instance map.
|
ClassifierEvaluationDao |
getClassifierEvaluationDao() |
DataSource |
getDataSource() |
FoldGenerator |
getFoldGenerator() |
KernelEvaluationDao |
getKernelEvaluationDao() |
org.springframework.transaction.PlatformTransactionManager |
getTransactionManager() |
double[][] |
loadGramMatrix(SortedSet<Long> instanceIds,
String name,
String splitName,
String experiment,
String label,
int run,
int fold,
double param1,
String param2) |
InstanceData |
loadInstances(String strQuery)
this can be very large - avoid loading the entire jdbc ResultSet into
memory
|
void |
loadProperties(String propertyFile,
Properties props) |
void |
setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao) |
void |
setDataSource(DataSource dataSource) |
void |
setFoldGenerator(FoldGenerator foldGenerator) |
void |
setKernelEvaluationDao(KernelEvaluationDao kernelEvaluationDao) |
void |
setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager) |
public FoldGenerator getFoldGenerator()
public void setFoldGenerator(FoldGenerator foldGenerator)
public void fillGramMatrix(KernelEvaluation kernelEvaluation, SortedSet<Long> trainInstanceLabelMap, double[][] trainGramMatrix)
fillGramMatrix
in interface KernelUtil
public ClassifierEvaluationDao getClassifierEvaluationDao()
public DataSource getDataSource()
public KernelEvaluationDao getKernelEvaluationDao()
public org.springframework.transaction.PlatformTransactionManager getTransactionManager()
public double[][] loadGramMatrix(SortedSet<Long> instanceIds, String name, String splitName, String experiment, String label, int run, int fold, double param1, String param2)
loadGramMatrix
in interface KernelUtil
public InstanceData loadInstances(String strQuery)
loadInstances
in interface KernelUtil
public void loadProperties(String propertyFile, Properties props) throws FileNotFoundException, IOException, InvalidPropertiesFormatException
loadProperties
in interface KernelUtil
FileNotFoundException
IOException
InvalidPropertiesFormatException
public void setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao)
public void setDataSource(DataSource dataSource)
public void setKernelEvaluationDao(KernelEvaluationDao kernelEvaluationDao)
public void setTransactionManager(org.springframework.transaction.PlatformTransactionManager transactionManager)
public void generateFolds(InstanceData instanceLabel, Properties props)
KernelUtil
generateFolds
in interface KernelUtil
public void fillLabelToClassToIndexMap(Map<String,SortedSet<String>> labelToClasMap, Map<String,com.google.common.collect.BiMap<String,Integer>> labelToClassIndexMap)
fillLabelToClassToIndexMap
in interface KernelUtil
labelToClasMap
- labelToClassIndexMap
- public void exportClassIds(String outdir, Map<String,Integer> classIdMap, String label) throws IOException
exportClassIds
in interface KernelUtil
classIdMap
- label
- run
- fold
- IOException
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.