public class ImputedFeatureEvaluatorImpl extends Object implements ImputedFeatureEvaluator
The mutual information of each concept is stored in the feature_rank table. The related records in the feature_eval table have the following values:
evaluateCorpus(Parameters)
load instances, iterate through
labels
evaluateCorpusLabel(Parameters, ConceptGraph, InstanceData, String)
load concept - set[document] map for the specified label, iterate through
folds
evaluateCorpusFold(Parameters, Map, ConceptGraph, InstanceData, String, Map, int)
create raw joint distribution of each concept, compute parent joint
distributions, assign children mutual info of parents
completeJointDistroForFold(Map, Map, Set, Set, String)
computes
raw joint distribution of each concept
propagateJointDistribution(Map, Parameters, String, int, ConceptGraph, Map)
recursively compute parent joint distribution by merging joint distro of
children.
#storeChildConcepts(Parameters, String, int, ConceptGraph)
take
top ranked parent concepts, assign concepts in subtrees the mutual info of
parents. Only concepts that exist in the corpus are added (depends on
computing the infocontent of concepts with CorpusEvaluator)
Modifier and Type | Class and Description |
---|---|
class |
ImputedFeatureEvaluatorImpl.ConceptInstanceMapExtractor
fill in map of Concept Id - bin - instance ids
|
static class |
ImputedFeatureEvaluatorImpl.JointDistribution
joint distribution of concept (x) and class (y).
|
static class |
ImputedFeatureEvaluatorImpl.Parameters
We are passing around quite a few parameters.
|
ImputedFeatureEvaluator.MeasureType
Modifier and Type | Field and Description |
---|---|
protected ClassifierEvaluationDao |
classifierEvaluationDao |
protected ConceptDao |
conceptDao |
protected org.springframework.jdbc.core.JdbcTemplate |
jdbcTemplate |
protected KernelUtil |
kernelUtil |
protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate |
namedParamJdbcTemplate |
protected org.springframework.transaction.PlatformTransactionManager |
transactionManager |
SUFFIX_IMPUTED, SUFFIX_IMPUTED_FILTERED, SUFFIX_PROP
Constructor and Description |
---|
ImputedFeatureEvaluatorImpl() |
protected ClassifierEvaluationDao classifierEvaluationDao
protected ConceptDao conceptDao
protected org.springframework.jdbc.core.JdbcTemplate jdbcTemplate
protected KernelUtil kernelUtil
protected org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate namedParamJdbcTemplate
protected org.springframework.transaction.PlatformTransactionManager transactionManager
protected static double entropy(double[] classProbs)
protected static double entropy(Iterable<Double> classProbs)
classProbs
- public static void main(String[] args) throws org.apache.commons.cli.ParseException, IOException
org.apache.commons.cli.ParseException
IOException
public boolean evaluateCorpus(ImputedFeatureEvaluatorImpl.Parameters params)
evaluateCorpus
in interface ImputedFeatureEvaluator
public boolean evaluateCorpus(String propFile) throws IOException
evaluateCorpus
in interface ImputedFeatureEvaluator
IOException
public ClassifierEvaluationDao getClassifierEvaluationDao()
public ConceptDao getConceptDao()
public DataSource getDataSource(DataSource ds)
public InfoContentEvaluator getInfoContentEvaluator()
public KernelUtil getKernelUtil()
public Properties getYtexProperties()
public void setClassifierEvaluationDao(ClassifierEvaluationDao classifierEvaluationDao)
public void setConceptDao(ConceptDao conceptDao)
public void setDataSource(DataSource ds)
public void setInfoContentEvaluator(InfoContentEvaluator infoContentEvaluator)
public void setKernelUtil(KernelUtil kernelUtil)
public void setYtexProperties(Properties ytexProperties)
public void storeChildConcepts(List<FeatureRank> listRawRanks, ImputedFeatureEvaluatorImpl.Parameters params, String label, int foldId, ConceptGraph cg, boolean bAll)
labelEval
- parentConceptTopThreshold
- parentConceptEvalThreshold
- cg
- bAll
- impute to all concepts/concepts actually in corpus. if we are
imputing to all concepts, filter by infocontent (this includes
hypernyms of concepts in the corpus). else only impute to
conrete concepts in the corpusCopyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.