readSparseData: Read a given file in sparse (LIBSVM) format to dense R matrix...

Description Usage Arguments Value Note Examples

Description

Read a given file in sparse (LIBSVM) format to dense R matrix and R vector.

Usage

1
2
readSparseData(filename, skipBytes = 0L, verbose = FALSE,
  zeroBased = FALSE)

Arguments

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 ...?

Value

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.

Note

This routine is nearly a 1:1 adoptation from the LIBSVM original code.

Examples

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)

aydindemircioglu/SVMBridge documentation built on May 11, 2019, 4:13 p.m.