"groovy script return type"

florinelul
florinelul New Altair Community Member
edited November 5 in Community Q&A
hi all

i've written a script that parses association rules and returns and example set. now i want to write this example set to my database, using the "Write database" operator (i'm using a mysql db).
however, when i'm trying to connect the output of my "Execute script" operator to the input of the "Write database" op, RM fails to recognize the output of my script as an example set, although this is the returned type. hence the operators are incompatible.
if i bind the output directly to "result", the script works fine and the exampleset is displayed properly.

is there a way to convert the output of a script to an example set? (specific operator / script methods etc.)

basicaly, this is what my script looks like:

(...)
MemoryExampleTable table = new MemoryExampleTable(attributes);
(...)
ExampleSet exampleSet = table.createExampleSet();
return exampleSet;

i know i can accomplish this by using the Java API, but I wanted to keep this inside RM so any help would be appreciated.

Florin.
Tagged:

Answers

  • haddock
    haddock New Altair Community Member
    Hi Florin,

    Actually, if you search back in this forum you'll see that I've been exactly down your path; because of the quite significant changes between 4.x and 5.0 I decided to buy the Extension white paper. In there we have, on the meta data ...
    The only way of not loosing them when writing your own code is to build your own Extension to RapidMiner.
    So there you have it, from the Master's voice!


    Toodles
  • land
    land New Altair Community Member
    So there you have it, from the Master's voice!
    Hmmm, I will print this in bold letters and pin it on my wall. :)

    But yes, this is still valid.

    Greetings,
      Sebastian