2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 2 of the License, or
5
* (at your option) any later version.
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software
14
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
* Copyright (C) 1999 University of Waikato, Hamilton, New Zealand
23
package weka.classifiers.trees.j48;
25
import weka.core.Instance;
26
import weka.core.Instances;
29
* Class implementing a "no-split"-split.
31
* @author Eibe Frank (eibe@cs.waikato.ac.nz)
32
* @version $Revision: 1.8 $
34
public final class NoSplit
35
extends ClassifierSplitModel{
37
/** for serialization */
38
private static final long serialVersionUID = -1292620749331337546L;
41
* Creates "no-split"-split for given distribution.
43
public NoSplit(Distribution distribution){
45
m_distribution = new Distribution(distribution);
50
* Creates a "no-split"-split for a given set of instances.
52
* @exception Exception if split can't be built successfully
54
public final void buildClassifier(Instances instances)
57
m_distribution = new Distribution(instances);
62
* Always returns 0 because only there is only one subset.
64
public final int whichSubset(Instance instance){
70
* Always returns null because there is only one subset.
72
public final double [] weights(Instance instance){
78
* Does nothing because no condition has to be satisfied.
80
public final String leftSide(Instances instances){
86
* Does nothing because no condition has to be satisfied.
88
public final String rightSide(int index, Instances instances){
94
* Returns a string containing java source code equivalent to the test
95
* made at this node. The instance being tested is called "i".
97
* @param index index of the nominal value tested
98
* @param data the data containing instance structure info
99
* @return a value of type 'String'
101
public final String sourceExpression(int index, Instances data) {
103
return "true"; // or should this be false??