FeatureHashing (version 0.9.1.3)

CSCMatrix-class: CSCMatrix

Description

The structure of CSCMatrix is the same as the structure of dgCMatrix. However, the CSCMatrix has weaker constraints compared to dgCMatrix.

CSCMatrix onlysupports limited operators. The users can convert it to dgCMatrix for compatibility of existed algorithms.

Arguments

Methods

  • dim The dimension of the matrix object CSCMatrix.

  • dim<- The assignment of dimension of the matrix object CSCMatrix.

  • [ The subsetting operator of the matrix object CSCMatrix.

  • %*% The matrix-vector multiplication of the matrix object CSCMatrix. The returned object is a numeric vector.

Details

The CSCMatrix violates two constraints used in dgCMatrix:

  • The row indices should be sorted with columns.

  • The row indices should be unique with columns.

The result of matrix-vector multiplication should be the same.

See Also

dgCMatrix-class

Examples

Run this code
# NOT RUN {
# construct a CSCMatrix
m <- hashed.model.matrix(~ ., CO2, 8)
# convert it to dgCMatrix
m2 <- as(m, "dgCMatrix")
# }

Run the code above in your browser using DataCamp Workspace