LibSVMSerializer: LibSVMSerializer Class

LibSVMSerializerR Documentation

LibSVMSerializer Class

Description

Serialize data of various formats to a LibSVM-formatted string. The data must already be in LIBSVM file format: <label> <index1>:<value1> <index2>:<value2> ... It is suitable for sparse datasets since it does not store zero-valued features.

Super classes

sagemaker.mlcore::BaseSerializer -> sagemaker.mlcore::SimpleBaseSerializer -> LibSVMSerializer

Methods

Public methods

Inherited methods

Method new()

Initialize a “LibSVMSerializer“ instance.

Usage
LibSVMSerializer$new(content_type = "text/libsvm")
Arguments
content_type

(str): The MIME type to signal to the inference endpoint when sending request data (default: "text/libsvm").


Method serialize()

Serialize data of various formats to a LibSVM-formatted string.

Usage
LibSVMSerializer$serialize(data)
Arguments
data

(object): Data to be serialized. Can be a string, a file-like object, sparse matrix, or a list (format: list(<sparse matrix>, <label>)).

Returns

str: The data serialized as a LibSVM-formatted string.


Method clone()

The objects of this class are cloneable with this method.

Usage
LibSVMSerializer$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other serializer: BaseDeserializer, BaseSerializer, BytesDeserializer, CSVDeserializer, CSVSerializer, DataTableDeserializer, IdentitySerializer, JSONDeserializer, JSONLinesDeserializer, JSONLinesSerializer, JSONSerializer, NumpyDeserializer, NumpySerializer, SimpleBaseDeserializer, SimpleBaseSerializer, SparseMatrixSerializer, StringDeserializer, TibbleDeserializer


DyfanJones/sagemaker-r-mlcore documentation built on May 3, 2022, 10:08 a.m.