Using neural networks to predict spatial structure in ecological systems