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.- 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:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionRegressionModel(String algorithm, StructType schema, Formula formula, DataFrameRegression regression, RegressionMetrics train, RegressionMetrics validation, RegressionMetrics test, Properties tags) Creates an instance of aRegressionModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealgorithmrecord component.final booleanIndicates whether some other object is "equal to" this one.formula()Returns the value of theformularecord component.final inthashCode()Returns a hash code value for this object.doubleModel inference.Returns the value of theregressionrecord component.schema()Returns the value of theschemarecord component.tags()Returns the value of thetagsrecord component.test()Returns the value of thetestrecord component.final StringtoString()Returns a string representation of this record class.train()Returns the value of thetrainrecord component.Returns the value of thevalidationrecord component.Methods inherited from interface Model
getTag, getTag, setProperty
-
Constructor Details
-
RegressionModel
public RegressionModel(String algorithm, StructType schema, Formula formula, DataFrameRegression regression, RegressionMetrics train, RegressionMetrics validation, RegressionMetrics test, Properties tags) Creates an instance of aRegressionModelrecord class.- Parameters:
algorithm- the value for thealgorithmrecord componentschema- the value for theschemarecord componentformula- the value for theformularecord componentregression- the value for theregressionrecord componenttrain- the value for thetrainrecord componentvalidation- the value for thevalidationrecord componenttest- the value for thetestrecord componenttags- the value for thetagsrecord component
-
-
Method Details
-
predict
Model inference.- Parameters:
x- the input tuple.- Returns:
- the prediction.
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
algorithm
-
schema
Returns the value of theschemarecord component. -
formula
-
regression
Returns the value of theregressionrecord component.- Returns:
- the value of the
regressionrecord component
-
train
-
validation
Returns the value of thevalidationrecord component.- Returns:
- the value of the
validationrecord component
-
test
-
tags
Returns the value of thetagsrecord component.
-