We propose the concept of machine learning configuration interaction (MLCI) whereby an artificial neural network is trained on-the-fly to predict important new configurations in an iterative selected configuration interaction procedure. We demonstrate that the neural network can discriminate between important and unimportant configurations, that it has not been trained on, much better than by chance. MLCI is then used to find compact wave functions for carbon monoxide at both stretched and equilibrium geometries. We also consider the multireference problem of the water molecule with elongated bonds. Results are contrasted with those from other ways of selecting configurations: first-order perturbation, random selection, and Monte Carlo configuration interaction. Compared with these other serial calculations, this prototype MLCI is competitive in its accuracy, converges in significantly fewer iterations than the stochastic approaches, and requires less time for the higher-accuracy computations.