Learning effective good variables from physical data