Class LibSVMClassificationModel

java.lang.Object
org.tribuo.Model<Label>
org.tribuo.common.libsvm.LibSVMModel<Label>
org.tribuo.classification.libsvm.LibSVMClassificationModel
All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.provenance.Provenancable<org.tribuo.provenance.ModelProvenance>, Serializable, org.tribuo.ONNXExportable, org.tribuo.protos.ProtoSerializable<org.tribuo.protos.core.ModelProto>

public class LibSVMClassificationModel extends LibSVMModel<Label> implements org.tribuo.ONNXExportable
A classification model that uses an underlying LibSVM model to make the predictions.

See:

 Chang CC, Lin CJ.
 "LIBSVM: a library for Support Vector Machines"
 ACM transactions on intelligent systems and technology (TIST), 2011.
 
for the nu-svc algorithm:
 Schölkopf B, Smola A, Williamson R, Bartlett P L.
 "New support vector algorithms"
 Neural Computation, 2000, 1207-1245.
 
and for the original algorithm:
 Cortes C, Vapnik V.
 "Support-Vector Networks"
 Machine Learning, 1995.
 
See Also:
  • Field Details

  • Method Details

    • deserializeFromProto

      public static LibSVMClassificationModel deserializeFromProto(int version, String className, com.google.protobuf.Any message) throws com.google.protobuf.InvalidProtocolBufferException
      Deserialization factory.
      Parameters:
      version - The serialized object version.
      className - The class name.
      message - The serialized data.
      Returns:
      The deserialized object.
      Throws:
      com.google.protobuf.InvalidProtocolBufferException - If the protobuf could not be parsed from the message.
    • getNumberOfSupportVectors

      Returns the number of support vectors.
      Returns:
      The number of support vectors.
    • predict

      public org.tribuo.Prediction<Label> predict(org.tribuo.Example<Label> example)
      Specified by:
      predict in class org.tribuo.Model<Label>
    • copy

      protected LibSVMClassificationModel copy(String newName, org.tribuo.provenance.ModelProvenance newProvenance)
      Specified by:
      copy in class org.tribuo.Model<Label>
    • exportONNXModel

      public ai.onnx.proto.OnnxMl.ModelProto exportONNXModel(String domain, long modelVersion)
      Specified by:
      exportONNXModel in interface org.tribuo.ONNXExportable
    • writeONNXGraph

      public org.tribuo.util.onnx.ONNXNode writeONNXGraph(org.tribuo.util.onnx.ONNXRef<?> input)
      Specified by:
      writeONNXGraph in interface org.tribuo.ONNXExportable
    • serialize

      public org.tribuo.protos.core.ModelProto serialize()
      Specified by:
      serialize in interface org.tribuo.protos.ProtoSerializable<org.tribuo.protos.core.ModelProto>
      Overrides:
      serialize in class org.tribuo.Model<Label>