Package weka.classifiers.trees.m5
Class RidgeRegressionSplitInfo
- java.lang.Object
-
- weka.classifiers.trees.m5.RidgeRegressionSplitInfo
-
- All Implemented Interfaces:
Serializable,Cloneable,SplitEvaluate,RevisionHandler
public final class RidgeRegressionSplitInfo extends Object implements Cloneable, Serializable, SplitEvaluate, RevisionHandler
Finds split points using ridge regression.- Version:
- $Revision: 10169 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RidgeRegressionSplitInfo(int low, int high, int attr)Constructs an object which contains the split information
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattrSplit(int attr, Instances insts)Finds the best splitting point for an attribute in the instancesSplitEvaluatecopy()Makes a copy of this RidgeRegressionSplitInfo objectno.uib.cipr.matrix.MatrixgetAInverse(no.uib.cipr.matrix.Matrix G, double ridge)Computes the inverse of the A matrix for the G matrixno.uib.cipr.matrix.MatrixgetG(Instances insts)Computes the G matrix for the given set of instancesStringgetRevision()Returns the revision string.doublegetRSS(no.uib.cipr.matrix.Matrix G, no.uib.cipr.matrix.Matrix AI, no.uib.cipr.matrix.Vector S)Computes the S vector for the given set of instancesno.uib.cipr.matrix.VectorgetS(Instances insts)Computes the S vector for the given set of instancesvoidinitialize(int low, int high, int attr)Resets the object of split informationdoublemaxImpurity()Returns the impurity of this splitintposition()Returns the position of the split in the sorted values.intsplitAttr()Returns the attribute used in this splitdoublesplitValue()Returns the split valuevoidupdateAInverse(no.uib.cipr.matrix.Matrix AI, Instance inst, boolean add)Updates the A inverse matrix based on the given instancevoidupdateG(no.uib.cipr.matrix.Matrix G, Instance inst, boolean add)Updates the G matrix based on the given instancevoidupdateS(no.uib.cipr.matrix.Vector S, Instance inst, boolean add)Updates the S vector based on the given instance
-
-
-
Method Detail
-
copy
public final SplitEvaluate copy() throws Exception
Makes a copy of this RidgeRegressionSplitInfo object- Specified by:
copyin interfaceSplitEvaluate- Returns:
- a copy of the object
- Throws:
Exception
-
initialize
public final void initialize(int low, int high, int attr)Resets the object of split information- Parameters:
low- the index of the first instancehigh- the index of the last instanceattr- the attribute
-
getAInverse
public final no.uib.cipr.matrix.Matrix getAInverse(no.uib.cipr.matrix.Matrix G, double ridge) throws ExceptionComputes the inverse of the A matrix for the G matrix- Parameters:
G- the G matrixridge- the value of the ridge parameter- Throws:
Exception- if something goes wrong
-
updateAInverse
public final void updateAInverse(no.uib.cipr.matrix.Matrix AI, Instance inst, boolean add) throws ExceptionUpdates the A inverse matrix based on the given instance- Parameters:
AI- the matrix to updateinst- the instanceadd- whether to add and not subtract- Throws:
Exception- if something goes wrong
-
getG
public final no.uib.cipr.matrix.Matrix getG(Instances insts) throws Exception
Computes the G matrix for the given set of instances- Parameters:
insts- the instances- Throws:
Exception- if something goes wrong
-
updateG
public final void updateG(no.uib.cipr.matrix.Matrix G, Instance inst, boolean add) throws ExceptionUpdates the G matrix based on the given instance- Parameters:
G- the matrix to updateinst- the instanceadd- whether to add and not subtract- Throws:
Exception- if something goes wrong
-
getS
public final no.uib.cipr.matrix.Vector getS(Instances insts) throws Exception
Computes the S vector for the given set of instances- Parameters:
insts- the instances- Throws:
Exception- if something goes wrong
-
updateS
public final void updateS(no.uib.cipr.matrix.Vector S, Instance inst, boolean add) throws ExceptionUpdates the S vector based on the given instance- Parameters:
S- the vector to updateinst- the instanceadd- whether to add and not subtract- Throws:
Exception- if something goes wrong
-
getRSS
public final double getRSS(no.uib.cipr.matrix.Matrix G, no.uib.cipr.matrix.Matrix AI, no.uib.cipr.matrix.Vector S) throws ExceptionComputes the S vector for the given set of instances- Parameters:
G- the G matrixAI- the inverse of the A matrixS- the vector S- Throws:
Exception- if something goes wrong
-
attrSplit
public final void attrSplit(int attr, Instances insts) throws ExceptionFinds the best splitting point for an attribute in the instances- Specified by:
attrSplitin interfaceSplitEvaluate- Parameters:
attr- the splitting attributeinsts- the instances- Throws:
Exception- if something goes wrong
-
maxImpurity
public double maxImpurity()
Returns the impurity of this split- Specified by:
maxImpurityin interfaceSplitEvaluate- Returns:
- the impurity of this split
-
splitAttr
public int splitAttr()
Returns the attribute used in this split- Specified by:
splitAttrin interfaceSplitEvaluate- Returns:
- the attribute used in this split
-
position
public int position()
Returns the position of the split in the sorted values. -1 indicates that a split could not be found.- Specified by:
positionin interfaceSplitEvaluate- Returns:
- an
intvalue
-
splitValue
public double splitValue()
Returns the split value- Specified by:
splitValuein interfaceSplitEvaluate- Returns:
- the split value
-
getRevision
public String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-