Knowledge tracing (KT) is a crucial technique for modelling learners in intelligent education. Deep learning has been applied to knowledge tracing to improve the tracing accuracy of the model substantially. However, compared with traditional knowledge tracing methods, deep knowledge tracing lacks effective feedback to teachers or students. The connection between the input data features and the output tracing results cannot be well explained. It is challenging to predict students' performance in the future period based on a small number of samples in practice. In this paper, we propose a deep knowledge tracing model based on Bayesian inference (TBKT). Specifically, a priori data subsets are formed by sampling the training data, and data augmentation is performed on the data subsets by Bayesian regression. The model is trained to approximate the Bayesian posterior distribution based on a small subset combined with query data. The model is trained on the ASSISTments2009 dataset with interpretability and achieves an AUC metric similar to the original transformer.