|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.bddbddb.FindBestDomainOrder
public class FindBestDomainOrder
FindBestDomainOrder Design: TrialInfo : order, cost EpisodeCollection : collection of TrialInfo, best time, worst time Constraint: a ConstraintInfo collection Rule -> ConstraintInfo collection EpisodeCollection -> ConstraintInfo collection Algorithm to compute best order: - Combine and sort single constraints from relation, rule, trials so far. Sort by score*confidence (?) Combine and adjust opposite constraints (?) Sort by difference between opposite constraints (?) - Do an A* search. Keep track of the current score/confidence as we add constraints. As we add new constraints, flag conflicting ones. Predict final score by combining top n non-conflicting constraints (?) If prediction is worse than current best score, return immediately.
Nested Class Summary | |
---|---|
static class |
FindBestDomainOrder.ConstraintInfoCollection
|
static class |
FindBestDomainOrder.OrderInfo
Calculated information about an order. |
static class |
FindBestDomainOrder.OrderSearchElem
|
Field Summary | |
---|---|
static double |
ACENT
|
static int |
AMEAN_INDEX
|
double |
attrClassWeight
|
static int |
CANDIDATE_SET_SIZE
|
static java.lang.String |
CLASSIFIER1
|
static java.lang.String |
CLASSIFIER2
|
static java.lang.String |
CLASSIFIER3
|
static java.text.SimpleDateFormat |
dateFormat
|
static double |
DCENT
|
static double |
DECAY_FACTOR
|
static boolean |
DISCRETIZE1
|
static boolean |
DISCRETIZE2
|
static boolean |
DISCRETIZE3
|
static int |
DMEAN_INDEX
|
static int |
DOMAIN_THRESHOLD
|
double |
domClassWeight
|
static boolean |
DUMP_CLASSIFIER_INFO
|
static int |
INITIAL_ATTRIB_SET
|
static int |
INITIAL_DOM_SET
|
static int |
INITIAL_VAR_SET
|
static int |
NO_CLASS
|
static int |
NO_CLASS_SCORE
|
static int |
NUM_CV_FOLDS
|
static java.io.PrintStream |
out
|
static java.io.PrintStream |
out_t
|
static boolean |
PER_RULE_CONSTRAINTS
Whether we should keep track of per-rule constraints, in addition to global constraints. |
boolean |
PROBABILITY
|
static int |
SAMPLE_SIZE
|
static int |
TRACE
|
static double |
UNCERTAINTY_THRESHOLD
|
double |
varClassWeight
|
static double |
VCENT
|
static int |
VMEAN_INDEX
|
static boolean |
WEIGHT_UNCERTAINTY_SAMPLE
|
static int |
WEIGHT_WINDOW_SIZE
|
Constructor Summary | |
---|---|
FindBestDomainOrder(Solver s)
Construct a new empty FindBestDomainOrder object. |
Method Summary | |
---|---|
void |
adjustWeights(TrialInstances vData,
TrialInstances aData,
TrialInstances dData)
|
java.lang.String |
bestOrders(BDDInferenceRule rule,
int k)
Generate the k best orders for the given inference rule and put the result in a string. |
static int |
compare(double d1,
double d2)
|
double |
computeWeight(int type,
TrialInstances instances)
|
double |
constFoldCV(weka.core.Instances data,
java.lang.String cClassName)
|
void |
dump()
Dump the collected order info for rules and relations to standard output. |
EpisodeCollection |
findEpisodeCollection(BDDInferenceRule rule,
int opNumber)
|
static java.lang.String |
format(double d)
Format a double in a nice way. |
static java.lang.String |
format(double d,
int numFracDigits)
|
static java.util.List |
generateAllOrders(java.util.List vars)
Generate all orders of a given list of variables. |
java.lang.Object |
generateCandidateSet(InferenceRule ir,
java.util.List allVars,
double[][] means,
TrialDataRepository.TrialDataGroup vDataGroup,
TrialDataRepository.TrialDataGroup aDataGroup,
TrialDataRepository.TrialDataGroup dDataGroup,
java.util.Collection triedOrders,
boolean returnBest)
|
double[][] |
getBucketMeans(Discretization vDis,
Discretization aDis,
Discretization dDis)
|
int |
getCombos(double[][] combos,
int start,
int numV,
int numA,
int numD,
double vBuckets,
double aBuckets,
double dBuckets,
double[][] means,
double maxScore)
|
EpisodeCollection.Episode |
getNewEpisode(BDDInferenceRule rule,
int opNumber,
long timeStamp,
boolean newCollection)
Starts a new trial collection and returns it. |
int |
getNumberOfTrials()
|
java.util.Set |
getVisitedRules()
|
boolean |
hasOrdersToTry(java.util.List allVars,
BDDInferenceRule ir)
|
static void |
main(java.lang.String[] args)
|
void |
neverTryAgain(InferenceRule ir,
Order o)
|
FindBestDomainOrder.OrderInfo |
predict(Order o,
OrderTranslator trans)
|
void |
printBestBDDOrders()
|
void |
printBestTrials()
|
void |
printTrialsDistro()
|
static void |
printTrialsDistro(java.util.Collection trials,
Solver solver)
|
java.util.Collection |
selectOrder(java.util.Collection orders,
TrialInstances vData,
TrialInstances aData,
TrialInstances dData,
InferenceRule ir,
boolean force)
|
static int |
signum(double d)
|
static int |
signum(long d)
|
org.jdom.Element |
toXMLElement()
Returns this FindBestDomainOrder as an XML element. |
org.jdom.Element |
trialsToXMLElement()
Returns the set of all trials performed so far as an XML element. |
TrialGuess |
tryNewGoodOrder(EpisodeCollection.Episode ep,
java.util.List allVars,
InferenceRule ir,
int opNum,
boolean returnBest)
|
TrialGuess |
tryNewGoodOrder(EpisodeCollection ec,
java.util.List allVars,
InferenceRule ir,
int opNum,
Order chosenOne,
boolean returnBest)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int TRACE
public static java.io.PrintStream out
public static java.io.PrintStream out_t
public static final java.text.SimpleDateFormat dateFormat
public static boolean PER_RULE_CONSTRAINTS
public static boolean DUMP_CLASSIFIER_INFO
public static final int WEIGHT_WINDOW_SIZE
public static final double DECAY_FACTOR
public static int NUM_CV_FOLDS
public static boolean DISCRETIZE1
public static boolean DISCRETIZE2
public static boolean DISCRETIZE3
public static java.lang.String CLASSIFIER1
public static java.lang.String CLASSIFIER2
public static java.lang.String CLASSIFIER3
public double varClassWeight
public double attrClassWeight
public double domClassWeight
public static int DOMAIN_THRESHOLD
public static int NO_CLASS
public static int NO_CLASS_SCORE
public boolean PROBABILITY
public static int INITIAL_VAR_SET
public static int INITIAL_ATTRIB_SET
public static int INITIAL_DOM_SET
public static final int VMEAN_INDEX
public static final int AMEAN_INDEX
public static final int DMEAN_INDEX
public static int CANDIDATE_SET_SIZE
public static int SAMPLE_SIZE
public static double UNCERTAINTY_THRESHOLD
public static boolean WEIGHT_UNCERTAINTY_SAMPLE
public static double VCENT
public static double ACENT
public static double DCENT
Constructor Detail |
---|
public FindBestDomainOrder(Solver s)
Method Detail |
---|
public void dump()
public int getNumberOfTrials()
public EpisodeCollection.Episode getNewEpisode(BDDInferenceRule rule, int opNumber, long timeStamp, boolean newCollection)
rule
- inference rule of trial collectionopNumber
- operation number of trial collectiontimeStamp
- time of trial collectionnewCollection
- whether to always return a new collection
public EpisodeCollection findEpisodeCollection(BDDInferenceRule rule, int opNumber)
public static java.util.List generateAllOrders(java.util.List vars)
vars
- list of variables
public static java.lang.String format(double d)
d
- double
public static java.lang.String format(double d, int numFracDigits)
public static int signum(long d)
public static int signum(double d)
public FindBestDomainOrder.OrderInfo predict(Order o, OrderTranslator trans)
public org.jdom.Element toXMLElement()
public org.jdom.Element trialsToXMLElement()
public boolean hasOrdersToTry(java.util.List allVars, BDDInferenceRule ir)
public static final int compare(double d1, double d2)
public double computeWeight(int type, TrialInstances instances)
public void adjustWeights(TrialInstances vData, TrialInstances aData, TrialInstances dData)
public double constFoldCV(weka.core.Instances data, java.lang.String cClassName)
data
- cClassName
-
public void neverTryAgain(InferenceRule ir, Order o)
public TrialGuess tryNewGoodOrder(EpisodeCollection.Episode ep, java.util.List allVars, InferenceRule ir, int opNum, boolean returnBest)
public TrialGuess tryNewGoodOrder(EpisodeCollection ec, java.util.List allVars, InferenceRule ir, int opNum, Order chosenOne, boolean returnBest)
public double[][] getBucketMeans(Discretization vDis, Discretization aDis, Discretization dDis)
public int getCombos(double[][] combos, int start, int numV, int numA, int numD, double vBuckets, double aBuckets, double dBuckets, double[][] means, double maxScore)
public java.lang.Object generateCandidateSet(InferenceRule ir, java.util.List allVars, double[][] means, TrialDataRepository.TrialDataGroup vDataGroup, TrialDataRepository.TrialDataGroup aDataGroup, TrialDataRepository.TrialDataGroup dDataGroup, java.util.Collection triedOrders, boolean returnBest)
public java.util.Collection selectOrder(java.util.Collection orders, TrialInstances vData, TrialInstances aData, TrialInstances dData, InferenceRule ir, boolean force)
public java.util.Set getVisitedRules()
public void printBestBDDOrders()
public java.lang.String bestOrders(BDDInferenceRule rule, int k)
rule
- inference rulek
- number of orders
public void printBestTrials()
public void printTrialsDistro()
public static void printTrialsDistro(java.util.Collection trials, Solver solver)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |