I'll say what I think it's more important: to be more careful. CedarPawn said it already: avoiding trouble comes before getting out of it. It doesn't surprise me someone trained in physical combat would only engage in it as a last resort.
I've been robbed on seven occasions, all of them being a kid. I tried to resist (actually escape) only once, and ended up getting beaten up badly and stripped to my underwear. I was thirteen.
In any case, every time it happened, I didn't see it coming. In fact, the last time I did, but I ignored the possibility completely. I was waiting for the bus in Panamericana and these two guys on bicycles came buy, asked for the time, passed by on the opposite direction a couple minutes later, and finally returned once more. Only then I thought it didn't look right. They stopped, produced revolvers, and I won't go through what happened next. Don't worry, they didn't hurt me. I'll just say that making the experience alive depended pretty much 100% on their mercy.
I wasn't lucky that day in Panamericana, I was allowed to live. I'd been lucky if they pulled the trigger and the gun failed. But they didn't pull the trigger. They got what they wanted and decided to let me go. No luck involved there. I wasn't unlucky either. Had I been more cautious, I would have gotten out of there in time. I had all the time I needed and more.
I was fifteen years old and with six robberies under my belt, obviously a slow learner. But from that point on I started paying close attention to my surroundings, and after twenty years that seventh time remains the last. Of course I had a bit of luck, but at least I tried to make sure I could always count with some.
One time I was returning home after work at 2 AM and spotted three guys sitting on the sidewalk "cordón" across the street, on the corner of Arcos and Juramento, in Belgrano. My building was fifty meters away. All three wore Excursionistas shirts. Excursionistas isn't Boca. It's a small barrio football team with very few fans, and they were known for being troublesome. Three of them together wearing the club's shirt at such late hour, on a day that wasn't a game day? Chances of being barrasbravas rose high in my calculations. I was holding the key in my pocket and ready to run for my home. A soon as I heard movement (some ten meters past them), I ran. I closed the glass door just in time to see them hit against it. I ran for the stairs, passing the elevator by. I wanted to get out of their range asap. I didn't know if the had guns. If they did, it'd be crazy to think they'd shoot me through the door, but I wasn't 100% sure they wouldn't do it. They could be crazy, or on drugs, or anything. I didn't want to be lucky because they shot and missed.
That was the only time potential attackers turned out to be so. I encountered more people looking or behaving suspicious. I'll never know if my instincts and observations were right or wrong. Maybe they weren't delinquents. Or maybe they were and for some reason they let me go and waited for the next guy. Maybe something told them I wasn't the perfect target. I don't know. What I do know is that a mix of awareness, readiness and possibly paranoia together with some luck turned out to work so far.
Why do I say all this? Because it appears to me that some of you are too concerned about how to defend yourselves when you could avoid getting to that point, and I could be exaggerating but it looks like some think that being armed equals being safe. You'll never be safe. Maybe more prepared. But what are the chances an unaware armed person with little training could beat an attacker they didn't see coming at all? They'd probably need all the luck they could get.
I'm not saying that arming yourselves is a bad idea, I'm saying it's not a solution. I'm saying that you should me more concerned about where you're standing at any given time rather than avoiding "dangerous" areas or hours. Then you can think about getting your weapon and fight training.