001    // Copyright 2012, 2013 Brad Block, Pawjaw, LLC. (an Ohio Limited Liability Company)
002    // 
003    // This file is part of JBTCRF.
004    // 
005    // JBTCRF is free software: you can redistribute it and/or modify
006    // it under the terms of the GNU General Public License as published by
007    // the Free Software Foundation, either version 3 of the License, or
008    // (at your option) any later version.
009    // 
010    // JBTCRF is distributed in the hope that it will be useful,
011    // but WITHOUT ANY WARRANTY; without even the implied warranty of
012    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013    // GNU General Public License for more details.
014    // 
015    // You should have received a copy of the GNU General Public License
016    // along with JBTCRF.  If not, see <http://www.gnu.org/licenses/>.
017    
018    package com.pawjaw.classification.crf.lmcbt.trees;
019    
020    public class Split implements Comparable<Split> {
021        public int split_feature = -1;
022        public double gain = 0;
023        public double true_child_output = 0;
024        public double false_child_output = 0;
025        public Node parent = null;
026    
027        public Split(Node parent) {
028            this.parent = parent;
029        }
030    
031        public boolean isValid() {
032            return split_feature >= 0;
033        }
034    
035        public int compareTo(Split o) {
036            return gain > o.gain ? -1 : 1;
037        }
038    }