Learning how to create a data codebook