SparseMatrixSerializer: SparseMatrixSerializer Class

SparseMatrixSerializerR Documentation

SparseMatrixSerializer Class

Description

Serialize a sparse matrix to a buffer using the .npz format.

Super classes

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

Public fields

scipy

Python scipy package

Methods

Public methods

Inherited methods

Method new()

Initialize a “SparseMatrixSerializer“ instance.

Usage
SparseMatrixSerializer$new(content_type = "application/x-npz")
Arguments
content_type

(str): The MIME type to signal to the inference endpoint when sending request data (default: "application/x-npz").


Method serialize()

Serialize a sparse matrix to a buffer using the .npz format. Sparse matrices can be in the “csc“, “csr“, “bsr“, “dia“ or “coo“ formats.

Usage
SparseMatrixSerializer$serialize(data)
Arguments
data

(sparseMatrix): The sparse matrix to serialize.

Returns

raw: A buffer containing the serialized sparse matrix.


Method clone()

The objects of this class are cloneable with this method.

Usage
SparseMatrixSerializer$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, LibSVMSerializer, NumpyDeserializer, NumpySerializer, SimpleBaseDeserializer, SimpleBaseSerializer, StringDeserializer, TibbleDeserializer


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