Assigning a Metrics Variable

I am trying to understand why metrics in the compile isn’t reflecting mymetrics.

  #  Define the Metrics
  mymetrics <- "mse"

  #Define the Loss
  myloss <- "mse"

  model %>% compile(
    loss = myloss,
    optimizer = myoptimizer, 
    metrics = mymetrics

When I run this, it is showing that metrics is “mae” in the environment instead of “mse”. What is the appropriate way to pass the metrics as a variable to things like the compiling and plotting of a model?

This looks like you’re working with a Keras model.
For debugging purposes have you tried simply using the string as the argument to the function? Maybe like:

model %>% compile(
    loss = 'mse',
    optimizer = myoptimizer, 
    metrics = 'mse'

If even this doesn’t work then there might be a different issue.