Learn R Programming

sgdGMF (version 1.0)

partition: Split the data matrix in train and test sets

Description

Returns a list of two matrices train and test. train corresponds to the input matrix with a fixed persentage of entries masked by NA values. test is the complement of train and contains the values of the input matrix in the cells where train is NA, while all the other entries are filled by NA values.

Usage

partition(y, p = 0.3)

Arguments

y

input matrix to be split into train and test sets

p

fraction of observations to be used for the test set