Prediction of Microsegregation Based on Machine Learning and Its Extension to a Macrosegregation Simulation