Recurrent neural network with density-based clustering for group pattern detection in energy systems