Detecting a change point is a crucial task in statistics that has been recently extended to the quantum realm. A source state generator that emits a series of single photons in a default state suffers an alteration at some point and starts to emit photons in a mutated state. The problem consists in identifying the point where the change took place. In this Rapid Communication, we build a pseudo-on-demand single-photon source to prepare the photon sequences, and consider a learning agent that applies Bayesian inference on experimental data to solve this problem. This learning machine adjusts the measurement over each photon according to the past experimental results and finds the change position in an online fashion. Our results show that the local-detection success probability can be largely improved by using such a machine-learning technique. This protocol provides a tool for improvement in many applications where a sequence of identical quantum states is required.