From the Large-Scale Structure to the Milky Way halo:Machine Learning Techniques for Structure Detection and Analysis