Package aima.core.learning.inductive

Examples of aima.core.learning.inductive.DecisionTree


    if (attributeNames.size() == 0) {
      return majorityValue(ds);
    }
    String chosenAttribute = chooseAttribute(ds, attributeNames);

    DecisionTree tree = new DecisionTree(chosenAttribute);
    ConstantDecisonTree m = majorityValue(ds);

    List<String> values = ds.getPossibleAttributeValues(chosenAttribute);
    for (String v : values) {
      DataSet filtered = ds.matchingDataSet(chosenAttribute, v);
      List<String> newAttribs = Util.removeFrom(attributeNames,
          chosenAttribute);
      DecisionTree subTree = decisionTreeLearning(filtered, newAttribs, m);
      tree.addNode(v, subTree);

    }

    return tree;
View Full Code Here


    if (attributeNames.size() == 0) {
      return majorityValue(ds);
    }
    String chosenAttribute = chooseAttribute(ds, attributeNames);

    DecisionTree tree = new DecisionTree(chosenAttribute);
    ConstantDecisonTree m = majorityValue(ds);

    List<String> values = ds.getPossibleAttributeValues(chosenAttribute);
    for (String v : values) {
      DataSet filtered = ds.matchingDataSet(chosenAttribute, v);
      List<String> newAttribs = Util.removeFrom(attributeNames,
          chosenAttribute);
      DecisionTree subTree = decisionTreeLearning(filtered, newAttribs, m);
      tree.addNode(v, subTree);

    }

    return tree;
View Full Code Here

      List<Learner> learners = new ArrayList<Learner>();

      System.out
          .println("\nStump Learners vote to decide in this algorithm");
      for (Object stump : stumps) {
        DecisionTree sl = (DecisionTree) stump;
        StumpLearner stumpLearner = new StumpLearner(sl, "No");
        learners.add(stumpLearner);
      }
      AdaBoostLearner learner = new AdaBoostLearner(learners, ds);
      learner.train(ds);
View Full Code Here

      throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    List<DecisionTree> stumps = DecisionTree.getStumpsFor(ds, YES, "No");
    List<Learner> learners = new ArrayList<Learner>();
    for (Object stump : stumps) {
      DecisionTree sl = (DecisionTree) stump;
      StumpLearner stumpLearner = new StumpLearner(sl, "No");
      learners.add(stumpLearner);
    }
    AdaBoostLearner learner = new AdaBoostLearner(learners, ds);
    learner.train(ds);
View Full Code Here

TOP

Related Classes of aima.core.learning.inductive.DecisionTree

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.