"Loop output"

XodarapXodarap MemberPosts:6Contributor II
edited June 2019 inHelp
I have a Loop Labels, which works fine. For each label, I do a regression and calculate the performance vector. The trouble I'm having is that I want the output to be a table like:

label name | regression info | performance vector

I have two questions:
1. How can I figure out which one was the label for that loop? I tried using a "Select Attribute" to find the one called "label", but this didn't seem to work.
2. Supposing I can find out the label, how can I flatten this into a table structure?

I wasn't able to find anything in the documentation about loops.

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:2,531Unicorn
    Hi,
    不幸的是,经营者缺乏一些循环标签functionality that you would need for your task. But it can be replaced easily with a Loop Attributes operator, which will give you the label name as a macro. You must only switch the roles inside the loop operator manually.

    You might then use the log operator for outputting everything to a table. With the Log to Data operator, you might this again convert to an example set if you need it.

    Only thing I don't know, what the regression info is?

    Greetings,
    Sebastian
  • XodarapXodarap MemberPosts:6Contributor II
    Thanks! Using a plain attribute loop helped.

    The regression info I would like to store is the model output, i.e. the thing that's like "kx^n + cy^z + ...". So a row of the table would be like:

    label | formula to calculate label | error

    Is this possible to do?
  • XodarapXodarap MemberPosts:6Contributor II
    I take it back, what I actually want is the list of attributes that my optimizer chooses ;D. I have attached the xml to my setup; you can see in the log what I want is some way of saying the performance of the optimizer, the name of the label, and also which features were selected as most relevant. I thought of putting in a select by weights and then trying to log the output of that, but that didn't seem to work either. Is there any way I can accomplish this?


















































    < portSpacing端口= " source_exampleset" spacing="0"/>

























    < portSpacing端口= " source_exampleset" spacing="0"/>


  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, MemberPosts:2,531Unicorn
    Hi,
    I thought about this now for quite a while and I can't imagine of a simple solution using only operators. Of course, if you don't need it in a Log, you could simply use the Reporting Extension to write it to Excel for example. This could be relatively easily accomplished.

    But here's a way using a simple script solving the problem:










    <宏/ >

























    脚本操作符将结果string of the input object and add it as an macro called result. This is made accessible for the log operator using the Provide Macro as Log Value and finally added to the log using the Log operator.

    Greetings,
    Sebastian
  • XodarapXodarap MemberPosts:6Contributor II
    Awesome, thanks. This is exactly what I need.
Sign InorRegisterto comment.