DecisionTree _tree; // Current decision tree. #endregion Fields #region Constructors /** * Prepares to run the decision tree algorithm by * creating an empty decision tree. * * <p> * The default splitting function is set to "Random". * * @param dataset A Dataset object that is already initialized. * * @throws NullPointerException If the supplied Dataset or * ComponentManager is null. */ public DecisionTreeAlgorithm(Dataset dataset) { //super(); if (dataset == null) throw new Exception("Dataset is null."); //_manager = manager; DatasetUse = dataset; SplitFun = SPLIT_RANDOM; PruneAlg = PRUNING_NONE; RandomGenerator = new Random(2389); Tree = new DecisionTree(); PessPruneZScore = DEFAULT_Z_SCORE; // Viết thêm ListRules = new DecisionTreeRule(); }
/** * Resets the algorithm, destroying the current * tree. The dataset used to build the tree * remains unchanged. */ public void reset() { Tree = new DecisionTree(); }