I have been the only student showing up for class once. At that occasion, it was perfect because I really needed to discuss my upcoming shodan test - so we skipped the class, to talk instead. Don't remember who suggested it first.
I have taught classes with a single student - not so many times, maybe half a dozen times. I saw two very different reactions in the student:
1) Wow! Private lesson.
2) I really, really hate to get this much attention, with the instructor looking at me and talking to me all the time. (This despite the fact that I really tried not to overteach, but to mainly train with the student and not comment on everything he or she did).
If you have seen version 2 a few times, then maybe you prefer to cancel the class. I would think, though, that a student with this attitude is a probable dropout anyway, while the "wow! private lesson" is someone who will stay, at least for a while. I wouldn't talk about "ethics", well maybe if there is any amount of money involved as others already have pointed out. It seems to me that the teacher who cancels a class where he has one eager student, does not care much about his students. If you & the teacher agree to do something else together, that's fine but I would feel really lousy having spent my time travelling to class if it just was cancelled. If that happened repeatedly, I would quit showing up myself and if possible find someplace else to train.
I must strongly disgree with Larry Murrel. I find it extremely worth while to feel my teachers techniques, not just watch them. I really like being one of three students on the mat, and having the teacher training with the students.