5G is expected to provide network connectivity to not only classical devices (i.e. tablets, smartphones, etc) but also to the Internet Of Things (IOT), which will drastically increase the traffic load carried over the network. 5G will mainly rely on Network Function Virtualization (NFV) and Software Defined Network (SDN) to build flexible and on-demand instances of functional networking entities, via Virtual Network Functions (VNF). Indeed, 3GPP is devising a new architecture for the core network, which replaces point to point interfaces used in 3G and 4G, by a producer/consumer-based communication among 5G core network functions, facilitating deployment over a virtual infrastructure. One big advantage of using VNF, is the possibility of dynamically scaling, depending on traffic load (i.e. instantiate new resources to VNF when the traffic load increases, and reduce the number of resources when the traffic load decreases). In this paper, we propose a novel mechanism to scale 5G core network resources by anticipating traffic load changes through forecasting via Machine Learning (ML) techniques. The traffic load forecast is achieved by using and training a Neural Network on a real dataset of traffic arrival in a mobile network. Two techniques were used and compared: (i) Recurrent Neural Network (RNN), more specifically Long Short Term Memory Cell (LSTM); and (ii) Deep Neural Network (DNN). Simulation results showed that the forecast-based scalability mechanism outperforms the threshold-based solutions, in terms of latency to react to traffic change, and delay to have new resources ready to be used by the VNF to react to traffic increase.