Class RidgeRegressionSplitInfo

    • 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
      void attrSplit​(int attr, Instances insts)
      Finds the best splitting point for an attribute in the instances
      SplitEvaluate copy()
      Makes a copy of this RidgeRegressionSplitInfo object
      no.uib.cipr.matrix.Matrix getAInverse​(no.uib.cipr.matrix.Matrix G, double ridge)
      Computes the inverse of the A matrix for the G matrix
      no.uib.cipr.matrix.Matrix getG​(Instances insts)
      Computes the G matrix for the given set of instances
      String getRevision()
      Returns the revision string.
      double getRSS​(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 instances
      no.uib.cipr.matrix.Vector getS​(Instances insts)
      Computes the S vector for the given set of instances
      void initialize​(int low, int high, int attr)
      Resets the object of split information
      double maxImpurity()
      Returns the impurity of this split
      int position()
      Returns the position of the split in the sorted values.
      int splitAttr()
      Returns the attribute used in this split
      double splitValue()
      Returns the split value
      void updateAInverse​(no.uib.cipr.matrix.Matrix AI, Instance inst, boolean add)
      Updates the A inverse matrix based on the given instance
      void updateG​(no.uib.cipr.matrix.Matrix G, Instance inst, boolean add)
      Updates the G matrix based on the given instance
      void updateS​(no.uib.cipr.matrix.Vector S, Instance inst, boolean add)
      Updates the S vector based on the given instance
    • Constructor Detail

      • RidgeRegressionSplitInfo

        public RidgeRegressionSplitInfo​(int low,
                                        int high,
                                        int attr)
        Constructs an object which contains the split information
        Parameters:
        low - the index of the first instance
        high - the index of the last instance
        attr - an attribute
    • Method Detail

      • initialize

        public final void initialize​(int low,
                                     int high,
                                     int attr)
        Resets the object of split information
        Parameters:
        low - the index of the first instance
        high - the index of the last instance
        attr - the attribute
      • getAInverse

        public final no.uib.cipr.matrix.Matrix getAInverse​(no.uib.cipr.matrix.Matrix G,
                                                           double ridge)
                                                    throws Exception
        Computes the inverse of the A matrix for the G matrix
        Parameters:
        G - the G matrix
        ridge - 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 Exception
        Updates the A inverse matrix based on the given instance
        Parameters:
        AI - the matrix to update
        inst - the instance
        add - 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 Exception
        Updates the G matrix based on the given instance
        Parameters:
        G - the matrix to update
        inst - the instance
        add - 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 Exception
        Updates the S vector based on the given instance
        Parameters:
        S - the vector to update
        inst - the instance
        add - 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 Exception
        Computes the S vector for the given set of instances
        Parameters:
        G - the G matrix
        AI - the inverse of the A matrix
        S - the vector S
        Throws:
        Exception - if something goes wrong
      • attrSplit

        public final void attrSplit​(int attr,
                                    Instances insts)
                             throws Exception
        Finds the best splitting point for an attribute in the instances
        Specified by:
        attrSplit in interface SplitEvaluate
        Parameters:
        attr - the splitting attribute
        insts - the instances
        Throws:
        Exception - if something goes wrong
      • maxImpurity

        public double maxImpurity()
        Returns the impurity of this split
        Specified by:
        maxImpurity in interface SplitEvaluate
        Returns:
        the impurity of this split
      • splitAttr

        public int splitAttr()
        Returns the attribute used in this split
        Specified by:
        splitAttr in interface SplitEvaluate
        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:
        position in interface SplitEvaluate
        Returns:
        an int value
      • splitValue

        public double splitValue()
        Returns the split value
        Specified by:
        splitValue in interface SplitEvaluate
        Returns:
        the split value