gun tuning tangent
If a bot dodges 30% of the time going straight then turning to the right and 70% of the time going straight all the way, Neural Targeting averages both patterns and shoots slightly to the right, missing both patterns. In other words, it is awful against Walls.
Increasing K is what makes the gun choose the "straight all the way" pattern alone and achieve 70% hit rate.
Yeah, but you have other factors which would affect which scan is closest, like forward distance to wall, time since decel, distance last 10 etc. which all affect what the enemy motion will be. That is the advantage of this over plain single-tick pattern matching (which works better than regular pattern matching, but is slow/memory hungry). Even having k=3 would be quite fast for each kNN compared to what works well in guns now, where I can easily use k=150 and not skip any turns.
Also, once it gets onto one of the branches which suggest it will follow the '70%' you mention, the act of following that branch will make it more likely to further follow similar branches in the future, so it won't end up in between, but rather will end up at a different path completely.
Having a classifier which differentiates both patterns solves the problem (distance to corners against Walls).
If not, making many k-NN searches with k=1 gives you 30% of the ticks from one pattern and 70% of the ticks from the other pattern, and the resulting pattern is a 30%/70% mix of the two. It assumes a 3rd unseen pattern can be predicted from 2 previous patterns.
Should perform well against orbital movement, where turn rate changes gradually with distance and a 3rd unseen turn rate (or a zig-zag) can be predicted from 2 others. But perform bad against pattern movement, where patterns don't change gradually with classifiers.