Package smile.feature.selection
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 Summary
ConstructorsConstructorDescriptionFRegression
(String feature, double statistic, double pvalue, boolean categorical) Creates an instance of aFRegression
record class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of thecategorical
record component.int
compareTo
(FRegression other) final boolean
Indicates whether some other object is "equal to" this one.feature()
Returns the value of thefeature
record component.static FRegression[]
Calculates the signal noise ratio of numeric variables.final int
hashCode()
Returns a hash code value for this object.double
pvalue()
Returns the value of thepvalue
record component.double
Returns the value of thestatistic
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
FRegression
Creates an instance of aFRegression
record class.- Parameters:
feature
- the value for thefeature
record componentstatistic
- the value for thestatistic
record componentpvalue
- the value for thepvalue
record componentcategorical
- the value for thecategorical
record component
-
-
Method Details
-
compareTo
- Specified by:
compareTo
in interfaceComparable<FRegression>
-
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. -
fit
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
feature
Returns the value of thefeature
record component.- Returns:
- the value of the
feature
record component
-
statistic
public double statistic()Returns the value of thestatistic
record component.- Returns:
- the value of the
statistic
record component
-
pvalue
public double pvalue()Returns the value of thepvalue
record component.- Returns:
- the value of the
pvalue
record component
-
categorical
public boolean categorical()Returns the value of thecategorical
record component.- Returns:
- the value of the
categorical
record component
-