Record Class RandomForest.Model
java.lang.Object
java.lang.Record
smile.classification.RandomForest.Model
- Record Components:
tree- The decision tree.metrics- The validation metrics on out-of-bag samples.weight- The weight of tree, which is used for aggregating tree votes.
- All Implemented Interfaces:
Serializable, Comparable<RandomForest.Model>
- Enclosing class:
RandomForest
public static record RandomForest.Model(DecisionTree tree, ClassificationMetrics metrics, double weight)
extends Record
implements Serializable, Comparable<RandomForest.Model>
The base model.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionModel(DecisionTree tree, ClassificationMetrics metrics) Constructor.Model(DecisionTree tree, ClassificationMetrics metrics, double weight) Creates an instance of aModelrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.metrics()Returns the value of themetricsrecord component.final StringtoString()Returns a string representation of this record class.tree()Returns the value of thetreerecord component.doubleweight()Returns the value of theweightrecord component.
-
Constructor Details
-
Model
Constructor. OOB accuracy will be used as weight.- Parameters:
tree- The decision tree.metrics- The validation metrics on out-of-bag samples.
-
Model
Creates an instance of aModelrecord class.
-
-
Method Details
-
compareTo
- Specified by:
compareToin interfaceComparable<RandomForest.Model>
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
tree
-
metrics
-
weight
-