Function that creates the design matrices necessary for the clustering algorithm to work.
Useful links