Class PreConstructedLinearModel

    • Constructor Detail

      • PreConstructedLinearModel

        public PreConstructedLinearModel​(double[] coeffs,
                                         double intercept)
        Constructor
        Parameters:
        coeffs - an array of coefficients
        intercept - the intercept
    • Method Detail

      • buildClassifier

        public void buildClassifier​(Instances instances)
                             throws Exception
        Builds the classifier. In this case all that is done is that a copy of the training instances header is saved.
        Specified by:
        buildClassifier in interface Classifier
        Parameters:
        instances - an Instances value
        Throws:
        Exception - if an error occurs
      • numParameters

        public int numParameters()
        Return the number of parameters (coefficients) in the linear model
        Returns:
        the number of parameters
      • coefficients

        public double[] coefficients()
        Return the array of coefficients
        Returns:
        the coefficients
      • intercept

        public double intercept()
        Return the intercept
        Returns:
        the intercept
      • toString

        public String toString()
        Returns a textual description of this linear model
        Overrides:
        toString in class Object
        Returns:
        String containing a description of this linear model