The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Coloring IO object data

HaoyangHaoyang Member Posts: 19 Learner I
Hi,

I defined an IOobject datatype, and assigned a color to it, I find it when there is too much lines consisting this type of data in a process, the previous lines will not show the correct color and this data was removed from the output of the operator(no data when I hover my mouse above the output port). It seems RM only render the last few lines that carries this type of data. I also tested this with breakpoints, I connected several operators outputting this same type of object, and have a breakpoint for each of them, when I executed the operators one by one, the first four operators have normal output line color. However, when I executed the fifth operator, the color for the first one returned to gray which was the default. Sometimes, this breakpoint method have kept all the color and sometimes not, if I don't set the breakpoint and execute the process as a whole, there will only be the last 4 lines colored. Also, even in the case where all the colors were kept because of the breakpoint, when I go to the higher process and return to this subprocess, the color will again only available to the last 4 lines. It seems that you have used a buffer or what and have cleared them after execution, without keeping the color.

Best,
Haoyang

Best Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data Scientist
    Solution Accepted
    Hi,
    looks like your metadata transformation code doesnt work? Then it would only show the right color after execution.

    BR,
    Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data Scientist
    Solution Accepted
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data Scientist
    Solution Accepted
    The AbstractAnomalyModel used in the code above is also a custom model defined in this extension.

    I think you need to register it in the PlugitInit ( https://github.com/MartinLiebig/rapidminer-anomalydetection/blob/master/src/main/java/com/rapidminer/extension/anomalydetection/PluginInitAnomalyDetection.java , line 67) and need to profide some config in the resources if you want to have a specific color.

    Out of interest: What kind of extension are you working on? Maybe our product team can give you a hand.

    BR,
    Martin

    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • HaoyangHaoyang Member Posts: 19 Learner I
    Solution Accepted
    @MartinLiebig

    I think I found the solution, if I just want to define the metadata and color of a port, I should use the GenerateNewMDRule function, which will take a port and IOobject as input. In this case, my operator output port get the correct color. However, I implemented a super operator where this colored-port-operator is put into, when I put the operator into my self-implemented super operator, its ports lost its metadata and color, so I further investigated your ALSOOperator.java and find it necessary to add a 
    getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
    to any super operator to make sure it keeps the metadata of operators inside.

    Best,
    Haoyang

Answers

  • HaoyangHaoyang Member Posts: 19 Learner I
    @MartinLiebig
    Hi, thanks for answering, I believe it's the reason.
    Could you kindly show me an example of setting the metadata transformation? I believe if I can define what kind of metadata a port is going to output, then it will automatically be colored to the right color?

    Best,
    Haoyang
  • HaoyangHaoyang Member Posts: 19 Learner I
    @MartinLiebig
    Thanks, I get it. Seems I will have to define transformation rules for each port.

    But I still have some problem, I implemented my own ioobject, which extends ResultObjectAdapter. When I used this class in the function getMetaData(), then it says my class is not a MetaData class. However, when I went to change my class to extends MetaData, I can no longer use it as  an IOobject, what should I do to get some datatype I want to pass around as an IOobject and can be used as a MetaData.

    I am new to extending RM, sorry about bothering you with so much questions.

    Best,
    Haoyang
  • HaoyangHaoyang Member Posts: 19 Learner I
    @MartinLiebig

    I am working on something to allow users to use first order logic to build tree/flowchart structures in RM, and more than that, I am also using python operators to make it more powerful which I am unable to tell at this stage because it's a research project I am working on. After all, I am quite happy you have such a good community for me to get support.

    Best,
    Haoyang
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data Scientist
    Hi,
    You have to define two classes. One for the metadata, one for the object itself. Thats what you register in the PluginInit.
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
Sign In or Register to comment.