Package weka.classifiers.trees.lmt

# Class ResidualSplit

java.lang.Object
weka.classifiers.trees.j48.ClassifierSplitModel
weka.classifiers.trees.lmt.ResidualSplit

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `RevisionHandler`

public class ResidualSplit extends ClassifierSplitModel
Helper class for logistic model trees (weka.classifiers.trees.lmt.LMT) to implement the splitting criterion based on residuals of the LogitBoost algorithm.

Version:
  $Revision: 8034 $
Author:
  Niels Landwehr
See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResidualSplit(int attIndex)`
  Creates a split object

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `buildClassifier(Instances data)`
  Method not in use
  `void`
  `buildClassifier(Instances data, double[][] dataZs, double[][] dataWs)`
  Builds the split.
  `boolean`
  `checkModel(int minNumInstances)`
  Checks if there are at least 2 subsets that contain >= minNumInstances.
  `double`
  `entropyGain()`
  Computes entropy gain for current split.
  `String`
  `getRevision()`
  Returns the revision string.
  `final String`
  `leftSide(Instances data)`
  Returns name of splitting attribute (left side of condition).
  `final String`
  `rightSide(int index, Instances data)`
  Prints the condition satisfied by instances in a subset.
  `final String`
  `sourceExpression(int index, Instances data)`
  Method not in use
  `final double[]`
  `weights(Instance instance)`
  Method not in use
  `final int`
  `whichSubset(Instance instance)`
  Returns index of subset instance is assigned to.

  ### Methods inherited from class weka.classifiers.trees.j48.ClassifierSplitModel

  `checkModel, classifyInstance, classProb, classProbLaplace, clone, codingCost, distribution, dumpLabel, dumpModel, numSubsets, resetDistribution, setDistribution, sourceClass, split`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ResidualSplit

    public ResidualSplit(int attIndex)
    Creates a split object
    Parameters:
      `attIndex` - the index of the attribute to split on

- ## Method Details

  - ### buildClassifier

    public void buildClassifier(Instances data, double[][] dataZs, double[][] dataWs) throws Exception
    Builds the split. Needs the Z/W values of LogitBoost for the set of instances.
    Throws:
      `Exception`

  - ### entropyGain

    public double entropyGain() throws Exception
    Computes entropy gain for current split.
    Throws:
      `Exception`

  - ### checkModel

    public boolean checkModel(int minNumInstances)
    Checks if there are at least 2 subsets that contain >= minNumInstances.

  - ### leftSide

    public final String leftSide(Instances data)
    Returns name of splitting attribute (left side of condition).
    Specified by:
      `leftSide` in class `ClassifierSplitModel`
    Parameters:
      `data` - the data.

  - ### rightSide

    public final String rightSide(int index, Instances data)
    Prints the condition satisfied by instances in a subset.
    Specified by:
      `rightSide` in class `ClassifierSplitModel`

  - ### whichSubset

    public final int whichSubset(Instance instance) throws Exception
    Description copied from class: `ClassifierSplitModel`
    Returns index of subset instance is assigned to. Returns -1 if instance is assigned to more than one subset.
    Specified by:
      `whichSubset` in class `ClassifierSplitModel`
    Throws:
      `Exception` - if something goes wrong

  - ### buildClassifier

    public void buildClassifier(Instances data)
    Method not in use
    Specified by:
      `buildClassifier` in class `ClassifierSplitModel`

  - ### weights

    public final double[] weights(Instance instance)
    Method not in use
    Specified by:
      `weights` in class `ClassifierSplitModel`

  - ### sourceExpression

    public final String sourceExpression(int index, Instances data)
    Method not in use
    Specified by:
      `sourceExpression` in class `ClassifierSplitModel`

  - ### getRevision

    public String getRevision()
    Returns the revision string.
    Returns:
      the revision