Correctly assessing the consequences of events is essential for a successful interaction with the world. It not only requires a causal understanding of the world but also the ability to distinguish whether a given event is the result of an agent's own action (intervention) or simply the consequence of the world being in action (observation). Previous studies have shown that humans can learn causal structures, and that they can distinguish interventions from observations. These studies almost exclusively focused on structures where interventions led to a simple forward conditioned inference problem. We tested human subjects in a prediction game that required the integration over hidden causes, using a betting mechanism that allowed us to monitor subjects' beliefs. Subjects learned the causal structure and the conditional probabilities with appropriate feedback. Once learned, all but one were immediately able to correctly predict the causal effects of their interventions according to optimal causal reasoning.