Skip to content

Commit 44dbea9

Browse files
committed
Style the code
1 parent ed55a5b commit 44dbea9

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

R/mfairInitialization.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ createMFAIR <- function(Y, X,
6868
if (Y_missing) { # Y is partially observed
6969
warning("If there are a large number of missing entries, we recommend setting Y_sparse = TRUE!")
7070
}
71-
if(inherits(Y, "sparseMatrix")){
71+
if (inherits(Y, "sparseMatrix")) {
7272
Y <- as.matrix(Y)
7373
message("The main data matrix Y has been transferred to the normal matrix mode!")
7474
}
@@ -89,8 +89,8 @@ createMFAIR <- function(Y, X,
8989
}
9090

9191
# if (Y_missing) {
92-
# a_sq <- matrix(nrow = N, ncol = 0)
93-
# b_sq <- matrix(nrow = M, ncol = 0)
92+
# a_sq <- matrix(nrow = N, ncol = 0)
93+
# b_sq <- matrix(nrow = M, ncol = 0)
9494
# } else {
9595
# a_sq <- matrix(nrow = 1, ncol = 0)
9696
# b_sq <- matrix(nrow = 1, ncol = 0)

R/mfairPredict.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ setMethod(
2525
Y_hat <- tcrossprod(
2626
do.call(cbind, object@Z[which_factors]),
2727
do.call(cbind, object@W[which_factors])
28-
)
28+
)
2929
if (add_mean) {
3030
Y_hat <- Y_hat + object@Y_mean
3131
}

vignettes/ml100k.Rmd

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ mfairObject <- createMFAIR(Y, X, Y_sparse = TRUE, K_max = 3)
4646
4747
# Fit the MFAI model
4848
mfairObject <- fitGreedy(
49-
mfairObject, save_init = TRUE, sf_para = list(verbose_loop =FALSE)
49+
mfairObject,
50+
save_init = TRUE, sf_para = list(verbose_loop = FALSE)
5051
)
5152
```
5253

@@ -125,7 +126,8 @@ mfairObject_pmt@initialization <- mfairObject@initialization
125126
126127
# Fit the MFAI model
127128
mfairObject_pmt <- fitGreedy(
128-
mfairObject_pmt, sf_para = list(verbose_loop = FALSE)
129+
mfairObject_pmt,
130+
sf_para = list(verbose_loop = FALSE)
129131
)
130132
```
131133

@@ -184,7 +186,8 @@ mfairObject_both@initialization <- mfairObject@initialization
184186
185187
# Fit the MFAI model
186188
mfairObject_both <- fitGreedy(
187-
mfairObject_both, sf_para = list(verbose_loop = FALSE)
189+
mfairObject_both,
190+
sf_para = list(verbose_loop = FALSE)
188191
)
189192
```
190193

0 commit comments

Comments
 (0)