Title: | Low Rank Matrix Factorization S3 Objects |
---|---|
Description: | Provides S3 classes to represent low rank matrix decompositions. |
Authors: | Alex Hayes [aut, cre] |
Maintainer: | Alex Hayes <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0.9000 |
Built: | 2024-10-26 02:54:40 UTC |
Source: | https://github.com/rohelab/lrmf3 |
Coerce an object to a factor analysis like factorization
as_fa_like(x, ...) ## S3 method for class 'list' as_fa_like(x, ...)
as_fa_like(x, ...) ## S3 method for class 'list' as_fa_like(x, ...)
x |
Object to coerce |
... |
Ignored. |
Object as svd_like()
object.
Coerce an object to LRMF class
as_svd_like(x, ...) ## S3 method for class 'list' as_svd_like(x, ...)
as_svd_like(x, ...) ## S3 method for class 'list' as_svd_like(x, ...)
x |
Object to coerce |
... |
Ignored. |
Object as svd_like()
object.
Description array size and type
dim_and_class(x)
dim_and_class(x)
x |
Matrix or vector |
Description as character vector
A low rank matrix factorization of a matrix X
is
parameterized by X ~= X %*% B %*% t(Y)
. The
object is "factor analysis-like" because the middle
matrix in the decomposition is arbitrary rather than
diagonal.
fa_like(Z, B, Y, subclasses = NULL, ...)
fa_like(Z, B, Y, subclasses = NULL, ...)
Z |
A matrix of embeddings for each observation. |
B |
A mixing matrix describing how observation embeddings and topics interact. Does not have to be diagonal! |
Y |
A matrix describing the compositions of various topics or factors. |
subclasses |
A character vector of subclasses.
Optional, defaults to |
... |
Optional additional items to pass to the constructor. |
s <- svd(as.matrix(trees)) fa_like(s$u, diag(s$d), s$v)
s <- svd(as.matrix(trees)) fa_like(s$u, diag(s$d), s$v)
Standard benchmarking dataset for recommendation systems. 100k movie ratings on 1682 movies by 943 users. Each user has rated at least 20 movies.
ml100k
ml100k
An object of class dgCMatrix
with 943 rows and 1682 columns.
Stored as a Matrix::dgCMatrix
object, which is a sparse
matrix. Each row corresponds to a user and each column to
a movie.
F. Maxwell Harper and Joseph A. Konstan. 2015. The MovieLens Datasets: History and Context. ACM Transactions on Interactive Intelligent Systems (TiiS) 5, 4, Article 19 (December 2015), 19 pages. DOI=http://dx.doi.org/10.1145/2827872
https://grouplens.org/datasets/movielens/100k/
A low rank matrix factorization of a matrix X
is
parameterized by X ~= u %*% diag(d) %*% t(v)
. The
object is "svd-like" because the middle matrix in
the decomposition must be strictly diagonal.
svd_like(u, d, v, subclasses = NULL, ...)
svd_like(u, d, v, subclasses = NULL, ...)
u |
A matrix "left singular-ish" vectors. |
d |
A vector of "singular-ish" values. |
v |
A matrix of "right singular-ish" vectors. |
subclasses |
A character vector of subclasses.
Optional, defaults to |
... |
Optional additional items to pass to the constructor. |
s <- svd(as.matrix(trees)) # using the constructor directly svd_like(s$u, s$d, s$v) # coercing svd-like lists as_svd_like(s)
s <- svd(as.matrix(trees)) # using the constructor directly svd_like(s$u, s$d, s$v) # coercing svd-like lists as_svd_like(s)