Getting a W on your transcript for grad school applications I am a Computer Engineering major at a top 15 engineering school. My goal is to get into grad school for Machine Learning. I have set very lofty goals and am aiming for places like MIT, Berkeley, Stanford, CMU etc. I will be applying for safeties too but these top tier colleges remain the goal.

I have got a 3.8 in college till now. The issue is that I am messing up a lot in my electrical circuits analysis course. I am in the C to D range in the course. The professor is extremely harsh while grading and covers grad school material in an intro course. I am thinking of withdrawing from the course. I am confident that I can perform well next semester when I take it under different circumstances. Seeing as circuits aren't related to machine learning or computer science, I was wondering how bad would a W for this course look in my transcript, while having an otherwise great record.

I am also involved in research involving machine learning and will be doing so till the end of undergrad. It's this one thing which is worrying.
It is, of course, impossible to say how someone will look at it, but I doubt that very many people would think it odd or unusual. It is pretty easy for students to get in too deep with studies and the other things during undergraduate years. If you drop now and do well later few would think less of you, I predict. 

But if you make a habit of it, then things might be different. 

Since it is difficult to predict the time requirements for research, you have a ready-made explanation for getting in over your head for a term. 

However, a poor grade, such as a D in a major course would be cause for concern. Not necessarily disqualifying but it needs explanation.