Return only the last value from Loop

Ray8989Ray8989 Member Posts: 4 Learner I
edited May 2020 in Help
Hi There, 
I started using rapidminer just today. There's one problem that I'm facing and I can't find the solution anywhere. 
Objective: So I want to do clustering for n max iterations, for each n I want to see the centroid value, after this, I want to only work with the example set that the clustering algorithm returned in the last run. 

I have done half of it, i.e, I have used Loop Parameter to see all n centroids. Each is the output of the Loop, but the problem here is that, each n also returns a corresponding example set, so I end up with n example sets which I do NOT want.
I only want the final example set. How can I get that example set? 


Best Answer


  • Options
    Telcontar120Telcontar120 Moderator, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 Unicorn
    If you have a collection of examplesets being returned, you can just use the "Select" operator to specify the one you want to keep (you could even do this automatically by making a macro for the loop iterations and using that as the number of the value to return in the Select operator).  If you are trying to do something more complex perhaps you can post your xml so it is a bit clearer.
    Brian T.
    Lindon Ventures 
    Data Science Consulting from Certified RapidMiner Experts
  • Options
    lionelderkrikorlionelderkrikor Moderator, RapidMiner Certified Analyst, Member Posts: 1,195 Unicorn
    Hi @Ray8989,

    Maybe I have misunderstood your final goal,
    but you can apply the clustering model with max_runs = n to your dataset in parallel of the Loop Parameters operator.
    Please look at the process in attached file to understand what I mean...


  • Options
    Ray8989Ray8989 Member Posts: 4 Learner I
    edited May 2020
  • Options
    Ray8989Ray8989 Member Posts: 4 Learner I
    lionelderkrikor, It does work. And that is what the end goal was. But I want to use only one instance of Clustering. 
    Can you please guide me where and how to use macro?
  • Options
    Ray8989Ray8989 Member Posts: 4 Learner I
    @lionelderkrikor works exactly as I wanted! Thank you!
Sign In or Register to comment.