Class LogisticRegression

    • Constructor Detail

      • LogisticRegression

        public LogisticRegression​(double lambda,
                                  Minimizer minimizer,
                                  int numIterations,
                                  boolean verbose)
        Creates a new logistic regression.
        Parameters:
        lambda - the regularization parameter.
        minimizer - the minimizer to use to train this model.
        numIterations - the number of iterations to make.
        verbose - output the progress to STDOUT if true.
      • LogisticRegression

        public LogisticRegression​(de.jungblut.math.DoubleVector theta)
        Creates a new logistic regression by already existing parameters.
    • Method Detail

      • train

        public void train​(de.jungblut.math.DoubleVector[] features,
                          de.jungblut.math.DoubleVector[] outcome)
        Description copied from interface: Classifier
        Trains this classifier with the given features and the outcome.
        Specified by:
        train in interface Classifier
        Overrides:
        train in class AbstractClassifier
        outcome - the outcome must have classes labeled as doubles. E.G. in the binary case you have a single element and decide between 0d and 1d. In higher dimensional cases you have each of these single elements mapped to a dimension.
      • predict

        public de.jungblut.math.DoubleVector predict​(de.jungblut.math.DoubleVector features)
        Description copied from interface: Predictor
        Classifies the given features.
        Returns:
        the vector that contains an indicator at the index of the class. Usually zero or 1, in some cases it is a probability or activation value.
      • getTheta

        public de.jungblut.math.DoubleVector getTheta()
        Returns:
        the learned weights.FSO