A highly efficient reconstruction method has been developed for the direct computation of Hamiltonian matrices in the atomic orbital basis from density functional theory calculations originally performed in the plane wave basis. This enables machine learning calculations of electronic structures on a large scale, which are otherwise not feasible with standard methods, and thus fills a methodological gap in terms of accessible length scales.