I have been told by other grad students that it is a good idea to take the Ph.D. course given by a professor who you would want to be advised by in the future and even joining their lab.
In my case, there is a course given by a professor who I would want as a graduate advisor and possibly having him on my committee. This is an applied machine learning course in the PSYC department (I'm a social science Ph.D. student). However, there is also a graduate machine learning course given in the CS department that is more advanced, and I would obviously get more out of it.
So, should I take the course given by the potential advisor, or the more "interesting" course risking the lack of exposure?