Description Usage Arguments Value Note Examples
Read a given file in sparse (LIBSVM) format to dense R matrix and R vector.
1 2 | readSparseData(filename, skipBytes = 0L, verbose = FALSE,
zeroBased = FALSE)
|
filename |
The filename of the data in sparse file format. The Tilde Character isn't supported for f filename! |
skipBytes |
How many bytes of the head of the files should be skipped? |
verbose |
Show verbose output? |
zeroBased |
Do the indices in the file start with 0, e.g. -1 0:2 1:4 ...? |
The data is read into an R matrix and an R vector, containing the data and the labels. note, that these are not in sparse format, but are dense.
This routine is nearly a 1:1 adoptation from the LIBSVM original code.
1 2 3 4 5 6 | ## Not run:
S = readSparseData("../../../SVMBridge/tests/data/australian.train")
print (paste("Data has", nrow(S$X), "points."))
print (paste("Labels are", unique(S$Y), "."))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.