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

Class LinearTools



  • public class LinearTools
    extends java.lang.Object
    This class provides static helper methods that may be useful for various linear models.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static double c2Lambda(double C, double N)
      Many linear classifiers can be phrased in two equivalent forms, that only change the notation for the regularized.
      static double lambda2C(double lambda, double N)
      Many linear classifiers can be phrased in two equivalent forms, that only change the notation for the regularized.
      static double maxLambdaLogisticL1(ClassificationDataSet cds)
      If the linear model performs logistic regression regularized by λ ||w||1, this method computes the smallest value of lambda that produces a weight vector of all zeros.

      Note, that the value returned depends on the data set size.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • maxLambdaLogisticL1

        public static double maxLambdaLogisticL1(ClassificationDataSet cds)
        If the linear model performs logistic regression regularized by λ ||w||1, this method computes the smallest value of lambda that produces a weight vector of all zeros.

        Note, that the value returned depends on the data set size. If being used to initialize the value of λ for cross validation with k-folds, the value (k-1)/k * λ will be closer to the correct value of λ for each CV set.
        Parameters:
        cds - the data set that the model would be trained from
        Returns:
        the smallest value of λ that should produce all zeros.
      • lambda2C

        public static double lambda2C(double lambda,
                                      double N)
        Many linear classifiers can be phrased in two equivalent forms, that only change the notation for the regularized. These forms are:
        C i ℓ(w,xi) + Ω(w)
        and
        1/N i ℓ(w,xi) + λ Ω(w)
        This method converts the regularization parameter λ to the form used as C
        Parameters:
        lambda - the regularization parameter λ
        N - the number of data points in the training set
        Returns:
      • c2Lambda

        public static double c2Lambda(double C,
                                      double N)
        Many linear classifiers can be phrased in two equivalent forms, that only change the notation for the regularized. These forms are:
        C i ℓ(w,xi) + Ω(w)
        and
        1/N i ℓ(w,xi) + λ Ω(w)
        This method converts the regularization parameter C to the form used as λ
        Parameters:
        C - the regularization parameter C
        N - the number of data points in the training set
        Returns:

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.