Typhoons are among the greatest natural hazards along East Asian coasts. Typhoon-related precipitation can produce flooding that is often only predictable a few hours in advance. Here, we present a machine-learning method comparing projected typhoon tracks with past trajectories, then using the information to predict flood hydrographs for a watershed on Taiwan. The hydrographs provide early warning of possible flooding prior to typhoon landfall, and then real-time updates of expected flooding along the typhoon's path. The method associates different types of typhoon tracks with landscape topography and runoff data to estimate the water inflow into a reservoir, allowing prediction of flood hydrographs up to two days in advance with continual updates. Modelling involves identifying typhoon track vectors, clustering vectors using a self-organizing map, extracting flow characteristic curves, and predicting flood hydrographs. This machine learning approach can significantly improve existing flood warning systems and provide early warnings to reservoir management.