Bruce Willis, Jason Statham, Sam L. Jackson, Jude Law, Sean Connery, Prince William, Sir Patrick Stewart... those are just off the top of my head (see what I did there?) of famous and attractive actors that are either shaved bald or shorn short. I don't think anyone would call them less attractive.
My husband started going bald probably in his early 20s. He has the typical pattern - thin/sparse at the front with a receding hairline, bald spot at the back, with thicker hair around the back and sides. He keeps it cut short (about a half an inch-inch long) and I think he looks wonderful.
Also have a really good friend that shaves his head bald because he started thinning in his early 20s. I've never seen him with hair, but he's really attractive. He has a girlfriend that he met and moved in in the last couple of years, but he also dated extensively before he met her; never had a problem attracting girls because he lacked hair. I imagine he'd look fine with hair, but he's very striking without it, and there is something kind of bold and daring about a young guy that shaves his head - no matter what the reason behind the decision was.
If you're in your 20s and thinning, it is most likely genetic. You could check with your doctor to make sure you don't have any vitamin or hormone deficiencies (and get your thyroid checked), but otherwise it is kind of inevitable that it will happen.
You don't have to shave it down to shiny bald, just keep it cut short (think military cuts) and work on your confidence levels. You are not going to lose out on any women that you'd actually be interested in. Just remember, if they only loved you for your hair, then they're pretty damned superficial and would leave you if you aged or had any other appearance changes that weren't up to their idea of "attractive."
There are plenty of women that are attracted to men with no/short hair. There are plenty of sexy bald/shorn-short guys out there. Be one of them.