Name of ML discipline for trainable clusterer - supervised clustering, or group ID assignment Is there a name for a machine learning algorithm, that learns 'clustering approach' from examples of clustered datapoints (with different numbers of clusters each time)?

Imagine the training set as an ensemble of sets with their clusters assigned.

Has anyone please encountered a similar problem in any literature? My goal is to read something more about this problem.

Example #1: 
Underlying rule: "cluster words to the same group if they do exist on the same page of an imagined storybook"
Training dataset:
1) Source values: [banana,car,rock,orange] -&gt; Target groups: [banana and orange],[car],[rock]
2) Source values: [kiwi,audi,folswagen] -&gt; [kiwi,audi,folswagen]
...) .. and so on...


... And that we do not know the original story, but only instances of (datapoints -> their groupping). And also we do not know the rule :)

Example #2: 
Underlying rule: "be evil - cluster like kmeans, but if there seems to be a cloud of points looking like a smiley, do not cluster at all!"
Training dataset: 
1) Source values: [bunch of points in a shape of two circles] -&gt; [each circle is a cluster]
2) Source values: [bunch of points and a cloud of points in a shape of smiley] -&gt; []
...) and so on ...


Yes it can be solved by detecting if there is the smiley, but we do not know the rule, we want the algorithm to learn it from the data.

Edit:
maybe the word clustering is not a wise choice from me. The quality of output will not be evaluated by user, but on a big validation set to see if the algorithm did learn from samples it has seen. There also supposedly does exist one best solution, from the nature of our problem (the underlying rule is always present, although not known).

Original, unclear, description before editing:
The problem is as follows: 
Each row of data is a shuffled list/set of datapoints (source variable) and their assignment to groups (target variable).
It would seem as a classification task, BUT the groups make sense only to each specific datarow (and their number also varies).
It would seems as a clustering task, BUT the underlying principle needs to be applied again and again to each different row.
Perhaps you are looking for some combination of Meta clustering and Ensemble clustering?

Meta clustering


  A sampling-based approach that searches for distance
  metrics that yield the clusterings most useful to the user


...


  
  Generate many good, yet qualitatively different, baselevel
  clusterings of the same data.
  Measure the similarity between the base-level clusterings
  generated in the first step so that similar clusterings
  can be grouped together.
  Organize the base-level clusterings at a meta level (either
  by clustering or by low-dimension projection) and
  present them to users.
  


Ensemble Clustering


  In statistics and machine learning, ensemble methods use multiple learning algorithms to obtain better predictive performance than could be obtained from any of the constituent learning algorithms alone. Unlike a statistical ensemble in statistical mechanics, which is usually infinite, a machine learning ensemble consists of only a concrete finite set of alternative models, but typically allows for much more flexible structure to exist among those alternatives.