The 3G Partnership Project (3GPP) defined network slicing as a set of resources that could be scaled up and down to cover users' requirements. Machine learning and network slicing will be used together to manage and optimize resources efficiently. Sharing resources across multiple operators, such as towers, spectrum and infrastructure, can reduce the cost of 5G resources. In the proposed prototype, the end-user is connected to more than eight inter and intra-slices according to the demands. A set of slices is implemented over the 5G networks to provide an efficient service to the end-user using softwarization and virtualization technologies. Traffic is generated over multiple scenarios then End-to-End slicing traffic was analyzed after generating realtime traffic over the 5G networks. Also, all the features extracted from the traffic based on the flow behaviours and a set of elements selected from the datasets according to machine learning behaviours. Multiple machine learning algorithms are applied to our datasets using MATLAB classification application. After that, the best model is chosen to train and predict the slices using less CPU and training time to reduce the computational power in future networks and build a sustainable environment. Furthermore, the regression application predicts the slice type on the third dataset with the minimum squared error.