Achieving ultra-reliable low latency communications (URLLC) in massive machine type communication networks requires novel medium access mechanisms to accommodate a huge number of traffic arrivals. Random access based on LTE-A suffers from collisions and long latency when two or more devices select the same preamble to initiate channel access simultaneously and this problem becomes severe in mMTC networks. In this paper, we propose a machine learning based scheme that allows an eNB to predict the number of arrivals at each random access slot and allocate preambles accordingly. We demonstrate that, by combining arrival prediction with group based dynamic preamble reservation, the grouped devices are able to achieve URLLC under bursty traffic conditions and meanwhile the performance of non-grouped devices is also improved.