| dataSet-class {rrecsys} | R Documentation |
Dataset class.
Description
Container for a dense dataset that distinguishes between binary and non-binary feedback datasets. Extends _ds.
Slots
data:the dataset, class
"matrix".binary:class
"logical", determines if the item dataset contains binary (i.e. 1/0) or non-binary ratings.minimum:class
"numeric", defines the minimal value present in the dataset.maximum:class
"numeric", defines the maximal value present in the dataset.intScale:object of class
"logical", if TRUE the range of ratings in the dataset contains as well half star values.
Methods
- nrow
signature(object = "dataSet"): number of rows of the dataset.
- ncol
signature(object = "dataSet"): number of columns of the dataset.
- dim
signature(object = "dataSet"): returns the dimensions of the dataset.
- rowRatings
signature(object = "dataSet"): returns the number of ratings on each row.
- colRatings
signature(object = "dataSet"): returns the number of ratings on each column.
- numRatings
signature(object = "dataSet"): returns the total number of ratings.
- [
signature(x = "dataSet", i = "ANY", j = "ANY", drop = "ANY")): returns a subset of the dataset.
- coerce
signature(from = "dataSet", to = "matrix")
- rowAverages
signature(object = "dataSet"): returns the average rating on each row.
- colAverages
signature(object = "dataSet"): returns the average rating on each column.
Examples
x <- matrix(sample(c(0:5), size = 100, replace = TRUE,
prob = c(.6,.08,.08,.08,.08,.08)), nrow = 20, byrow = TRUE)
x <- defineData(x)
colRatings(x)
rowRatings(x)
numRatings(x)
sparsity(x)
a <- x[1:10,2:3]