Spin class sounds like a good way to stay focused on effort and improvement.
Companionship and a little healthy competition may be a big part of it.
My problem while riding alone is that I slip off into la-la land and just enjoy the ride.
I've tried doing hill repeats and other evil drills, but it just doesn't appeal to me.
It feels good on day one, but there is no motivation for day two.