Questions about Branch operator
Hello, everybody.
I am using "Branch" operator
and have 4 questions regarding it.
-- 1. If the condition of the Branch operator is "if the number of examples >= 100"
I want to do "something" as usual in "Then" subpart,
but want to do "nothing" in "Else" subpart,
That is, in the "Else" part, just do "nothing", so it is disconected and there is no output from there
Then in some cases, there is error, because of no output from there.
So how can I solve this problem??
-- 2. If the condition of "Branch" is "if the number of examples == 100"
then what should I use as the condition of the Branch operator??
-- 3. If the condition of the Branch is satisfied, it will go to "Then" subpart,
otherwise, it will go to "Else" subpart.
If it goes to "Then" part, I want it to connect to operator A
Otherwise ("Else"), I want it to connect to operator B.
That is, if it passes thru "Then" part, I want to go to operator A after exiting the Branch
Otherwise("Else"), I want to go to operator B after exiting the Branch
Is there any way I can do this??
-- 4. Both "Then" part and "Else" part can have multiple output ports.
If I want to create 3 output ports in the "Then"
and want to create 2 output ports in the "Else"
is it possible??
Thank you in advance
Best Answers
-
kayman Member Posts: 662 UnicornYou can use different output ports indeed, so for the if section you can use output one and add a dedicated operator on the out 1 connection so it will only receive data is the condition is matched. For the else part you can use output 2 and again assign a dedicated operator. This will only get into action if it receives data.
The other questions are not too clear for me, would you have some practical examples ?6 -
MartinLiebig Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 RM Data ScientistHi @morphism,
you can just use Extract macro before and extract the number of examples in a macro called e.g. nExa. Then you can go for expression and use
if(eval(%{nExa})==100,TRUE,FALSE)
to get this done.
For the other question: You can ofc leave this empty. But it feels like Handle Exception is also an operator of interest for you.
BR,
Martin- Sr. Director Data Solutions, Altair RapidMiner -
Dortmund, Germany6
Answers
Dear kayman:
Oh! I understand what you mean. Thank you.
So question 3 and 4 are solved.
Other two questions are briefly:
1. I want to disconnect either one of "Then" or "Else".
But it may cause error in some cases.
So what is the best programming if I don't want to do anything and leave it empty in "Else"
2. If the condition is "the number of examples == 100",
I guess there is no such condition statement in "Branch"'s condition
Hello, mschmitz.
Nice explanation! I just checked that your explanation works. I learned a lot.
Thank you and see you again!
Best wishes,
K. Chang