Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dataSet-class

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]

rrecsys

Environment for Evaluating Recommender Systems

v0.9.7.3.1
GPL-3
Authors
Ludovik Çoba [aut, cre, cph], Markus Zanker [ctb], Panagiotis Symeonidis [ctb]
Initial release
2018-02-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.