The Altair Community is migrating to a new platform to provide a better experience for you. The RapidMiner Community will merge with the Altair Community at the same time. In preparation for the migration, both communities are on read-only mode from July 15th - July 24th, 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.
Options

RM5 precondition and postcondition definition

radoneradone RapidMiner Certified Expert, Member Posts: 74 Guru
edited November 2018 in Help
I have two classes MyOperator and MyOperatorChain (the first exends Operator and the second OperatorChain .
When MyOperator is used standalone - everything is OK and it marks problems with types.

The problem is, when the MyOperator is placed into MyOperatorChain. I must have forgot something in my code because the operator does not report any errors and also the output port is not colored  by any type until the RM process is executed.

MyOperator (which extends Operator) has the following rules defined:

       protected InputPort inImg = getInputPorts().createPort("MyIOObject");
protected OutputPort outExSet = getOutputPorts().createPort("ExampleSet");

public MyOperator(OperatorDescription description) {
super(description);
               inImg.addPrecondition(new SimplePrecondition(inImg, new MetaData(MyIOObject.class)));
getTransformer().addRule(new GenerateNewMDRule(outExSet, ExampleSet.class));
       }
MyOperatorChain (which extends OperatorChain) has the following rules defined:

       private InputPort imgIn = getInputPorts().createPort("myIO");
private OutputPortExtender innerOut = new OutputPortExtender("window", getSubprocess(0).getInnerSources());
protected InputPortExtender innerIn = new InputPortExtender("example set",getSubprocess(0).getInnerSinks(),
                                     new MetaData(ExampleSet.class), true);
private OutputPort exsOut = getOutputPorts().createPort("example set");

       public FeatureExtractionOperator(OperatorDescription description) throws OperatorException {
super(description, "Executed process");
               innerIn.start();
innerOut.start();
               imgIn.addPrecondition(new SimplePrecondition(imgIn, new MetaData(MyIOObject.class)));
getTransformer().addRule(new OneToManyPassThroughRule(imgIn, innerOut.getManagedPorts()));
getTransformer().addGenerationRule(exsOut, ExampleSet.class);
       }
Any help / suggestions would be really appreciated.
image

radone
Tagged:

Answers

  • Options
    haddockhaddock Member Posts: 849 Maven
    Hi there,

    Did you get Sebastian's paper from the RM shop?

  • Options
    radoneradone RapidMiner Certified Expert, Member Posts: 74 Guru
    Yes, I have bought the white paper about extending RM 5. However, it seems that I don't fully understand the cause of the problem.
  • Options
    haddockhaddock Member Posts: 849 Maven

    Cool, check out page 14, Does that help?

    Hope so!

  • Options
    fischerfischer Member Posts: 439 Maven
    Hi,

    apart from page 14, I recommend page 21 :-)

    You are missing a SubprocessTransformationRule. Rules are never evaluated in your subprocess.

    Cheers,
    Simon
  • Options
    radoneradone RapidMiner Certified Expert, Member Posts: 74 Guru
    Thank you very much. It helped :-)

    For anyone dealing with the same problem - adding
    getTransformer().addRule(new SubprocessTransformRule(getSubprocess(0)));
    to constructor of MyOperatorChain will fix the problem.
Sign In or Register to comment.