Consensus function based on cluster-wise two level clustering