Record Class VectorQuantizerModel
java.lang.Object
java.lang.Record
smile.model.VectorQuantizerModel
- Record Components:
algorithm- the algorithm name.schema- the schema of input data (without response variable).formula- the model formula.quantizer- the vector quantizer model.transform- the optional feature transformation applied before quantization.- the model metadata tags.
- All Implemented Interfaces:
Serializable, Model
public record VectorQuantizerModel(String algorithm, StructType schema, Formula formula, VectorQuantizer quantizer, Transform transform, Properties tags)
extends Record
implements Model, Serializable
The vector quantization model.
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionVectorQuantizerModel(String algorithm, StructType schema, Formula formula, VectorQuantizer quantizer, Transform transform, Properties tags) Creates an instance of aVectorQuantizerModelrecord 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.Performs batch inference over a data frame.infer(DataFrame data, boolean probability, boolean explain, KernelSHAP.Options options) Performs batch inference over a data frame with customKernelSHAP.Options.Performs inference on a single tuple.infer(Tuple x, boolean probability, boolean explain, KernelSHAP.Options options) Performs inference on a single tuple with customKernelSHAP.Options.booleanisOnline()Returns true if this model supports online learning updates.double[][]Quantizes a data frame of observations.double[]Quantizes an input tuple to its nearest prototype/code vector.Returns the value of thequantizerrecord component.schema()Returns the value of theschemarecord component.tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformrecord component.voidOnline updates the model sequentially with a data frame of observations.voidOnline updates the model with a single observation.
-
Constructor Details
-
VectorQuantizerModel
public VectorQuantizerModel(String algorithm, StructType schema, Formula formula, VectorQuantizer quantizer, Transform transform, Properties tags) Creates an instance of aVectorQuantizerModelrecord class.- Parameters:
algorithm- the value for thealgorithmrecord componentschema- the value for theschemarecord componentformula- the value for theformularecord componentquantizer- the value for thequantizerrecord componenttransform- the value for thetransformrecord componenttags- the value for thetagsrecord component
-
-
Method Details
-
quantize
Quantizes an input tuple to its nearest prototype/code vector.- Parameters:
x- the input tuple.- Returns:
- the quantized code vector.
-
quantize
Quantizes a data frame of observations.- Parameters:
data- the input data frame.- Returns:
- the quantized code vectors.
-
isOnline
-
update
-
update
-
infer
Description copied from interface:ModelPerforms inference on a single tuple. -
infer
Description copied from interface:ModelPerforms inference on a single tuple with customKernelSHAP.Options. -
infer
Description copied from interface:ModelPerforms batch inference over a data frame. -
infer
public Prediction[] infer(DataFrame data, boolean probability, boolean explain, KernelSHAP.Options options) Description copied from interface:ModelPerforms batch inference over a data frame with customKernelSHAP.Options. -
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
-
quantizer
-
transform
-
tags
Returns the value of thetagsrecord component.
-