Just shooting back is key. In cases where the perp was hit they stop fighting and some even take their own life.
What they are looking for is a stage on which to act out their valiant death against the evil they think surrounds them. If they are trying to kill someone in order to provoke a deadly response, it's asking a lot for the average citizen to handle them as a hostage resolution to keep from taking their life.
Just shoot back. Quite a few veterans wouldn't hesitate. Responding to deadly force is what stops the incident, the sooner the better. Responding even if you aren't trained is better than not responding - as the civilian in Britain attacked by three knife wielding thugs points out.
You don't even have to tell them your favorite football team.
You don't have to be specially trained or educated or experienced or a veteran or whatever. What you have to do is fight back, and that alone sends a message that no, we are not sheep ready to be slaughtered, and we won't hunker down waiting to be killed off while SWAT waits for the Chief to get permission from his boss, or sadly, for the police to find they departed the scene too quickly and were observed.
It's either fight back right now or find out why you could get pizza quicker than a cop when the shooting starts. In America, even the pizza guy is a better deal than a cop two minutes too late.
Doing something has a better chance of success than doing nothing. If you are waiting to fight back until you are trained, you won't fight back when you need to.