Record Class RegressionModel

java.lang.Object
java.lang.Record
smile.model.RegressionModel
Record Components:
algorithm - the algorithm name.
schema - the schema of input data (without response variable).
formula - the model formula.
regression - the regression model.
train - the training metrics.
validation - the cross-validation metrics.
test - the test metrics.
tags - the model metadata tags.
All Implemented Interfaces:
Serializable, Model

public record RegressionModel(String algorithm, StructType schema, Formula formula, DataFrameRegression regression, RegressionMetrics train, RegressionMetrics validation, RegressionMetrics test, Properties tags) extends Record implements Model, Serializable
The regression model.
See Also:
  • Constructor Details

  • Method Details

    • predict

      public double predict(Tuple x)
      Model inference.
      Parameters:
      x - the input tuple.
      Returns:
      the prediction.
    • toString

      public final 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
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • algorithm

      public String algorithm()
      Returns the value of the algorithm record component.
      Specified by:
      algorithm in interface Model
      Returns:
      the value of the algorithm record component
    • schema

      public StructType schema()
      Returns the value of the schema record component.
      Specified by:
      schema in interface Model
      Returns:
      the value of the schema record component
    • formula

      public Formula formula()
      Returns the value of the formula record component.
      Specified by:
      formula in interface Model
      Returns:
      the value of the formula record component
    • regression

      public DataFrameRegression regression()
      Returns the value of the regression record component.
      Returns:
      the value of the regression record component
    • train

      public RegressionMetrics train()
      Returns the value of the train record component.
      Returns:
      the value of the train record component
    • validation

      public RegressionMetrics validation()
      Returns the value of the validation record component.
      Returns:
      the value of the validation record component
    • test

      public RegressionMetrics test()
      Returns the value of the test record component.
      Returns:
      the value of the test record component
    • tags

      public Properties tags()
      Returns the value of the tags record component.
      Specified by:
      tags in interface Model
      Returns:
      the value of the tags record component