Record Class FRegression

java.lang.Object
java.lang.Record
smile.feature.selection.FRegression
Record Components:
feature - The feature name.
statistic - F-statistic.
pvalue - The p-value associated with the F-statistic.
categorical - True if the feature is categorical.
All Implemented Interfaces:
Comparable<FRegression>

public record FRegression(String feature, double statistic, double pvalue, boolean categorical) extends Record implements Comparable<FRegression>
Univariate F-statistic and p-values, which can be used as a feature selection criterion for linear regression problems.
  • Constructor Details

    • FRegression

      public FRegression(String feature, double statistic, double pvalue, boolean categorical)
      Creates an instance of a FRegression record class.
      Parameters:
      feature - the value for the feature record component
      statistic - the value for the statistic record component
      pvalue - the value for the pvalue record component
      categorical - the value for the categorical record component
  • Method Details

    • compareTo

      public int compareTo(FRegression other)
      Specified by:
      compareTo in interface Comparable<FRegression>
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • fit

      public static FRegression[] fit(DataFrame data, String response)
      Calculates the signal noise ratio of numeric variables.
      Parameters:
      data - the data frame of the explanatory and response variables.
      response - the column name of response variable.
      Returns:
      the signal noise ratio.
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • feature

      public String feature()
      Returns the value of the feature record component.
      Returns:
      the value of the feature record component
    • statistic

      public double statistic()
      Returns the value of the statistic record component.
      Returns:
      the value of the statistic record component
    • pvalue

      public double pvalue()
      Returns the value of the pvalue record component.
      Returns:
      the value of the pvalue record component
    • categorical

      public boolean categorical()
      Returns the value of the categorical record component.
      Returns:
      the value of the categorical record component