Searching for AGN and pulsar candidates in 4FGL unassociated sources using machine learning