This paper aims to make an innovating contribution to the field of technology-enhanced vocabulary learning. We report on a machine learning experiment that supports vocabulary item selection for didactic purposes. We tested two machine-learning algorithms to predict the difficulty level of lexical items as reported by intermediate-advanced learners of Spanish as a foreign language and analyzed the predictive power of various features on this task. This methodology can be especially useful in data-driven autonomous learning contexts. It makes it possible to create adaptive environments that select the most appropriate target items for different types of vocabulary learning activities. We will describe the empirical results of the experiments, and will also show how the methodology is integrated in an on-line learning environment.