Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
statwangz committed Sep 19, 2023
1 parent 0e81a42 commit 02dfd48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Y_obs <- Y + matrix(
)
# Create MFAIR object
mfairObject <- createMFAIR(Y_obs, X, K_max = K_true)
mfairObject <- createMFAIR(Y_obs, as.data.frame(X), K_max = K_true)
# Fit the MFAI model
mfairObject <- fitGreedy(mfairObject, sf_para = list(verbose_loop = FALSE))
Expand Down Expand Up @@ -129,7 +129,7 @@ Y_train[-train_set] <- NA
Y_test[train_set] <- NA
# Create MFAIR object
mfairObject <- createMFAIR(Y_train, X, K_max = K_true)
mfairObject <- createMFAIR(Y_train, as.data.frame(X), K_max = K_true)
# Fit the MFAI model
mfairObject <- fitGreedy(mfairObject, sf_para = list(verbose_loop = FALSE))
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ more minutes.
``` r
set.seed(20230306)
library(mfair)
#> Loading required package: rpart

# Simulate data
# Set the data dimension and rank
Expand Down Expand Up @@ -98,7 +97,9 @@ Y_obs <- Y + matrix(
)

# Create MFAIR object
mfairObject <- createMFAIR(Y_obs, X, K_max = K_true)
mfairObject <- createMFAIR(Y_obs, as.data.frame(X), K_max = K_true)
#> The main data matrix Y is completely observed!
#> The main data matrix Y has been centered with mean = 0.147726471347656!

# Fit the MFAI model
mfairObject <- fitGreedy(mfairObject, sf_para = list(verbose_loop = FALSE))
Expand Down Expand Up @@ -141,7 +142,9 @@ Y_train[-train_set] <- NA
Y_test[train_set] <- NA

# Create MFAIR object
mfairObject <- createMFAIR(Y_train, X, K_max = K_true)
mfairObject <- createMFAIR(Y_train, as.data.frame(X), K_max = K_true)
#> The main data matrix Y is partially observed!
#> The main data matrix Y has been centered with mean = 0.227350351267622!

# Fit the MFAI model
mfairObject <- fitGreedy(mfairObject, sf_para = list(verbose_loop = FALSE))
Expand Down

0 comments on commit 02dfd48

Please sign in to comment.