Package aima.core.learning.knowledge

Examples of aima.core.learning.knowledge.FOLExample


  public void train(DataSet ds) {
    folDSDomain = new FOLDataSetDomain(ds.specification, trueGoalValue);
    List<FOLExample> folExamples = new ArrayList<FOLExample>();
    int egNo = 1;
    for (Example e : ds.examples) {
      folExamples.add(new FOLExample(folDSDomain, e, egNo));
      egNo++;
    }

    // Setup a KB to be used for learning
    kb = new FOLKnowledgeBase(folDSDomain, new FOLOTTERLikeTheoremProver(
View Full Code Here


  }

  public String predict(Example e) {
    String prediction = "~" + e.targetValue();
    if (null != currentBestHypothesis) {
      FOLExample etp = new FOLExample(folDSDomain, e, 0);
      kb.clear();
      kb.tell(etp.getDescription());
      kb.tell(currentBestHypothesis.getHypothesis());
      InferenceResult ir = kb.ask(etp.getClassification());
      if (ir.isTrue()) {
        if (trueGoalValue.equals(e.targetValue())) {
          prediction = e.targetValue();
        }
      } else if (ir.isPossiblyFalse() || ir.isUnknownDueToTimeout()) {
View Full Code Here

TOP

Related Classes of aima.core.learning.knowledge.FOLExample

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.