The pair-contact process with diffusion (PCPD), a generalized model of the ordinary pair-contact process (PCP) without diffusion, exhibits a continuous absorbing phase transition. Unlike the PCP, whose nature of phase transition is clearly classified into the directed percolation (DP) universality class, the model of PCPD has been controversially discussed since its infancy. To our best knowledge, there is so far no consensus on whether the phase transition of the PCPD falls into the unknown university classes or else conveys a new kind of non-equilibrium phase transition. In this paper, both unsupervised and supervised learning are employed to study the PCPD with scrutiny. Firstly, two unsupervised learning methods, principal component analysis (PCA) and autoencoder, are taken. Our results show that both methods can cluster the original configurations of the model and provide reasonable estimates of thresholds. Therefore, no matter whether the non-equilibrium lattice model is a random process of unitary (for instance the DP) or binary (for instance the PCP), or whether it contains the diffusion motion of particles, unsupervised learning can capture the essential, hidden information. Beyond that, supervised learning is also applied to learning the PCPD at different diffusion rates. We proposed a more accurate numerical method to determine the spatial correlation exponent nu _{perp }, which, to a large degree, avoids the uncertainty of data collapses through naked eyes.