Documentation of 'jsat.regression.StochasticRidgeRegression' Java class
StochasticRidgeRegression
jsat.regression

Class StochasticRidgeRegression

    • Constructor Detail

      • StochasticRidgeRegression

        public StochasticRidgeRegression(double lambda,
                                         int epochs,
                                         int batchSize,
                                         double learningRate)
        Creates a new stochastic Ridge Regression learner that does not use a decay rate
        Parameters:
        lambda - the regularization term
        epochs - the number of training epochs to perform
        batchSize - the batch size for updates
        learningRate - the learning rate
      • StochasticRidgeRegression

        public StochasticRidgeRegression(double lambda,
                                         int epochs,
                                         int batchSize,
                                         double learningRate,
                                         DecayRate learningDecay)
        Creates a new stochastic Ridge Regression learner
        Parameters:
        lambda - the regularization term
        epochs - the number of training epochs to perform
        batchSize - the batch size for updates
        learningRate - the learning rate
        learningDecay - the learning rate decay
    • Method Detail

      • setLambda

        public void setLambda(double lambda)
        Sets the regularization parameter used.
        Parameters:
        lambda - the positive regularization constant in (0, Inf)
      • getLambda

        public double getLambda()
        Returns the regularization constant in use
        Returns:
        the regularization constant in use
      • setLearningRate

        public void setLearningRate(double learningRate)
        Sets the learning rate used, and should be in the range (0, 1).
        Parameters:
        learningRate - the learning rate to use
      • getLearningRate

        public double getLearningRate()
        Returns the learning rate in use.
        Returns:
        the learning rate to use.
      • setLearningDecay

        public void setLearningDecay(DecayRate learningDecay)
        Sets the learning rate decay function to use. The decay is applied after each epoch through the data set. Using a decay rate can reduce the time to converge and quality of the solution for difficult problems.
        Parameters:
        learningDecay - the decay function to apply to the learning rate
      • getLearningDecay

        public DecayRate getLearningDecay()
        Returns the learning decay rate used
        Returns:
        the learning decay rate used
      • setBatchSize

        public void setBatchSize(int batchSize)
        Sets the batch size to learn from. If larger than the training set, the problem will reduce to classic gradient descent.
        Parameters:
        batchSize - the number of training points to use in each batch update
      • getBatchSize

        public int getBatchSize()
        Returns the batch size for updates
        Returns:
        the batch size for updates
      • setEpochs

        public void setEpochs(int epochs)
        Sets the number of iterations through the whole training set that will be performed.
        Parameters:
        epochs - the number of training iterations
      • getEpochs

        public int getEpochs()
        Returns the number of training iterations
        Returns:
        the number of training iterations
      • getBias

        public double getBias()
        Description copied from interface: SingleWeightVectorModel
        Returns the bias term used for the model, or 0 of the model does not support or was not trained with a bias term.
        Specified by:
        getBias in interface SingleWeightVectorModel
        Returns:
        the bias term for the model
      • getRawWeight

        public Vec getRawWeight(int index)
        Description copied from interface: SimpleWeightVectorModel
        Returns the raw weight vector associated with the given class index. If the given class is an implicit zero vector, a ConstantVector object may be returned.
        Do not alter the returned weight vector, as it will change the model's values.

        If a regression problem, only index = 0 should be used
        Specified by:
        getRawWeight in interface SimpleWeightVectorModel
        Parameters:
        index - the class index to get the weight vector for
        Returns:
        the weight vector used for the specified class
      • getBias

        public double getBias(int index)
        Description copied from interface: SimpleWeightVectorModel
        Returns the bias term used with the weight vector for the given class index. If the model does not support or was not trained with bias weights, 0 will be returned.

        If a regression problem, only index = 0 should be used
        Specified by:
        getBias in interface SimpleWeightVectorModel
        Parameters:
        index - the class index to get the weight vector for
        Returns:
        the bias term for the specified class
      • numWeightsVecs

        public int numWeightsVecs()
        Description copied from interface: SimpleWeightVectorModel
        Returns the number of weight vectors that can be returned. For binary classification problems the value may be 1 if only a single weight vector's sign is used to determine the class. For multi-class problems, the weight vector count includes the implicit zero vector (if one is being used).
        Specified by:
        numWeightsVecs in interface SimpleWeightVectorModel
        Returns:
        the number of weight vectors for which SimpleWeightVectorModel.getRawWeight(int) can be called.

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.