Through the Internet, learners can access available information on e-learning platforms to facilitate their studies or to acquire new skills. However, finding the right information for their specific needs among the numerous available choices is a tedious task due to information overload. Recommender systems are a good solution to personalize e-learning by proposing useful and relevant information adapted to each learner using a set of techniques and algorithms. Collaborative filtering (CF) is one of the techniques widely used in such systems. However, the high dimensions and sparsity of the data are major problems. Since the concept of deep learning has grown in popularity, various studies have emerged to improve this form of filtering. In this work, we used an autoencoder, which is a powerful model in data dimension reduction, feature extraction and data reconstruction, to learn and predict student preferences in an e-learning recommendation system based on collaborative filtering. Experimental results obtained using the database created by Kulkarni et al. show that this model is more accurate and outperforms models based on K-nearest neighbor (KNN), singular value decomposition (SVD), singular value decomposition plus plus (SVD++) and non-negative matrix factorization (NMF) in terms of the root-mean-square error (RMSE) and mean absolute error (MAE).