// TODO - Implement!!! public Hypothesis currentBestLearning(List <FOLExample> examples) { // TODO-use the default from pg 769 for now. String c1 = "patrons(v,Some)"; String c2 = "patrons(v,Full) AND (hungry(v) AND type(v,French))"; String c3 = "patrons(v,Full) AND (hungry(v) AND (type(v,Thai) AND fri_sat(v)))"; String c4 = "patrons(v,Full) AND (hungry(v) AND type(v,Burger))"; String sh = "FORALL v (will_wait(v) <=> (" + c1 + " OR (" + c2 + " OR (" + c3 + " OR (" + c4 + ")))))"; Hypothesis h = new Hypothesis(kbForLearning.tell(sh)); return(h); }
// TODO - Implement!!! public Hypothesis currentBestLearning(List<FOLExample> examples) { // TODO-use the default from pg 769 for now. String c1 = "patrons(v,Some)"; String c2 = "patrons(v,Full) AND (hungry(v) AND type(v,French))"; String c3 = "patrons(v,Full) AND (hungry(v) AND (type(v,Thai) AND fri_sat(v)))"; String c4 = "patrons(v,Full) AND (hungry(v) AND type(v,Burger))"; String sh = "FORALL v (will_wait(v) <=> (" + c1 + " OR (" + c2 + " OR (" + c3 + " OR (" + c4 + ")))))"; Hypothesis h = new Hypothesis(kbForLearning.tell(sh)); return h; }
// // START-Learner public void train(DataSet ds) { folDSDomain = new FOLDataSetDomain(ds.specification, trueGoalValue); List<FOLExample> folExamples = new List<FOLExample>(); int egNo = 1; foreach (Example e in ds.examples) { folExamples.Add(new FOLExample(folDSDomain, e, egNo)); egNo++; } // Setup a KB to be used for learning kb = new FOLKnowledgeBase(folDSDomain, new FOLOTTERLikeTheoremProver( 1000, false)); CurrentBestLearning cbl = new CurrentBestLearning(folDSDomain, kb); currentBestHypothesis = cbl.currentBestLearning(folExamples); }