[SOLVED] Unwanted column after Transpose and Rename by Example operators

ryijynshuiryijynshui Member Posts: 4 Contributor I
edited November 2018 in Help
Hi everyone,

Firstly thank you to the developers for this great product. I am very new to Rapid Miner and my back ground is more on hardware and database side.

My issue is more of an irritation than a problem. I am using a MySQL database which, has two tables. Both have two columns that monitors a web application. The tables are similar to information_schema.global_status and information_schema.global_variables. I will refer to the global_status table here.

I use the transpose operator on table to transpose VARIABLE_NAME data into column names and VARIABLE_VALUE data as data. The output, goes into a csv file, after the transpose operator:

row 1: attri_1,attri_2, etc
row 2: "aborted_clients","aborted_connects",...,"VARIABLE_NAME"
row 3: "0","0",...,"VARIABLE_VALUE"

Now I use the Rename by Example operator to remove row 1. However, notice that, VARIABLE_NAME is added creating an unwanted extra column in the output with VARIABLE_VALUE as the data. Is there anyway of stopping or removing the use of both these columns within the two processes? Is there another process I have to use before pushing the output to a csv file? I am currently dumping the output to a csv file but the idea is to write the result to a database.

Thanks for your help.
Ryi-Jyn

Answers

  • ryijynshuiryijynshui Member Posts: 4 Contributor I
    I think I figured it out but surely there must be an elegant way of doing this? How about adding a tickbox on the Transpose operator to allow the user to ignore the colum, similar to "first row is header" when importing into a spreadsheet?

    Anyway the way I got around it was to...

    1. Add the Select Attribute operator
    2. In the Parameters window
      a. Change attribute filter type to single
      b. Set the attribute field to VARIABLE_NAME (see 1st post)
      c. tick both invert selection and include special attributes

    Job's a good'un.  :)
  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Actually instead of adding an "ignore this and that attribute if you do that job"-option we decided to keep our software modular and create a specialized operator for each small task :)
    Happy that you figured out how to get your job done!

    Best regards,
    Marius
  • ryijynshuiryijynshui Member Posts: 4 Contributor I
    The modular method makes sense,  but I am not convinced in this instance. A tick box in the Parameters view to exclude the original columns would make sense, as it is something that is available to import routines in various other software as standard.
  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    I thought you were talking about the Transpose operator, not the import operator.
    Our import operators of course allow to select the column you want to retrieve. In case of Read Database you have to compose your own query in the form
    SELECT myColumnName1, myColumnName2 FROM myTable;
    Best regards,
    Marius
  • ryijynshuiryijynshui Member Posts: 4 Contributor I
    That option could be placed in the Transpose operator's Parameter window as there are no options available. When the result then is passed to the Rename By Example Values operator there would be no need to use the Select Attributes operator to filter out the original columns from the inital table. Less is more
Sign In or Register to comment.