Skip to content

Cross-validation Train MSE #81

Description

@hlmtran

Even with train_track_loss flag set to false, it seems to report mse for runs that reach max iteration. This looks to be separate from HECA and MOCA decompositions having 0 MSE for train set loss during CV.

library(RcppML)
data(aml)

testCV = RcppML::nmf(aml,k=c(2:10),test_fraction = 0.05,track_train_loss=F,seed=12,cv_seed=123)

testCV2 = RcppML::nmf(aml,k=c(2:10),test_fraction = 0.05,track_train_loss=F,cv_seed=125)

ggplot(testCV, aes(x = k, y = train_mse)) +
  geom_line(color = "grey60", linewidth = 0.6) +
  geom_point(aes(color = total_iter), size = 1.5) +
  scale_color_viridis_c(
    option = "B",
    limits = c(0, 100)
  ) +
  labs(
    title = "seed 123, track_train_loss=F",
    x = "Rank (k)",
    y = "MSE",
    color = "Iteration"
  ) +
  theme_minimal()

ggplot(testCV2, aes(x = k, y = train_mse)) +
  geom_line(color = "grey60", linewidth = 0.6) +
  geom_point(aes(color = total_iter), size = 1.5) +
  scale_color_viridis_c(
    option = "B",
    limits = c(0, 100)
  ) +
  labs(
    title = "seed 125, track_train_loss=F",
    x = "Rank (k)",
    y = "MSE",
    color = "Iteration"
  ) +
  theme_minimal()
Image Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions