Phase estimation has applications from quantum imaging to gravitational-wave detection. In areas such as biological-system sampling or quantum metrology, it is crucial to optimally acquire information from a very limited number of probes. To address this need, the authors describe and experimentally verify a machine-learning method for optimal adaptive single-photon phase estimation based on a small number of trials. This approach could be used to optimize quantum metrology protocols, and can be extended to general multiparameter scenarios.