"Accessing parameter values by macros"

keyser84
keyser84 New Altair Community Member
edited November 5 in Community Q&A
I want to write some parameter values into the filename string of my output file, e.g. when iterating over the number of clusters in k-Means I want the output files "output_2.arff", "output_3.arff", etc.

Setting the filename to "output_%{operator.KMeans.parameter.k}.arff" does not work.

I found a workaround here: http://rapid-i.com/rapidforum/index.php/topic,801.0.html
A process log is used to read current parameter values, is then converted to an example set and by data macro definition a macro holding the appropriate value is defined.

Isn't there a simpler way to access current parameter values via macros?

Answers

  • land
    land New Altair Community Member
    Hi,
    yes there is simpler solution to that: Insert a SingleMacroDefinition and define your macro there. Then use the ParameterCloner to copy the parameterValue you want in your macro into the value parameter of the SingleMacroDefinition operator. Et voila!


    Greetings,
      Sebastian
  • keyser84
    keyser84 New Altair Community Member
    Thank you. That works.