Documentation of 'jsat.classifiers.linear.AROW' Java class
AROW
jsat.classifiers.linear

Class AROW

    • Constructor Detail

      • AROW

        public AROW()
        Creates a new AROW learner
      • AROW

        public AROW(double r,
                    boolean diagonalOnly)
        Creates a new AROW learner
        Parameters:
        r - the regularization parameter
        diagonalOnly - whether or not to use only the diagonal of the covariance
        See Also:
        setR(double), setDiagonalOnly(boolean)
    • Method Detail

      • setDiagonalOnly

        public void setDiagonalOnly(boolean diagonalOnly)
        Using the full covariance matrix requires O(d2) work on mistakes, where d is the dimension of the data. Runtime can be reduced by using only the diagonal of the matrix to perform updates in O(s) time, where s ≤ d is the number of non-zero values in the input
        Parameters:
        diagonalOnly - true to use only the diagonal of the covariance
      • isDiagonalOnly

        public boolean isDiagonalOnly()
        Returns true if the covariance matrix is restricted to its diagonal entries
        Returns:
        true if the covariance matrix is restricted to its diagonal entries
      • setR

        public void setR(double r)
        Sets the r parameter of AROW, which controls the regularization. Larger values reduce the change in the model on each update.
        Parameters:
        r - the regularization parameter in (0, Inf)
      • getR

        public double getR()
        Returns the regularization parameter
        Returns:
        the regularization parameter
      • getWeightVec

        public Vec getWeightVec()
        Returns the weight vector used to compute results via a dot product.
        Do not modify this value, or you will alter the results returned.
        Returns:
        the learned weight vector for prediction
      • update

        public void update(DataPoint dataPoint,
                           int targetClass)
        Description copied from interface: UpdateableClassifier
        Updates the classifier by giving it a new data point to learn from.
        Specified by:
        update in interface UpdateableClassifier
        Parameters:
        dataPoint - the data point to learn
        targetClass - the target class of the data point
      • classify

        public CategoricalResults classify(DataPoint data)
        Description copied from interface: Classifier
        Performs classification on the given data point.
        Specified by:
        classify in interface Classifier
        Parameters:
        data - the data point to classify
        Returns:
        the results of the classification.
      • getScore

        public double getScore(DataPoint dp)
        Description copied from interface: BinaryScoreClassifier
        Returns the numeric score for predicting a class of a given data point, where the sign of the value indicates which class the data point is predicted to belong to.
        Specified by:
        getScore in interface BinaryScoreClassifier
        Parameters:
        dp - the data point to predict the class label of
        Returns:
        the score for the given data point
      • supportsWeightedData

        public boolean supportsWeightedData()
        Description copied from interface: Classifier
        Indicates whether the model knows how to train using weighted data points. If it does, the model will train assuming the weights. The values returned by this method may change depending on the parameters set for the model.
        Specified by:
        supportsWeightedData in interface Classifier
        Returns:
        true if the model supports weighted data, false otherwise
      • 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.
      • guessR

        public static Distribution guessR(DataSet d)
        Guess the distribution to use for the regularization term r .
        Parameters:
        d - the data set to get the guess for
        Returns:
        the guess for the r parameter

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.