Performing discretization and quantiling of data